Xpath performance and xsi namespace
In my xpath, I need to use the "xsi" namespace to specify the xpath condition. It seems to be the performance of the xpath that uses the "xsi" namespace is extremly slow, compared with a similar xpath that does not use the name space, although the number of retrieved objects are the same in my test case.
What causes such a big difference in speed? Is that possible when I use the "xsi" namespace in the xpath, the xpath is not get rewritten? How can I improve the performance when using "xsi" namespace.
1)xpath not use the namespace
select extract(object_value, '/Test/Group/Object[uniqueName="a1"]') from Test where existsNode(object_value, '/Test/Group[uniqueName="N10001"])=1;
2)xpath use the "xsi" namespace
select extract(object_value, '/Test/Group/Object[uniqueName="a1" and @xsi:type="Architecture"]', 'xmlns="http://www.myspace.com/testXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') from Test where existsNode(object_value, '/Test/Group[uniqueName="N10001"])=1;
Yes, you'll need to workout where to split the document.. Good, and typical points to break up the entity are if you have a choice of one or more complex structures.
The following code may help with looking at this..
You'll need to register the XML Schema with gentables="false" so that all the types get generated.. You can then look at the types and see how many columns each type will generate if you build a table on it...
create or replace package XDB_ANALYZE_XMLSCHEMA_11100
authid CURRENT_USER
as
function analyzeStorageModel(COMPLEX_TYPE VARCHAR2) return XMLTYPE;
function analyzeStorageModel(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2) return XMLType;
function analyzeComplexType(COMPLEX_TYPE VARCHAR2) return XMLTYPE;
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2);
function printNestedTables(XML_TABLE varchar2) return XMLType;
function generateSchemaFromTable(P_TABLE_NAME varchar2, P_OWNER varchar2 default USER) return XMLTYPE;
function showSQLTypes(schemaFolder varchar2) return XMLType;
NAMESPACES varchar2(1024) := xdb_namespaces.XMLSCHEMA_PREFIX_XSD || ' ' || xdb_namespaces.XDBSCHEMA_PREFIX_XDB;
end XDB_ANALYZE_XMLSCHEMA_11100;
show errors
create or replace package body XDB_ANALYZE_XMLSCHEMA_11100
as
TYPE STORAGE_MODEL_T is RECORD
TYPE_NAME varchar2(128),
TYPE_OWNER varchar2(32),
STORAGE_MODEL XMLType
TYPE STORAGE_MODEL_LIST_T is TABLE OF STORAGE_MODEL_T;
TYPE BASETYPE_T is RECORD
SUBTYPE varchar2(128),
SUBTYPE_OWNER varchar2(32),
BASETYPE varchar2(128),
BASETYPE_OWNER varchar2(32)
TYPE BASETYPE_LIST_T IS TABLE OF BASETYPE_T;
DEPTH_COUNT NUMBER(2) := 0;
STORAGE_MODEL_LIST STORAGE_MODEL_LIST_T := STORAGE_MODEL_LIST_T();
BASETYPE_LIST BASETYPE_LIST_T := BASETYPE_LIST_T();
function getLocalAttributes(SQLTYPE varchar2, SQLTYPE_OWNER VARCHAR2) return XMLType;
function makeElement(ATTR_NAME varchar2)
return xmltype
as
VALID_NAME varchar2(4000) := ATTR_NAME;
begin
-- dbms_output.put_line('Processing : ' || ATTR_NAME);
if (ATTR_NAME LIKE '%$') THEN
VALID_NAME := SUBSTR(VALID_NAME,1,LENGTH(VALID_NAME) - 1);
end if;
return XMLTYPE( '<' || VALID_NAME || '/>');
end;
function getPathToRoot(SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return varchar2
as
TYPE_HIERARCHY varchar2(4000);
begin
SELECT sys_connect_by_path( OWNER || '.' || TYPE_NAME , '/')
INTO TYPE_HIERARCHY
FROM ALL_TYPES
WHERE TYPE_NAME = SUBTYPE
AND OWNER = SUBTYPE_OWNER
CONNECT BY SUPERTYPE_NAME = PRIOR TYPE_NAME
AND SUPERTYPE_OWNER = PRIOR OWNER
START WITH SUPERTYPE_NAME IS NULL
AND SUPERTYPE_OWNER IS NULL;
return TYPE_HIERARCHY;
end;
function expandSQLType(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return XMLType
as
STORAGE_MODEL XMLTYPE;
ATTRIBUTES XMLTYPE;
EXTENDED_TYPE XMLTYPE;
ATTR_COUNT NUMBER := 0;
CURSOR FIND_EXTENDED_TYPES
is
select TYPE_NAME, OWNER
from ALL_TYPES
where SUPERTYPE_NAME = SUBTYPE
and SUPERTYPE_OWNER = SUBTYPE_OWNER;
begin
dbms_output.put_line('Processing SQLType : "' || SUBTYPE_OWNER || '.' || SUBTYPE || '".' );
STORAGE_MODEL := makeElement(ATTR_NAME);
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@type',SUBTYPE)
into STORAGE_MODEL
from dual;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@typeOwner',SUBTYPE_OWNER)
into STORAGE_MODEL
from dual;
ATTRIBUTES := getLocalAttributes(SUBTYPE, SUBTYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + ATTRIBUTES.extract('/' || ATTRIBUTES.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),ATTRIBUTES)
into STORAGE_MODEL
from DUAL;
for t in FIND_EXTENDED_TYPES loop
EXTENDED_TYPE := expandSQLType('ExtendedType',T.TYPE_NAME,T.OWNER);
ATTR_COUNT := ATTR_COUNT + EXTENDED_TYPE.extract('/' || EXTENDED_TYPE.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),EXTENDED_TYPE)
into STORAGE_MODEL
from DUAL;
end loop;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@columns',ATTR_COUNT)
into STORAGE_MODEL
from dual;
return STORAGE_MODEL;
end;
function getTypeHierarchy(ELEMENT_NAME varchar2, TYPE_HIERARCHY varchar2)
return XMLType
as
SUBTYPE_HIERARCHY varchar2(4000);
ATTRIBUTES XMLTYPE;
SUBTYPE_STORAGE_MODEL XMLTYPE;
STORAGE_MODEL XMLTYPE;
ATTR_COUNT NUMBER := 0;
V_TYPE_OWNER varchar2(32);
V_TYPE_NAME varchar2(128);
CURSOR FIND_EXTENDED_TYPES
is
select TYPE_NAME, OWNER
from ALL_TYPES
where SUPERTYPE_NAME = V_TYPE_NAME
and SUPERTYPE_OWNER = V_TYPE_OWNER;
begin
dbms_output.put_line('Type Hierarchy : ' || TYPE_HIERARCHY );
if DEPTH_COUNT > 25 then
return null;
end if;
DEPTH_COUNT := DEPTH_COUNT + 1;
SUBTYPE_HIERARCHY := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'/',2));
V_TYPE_OWNER := substr(TYPE_HIERARCHY,2,instr(TYPE_HIERARCHY,'.',2) - 2);
if (instr(TYPE_HIERARCHY,'/',-1) > 1) then
V_TYPE_NAME := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'.',2) + 1,instr(TYPE_HIERARCHY,'/',2) - instr(TYPE_HIERARCHY,'.',2) -1);
else
V_TYPE_NAME := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'.') + 1);
SUBTYPE_HIERARCHY := null;
end if;
dbms_output.put_line('Processing : "' || V_TYPE_OWNER || '"."' || V_TYPE_NAME || '"');
STORAGE_MODEL := makeElement(ELEMENT_NAME);
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@type',V_TYPE_NAME)
into STORAGE_MODEL
from dual;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@typeOwner',V_TYPE_OWNER)
into STORAGE_MODEL
from dual;
ATTRIBUTES := getLocalAttributes(V_TYPE_NAME, V_TYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + ATTRIBUTES.extract('/' || ATTRIBUTES.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),ATTRIBUTES)
into STORAGE_MODEL
from DUAL;
if (SUBTYPE_HIERARCHY is not null) then
SUBTYPE_STORAGE_MODEL := getTypeHierarchy('subType',SUBTYPE_HIERARCHY);
ATTR_COUNT := ATTR_COUNT + SUBTYPE_STORAGE_MODEL.extract('/' || SUBTYPE_STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),SUBTYPE_STORAGE_MODEL)
into STORAGE_MODEL
from DUAL;
else
dbms_output.put_line('Processing All known SubTypes of : "' || V_TYPE_OWNER || '"."' || V_TYPE_NAME || '"');
for t in FIND_EXTENDED_TYPES loop
SUBTYPE_STORAGE_MODEL := expandSQLType('ExtendedType',T.TYPE_NAME,T.OWNER);
ATTR_COUNT := ATTR_COUNT + SUBTYPE_STORAGE_MODEL.extract('/' || SUBTYPE_STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),SUBTYPE_STORAGE_MODEL)
into STORAGE_MODEL
from DUAL;
end loop;
end if;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@columns',ATTR_COUNT)
into STORAGE_MODEL
from dual;
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL;
end;
function getStorageModel(TYPE_NAME VARCHAR2, TYPE_OWNER VARCHAR2)
return XMLType
as
BASETYPE varchar2(128);
BASETYPE_OWNER varchar2(32);
STORAGE_MODEL STORAGE_MODEL_T;
begin
dbms_output.put_line('Depth : ' || DEPTH_COUNT || '. Getting Storage Model for "' || TYPE_OWNER || '.' || TYPE_NAME || '".' );
if DEPTH_COUNT > 25 then
return null;
end if;
DEPTH_COUNT := DEPTH_COUNT + 1;
for i in 1..STORAGE_MODEL_LIST.count loop
STORAGE_MODEL := STORAGE_MODEL_LIST(i);
if (STORAGE_MODEL.TYPE_NAME = TYPE_NAME and STORAGE_MODEL.TYPE_OWNER = TYPE_OWNER) then
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL.STORAGE_MODEL;
end if;
end loop;
STORAGE_MODEL.TYPE_NAME := TYPE_NAME;
STORAGE_MODEL.TYPE_OWNER := TYPE_OWNER;
STORAGE_MODEL.STORAGE_MODEL := getTypeHierarchy('RootType',getPathToRoot(TYPE_NAME,TYPE_OWNER));
STORAGE_MODEL_LIST.extend(1);
STORAGE_MODEL_LIST(STORAGE_MODEL_LIST.count) := STORAGE_MODEL;
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL.STORAGE_MODEL;
end;
function getLocalAttributes(SQLTYPE varchar2, SQLTYPE_OWNER VARCHAR2)
return XMLType
as
CHILD_ATTR XMLTYPE;
ATTR_COUNT NUMBER := 0;
COLLECTION_TYPE varchar2(128);
COLLECTION_OWNER varchar2(32);
SUPERTYPE varchar2(128);
STORAGE_MODEL xmlType;
SQL_ATTRIBUTES XMLTYPE := xmlType('<SQLAttributes/>');
CURSOR FIND_CHILD_ATTRS
is
select ATTR_NAME, ATTR_TYPE_OWNER, ATTR_TYPE_NAME, INHERITED
from ALL_TYPE_ATTRS
where TYPE_NAME = SQLTYPE
and OWNER = SQLTYPE_OWNER
and INHERITED = 'NO'
order by ATTR_NO;
begin
for ATTR in FIND_CHILD_ATTRS loop
CHILD_ATTR := makeElement(ATTR.ATTR_NAME);
begin
-- Check for Attributes based on collection types, With Nested Table storage each Collection will cost 2 columns.
select ELEM_TYPE_NAME, ELEM_TYPE_OWNER
into COLLECTION_TYPE, COLLECTION_OWNER
from ALL_COLL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
-- Attribute is a Collection Type. Each Collection requires 2 columns.
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@collectionType',COLLECTION_TYPE)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@collectionOwner',COLLECTION_OWNER)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@columns',2)
into CHILD_ATTR
from dual;
exception
when no_data_found then
-- Attribute is not a collection type.
begin
-- Check for Attributes based on non-scalar types.
select SUPERTYPE_NAME
into SUPERTYPE
from ALL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
-- Attribute is based on a non-scalar type. Find the Storage Model for this type.
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@type',ATTR.ATTR_TYPE_NAME)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@owner',ATTR.ATTR_TYPE_OWNER)
into CHILD_ATTR
from dual;
STORAGE_MODEL := getStorageModel(ATTR.ATTR_TYPE_NAME, ATTR.ATTR_TYPE_OWNER);
select appendChildXML(CHILD_ATTR,'/' || ATTR.ATTR_NAME,STORAGE_MODEL)
into CHILD_ATTR
from DUAL;
-- The cost of a non scalar Type is the number of attributes plus one for Type and one for the TYPEID.
select insertChildXML(CHILD_ATTR,'/' || ATTR.ATTR_NAME,'@columns',STORAGE_MODEL.extract(STORAGE_MODEL.GETROOTELEMENT() || '/@columns').getNumberVal() + 2)
into CHILD_ATTR
from dual;
exception
when no_data_found then
-- Attribute is based on a scalar type
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@type',ATTR.ATTR_TYPE_NAME)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@columns',1)
into CHILD_ATTR
from dual;
end;
end;
select appendChildXML(SQL_ATTRIBUTES,'/' || SQL_ATTRIBUTES.getRootElement(),CHILD_ATTR)
into SQL_ATTRIBUTES
from DUAL;
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.getRootElement() || '/@columns').getNumberVal();
end loop;
select insertChildXML(SQL_ATTRIBUTES,'/' || SQL_ATTRIBUTES.getRootElement(),'@columns',ATTR_COUNT)
into SQL_ATTRIBUTES
from dual;
return SQL_ATTRIBUTES;
end;
function analyzeStorageModel(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return XMLType
as
ROOT_NODE_NAME VARCHAR2(128);
TYPE_DEFINITION XMLTYPE;
STORAGE_MODEL XMLTYPE;
ATTR_COUNT NUMBER := 0;
begin
dbms_output.put_line('Processing Attribute : "' || ATTR_NAME || '". SQLType="' || SUBTYPE_OWNER || '.' || SUBTYPE || '".' );
TYPE_DEFINITION := makeElement(ATTR_NAME);
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@type',SUBTYPE)
into TYPE_DEFINITION
from dual;
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@owner',SUBTYPE_OWNER)
into TYPE_DEFINITION
from dual;
STORAGE_MODEL := getStorageModel(SUBTYPE, SUBTYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + STORAGE_MODEL.extract('/' || STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@columns',ATTR_COUNT)
into TYPE_DEFINITION
from dual;
select appendChildXML
TYPE_DEFINITION,
'/' || TYPE_DEFINITION.getRootElement(),
STORAGE_MODEL
into TYPE_DEFINITION
from DUAL;
return TYPE_DEFINITION;
end;
function analyzeStorageModel(COMPLEX_TYPE VARCHAR2)
return XMLTYPE
as
SQLTYPE VARCHAR2(128);
SQLTYPE_OWNER VARCHAR2(32);
RESULT XMLTYPE;
begin
STORAGE_MODEL_LIST := STORAGE_MODEL_LIST_T();
select SQLTYPE, SQLTYPE_OWNER
into SQLTYPE, SQLTYPE_OWNER
from USER_XML_SCHEMAS,
xmlTable
xmlnamespaces
'http://www.w3.org/2001/XMLSchema' as "xsd",
'http://xmlns.oracle.com/xdb' as "xdb"
'/xsd:schema/xsd:complexType'
passing Schema
columns
COMPLEX_TYPE_NAME varchar2(4000) path '@name',
SQLTYPE varchar2(128) path '@xdb:SQLType',
SQLTYPE_OWNER varchar2(32) path '@xdb:SQLSchema'
where COMPLEX_TYPE_NAME = COMPLEX_TYPE;
-- dbms_output.put_line('Processing SQLType : "' || SQLTYPE_OWNER || '.' || SQLTYPE || '".' );
return analyzeStorageModel(COMPLEX_TYPE,SQLTYPE,SQLTYPE_OWNER);
exception
when no_data_found then
dbms_output.put_line('Unable to find SQLType mapping for complexType : "' || COMPLEX_TYPE || '".' );
return null;
end;
function analyzeSQLType(ATTR_NAME VARCHAR2, TARGET_TYPE_NAME VARCHAR2, TARGET_TYPE_OWNER VARCHAR2)
return XMLType
as
ROOT_NODE_NAME VARCHAR2(128);
ATTR_DETAIL XMLTYPE;
XPATH_EXPRESSION VARCHAR2(129);
CURSOR FIND_CHILD_ATTRS is
select ATTR_NAME, ATTR_TYPE_OWNER, ATTR_TYPE_NAME, INHERITED
from ALL_TYPE_ATTRS
where OWNER = TARGET_TYPE_OWNER
and TYPE_NAME = TARGET_TYPE_NAME
order by ATTR_NO;
CHILD_ATTR XMLTYPE;
ATTR_COUNT NUMBER := 0;
TEMP number;
COLLECTION_TYPE_NAME varchar2(256);
COLLECTION_TYPE_OWNER varchar2(256);
begin
-- dbms_output.put_line('Processing Attribute ' || ATTR_NAME || ' of ' || TARGET_TYPE_OWNER || '.' || TARGET_TYPE_NAME );
ATTR_DETAIL := makeElement(ATTR_NAME);
XPATH_EXPRESSION := '/' || ATTR_DETAIL.GETROOTELEMENT();
for ATTR in FIND_CHILD_ATTRS loop
begin
select ELEM_TYPE_NAME, ELEM_TYPE_OWNER
into COLLECTION_TYPE_NAME, COLLECTION_TYPE_OWNER
from ALL_COLL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
CHILD_ATTR := analyzeSQLType(ATTR.ATTR_NAME, COLLECTION_TYPE_NAME, COLLECTION_TYPE_OWNER );
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.GETROOTELEMENT() || '/@columns').getNumberVal();
select appendChildXML(ATTR_DETAIL,XPATH_EXPRESSION,CHILD_ATTR)
into ATTR_DETAIL
from DUAL;
exception
when no_data_found then
begin
select 1
into TEMP
from ALL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
CHILD_ATTR := analyzeSQLType(ATTR.ATTR_NAME, ATTR.ATTR_TYPE_NAME, ATTR.ATTR_TYPE_OWNER );
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.GETROOTELEMENT() || '/@columns').getNumberVal();
select appendChildXML(ATTR_DETAIL,XPATH_EXPRESSION,CHILD_ATTR)
into ATTR_DETAIL
from DUAL;
exception
when no_data_found then
ATTR_COUNT := ATTR_COUNT + 1;
end;
end;
end loop;
select insertChildXML(ATTR_DETAIL,XPATH_EXPRESSION,'@columns',ATTR_COUNT)
into ATTR_DETAIL
from dual;
return ATTR_DETAIL;
end;
function analyzeComplexType(COMPLEX_TYPE VARCHAR2)
return XMLType
as
RESULT xmltype;
SQLTYPE varchar2(128);
SQLTYPE_OWNER varchar2(32);
begin
select SQLTYPE, SQLTYPE_OWNER
into SQLTYPE, SQLTYPE_OWNER
from USER_XML_SCHEMAS,
xmlTable
xmlnamespaces
'http://www.w3.org/2001/XMLSchema' as "xsd",
'http://xmlns.oracle.com/xdb' as "xdb"
'/xsd:schema/xsd:complexType'
passing Schema
columns
COMPLEX_TYPE_NAME varchar2(4000) path '@name',
SQLTYPE varchar2(128) path '@xdb:SQLType',
SQLTYPE_OWNER varchar2(32) path '@xdb:SQLSchema'
where COMPLEX_TYPE_NAME = COMPLEX_TYPE;
result := analyzeSQLType(COMPLEX_TYPE,SQLTYPE,SQLTYPE_OWNER);
select insertChildXML(RESULT,'/' || COMPLEX_TYPE,'@SQLType',SQLTYPE)
into result
from dual;
return result;
end;
function showSQLTypes(schemaFolder varchar2) return XMLType
is
xmlSchema XMLTYPE;
begin
select xmlElement
"TypeList",
xmlAgg
xmlElement
"Schema",
xmlElement
"ResourceName",
extractValue(res,'/Resource/DisplayName')
xmlElement
"complexTypes",
select xmlAgg
xmlElement
"complexType",
xmlElement
"name",
extractValue(value(XML),'/xsd:complexType/@name',NAMESPACES)
xmlElement
"SQLType",
extractValue(value(XML),'/xsd:complexType/@xdb:SQLType',NAMESPACES)
from table
xmlsequence
extract
xdburitype(p.path).getXML(),
'/xsd:schema/xsd:complexType',
NAMESPACES
) xml
-- order by extractValue(value(XML),'/xsd:complexType/@name',NAMESPACES)
).extract('/*')
into xmlSchema
from path_view p
where under_path(res,schemaFolder) = 1
order by extractValue(res,'/Resource/DisplayName');
return xmlSchema;
end;
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2)
as
SYSTEM_GENERATED_NAME varchar2(256);
COLLECTION_TABLE_NAME varchar2(256);
CLUSTERED_INDEX_NAME varchar2(256);
PARENT_INDEX_NAME varchar2(256);
RENAME_STATEMENT varchar2(4000);
begin
COLLECTION_TABLE_NAME := COLLECTION_TABLE_PREFIX || '_TABLE';
CLUSTERED_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_DATA';
PARENT_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_LIST';
select TABLE_NAME
into SYSTEM_GENERATED_NAME
from ALL_NESTED_TABLES
where PARENT_TABLE_NAME = XMLTABLE
and PARENT_TABLE_COLUMN = XPATH
and OWNER = USER;
RENAME_STATEMENT := 'alter table ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' ||COLLECTION_TABLE_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_INDEXES
where TABLE_NAME = COLLECTION_TABLE_NAME
and INDEX_TYPE = 'IOT - TOP'
and OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || CLUSTERED_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_IND_COLUMNS
where COLUMN_NAME = XPATH
and TABLE_NAME = XMLTABLE
and TABLE_OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || PARENT_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
end;
function processNestedTable(currentLevel in out number, currentNode in out XMLType, query SYS_REFCURSOR)
return XMLType
is
thisLevel number;
thisNode xmlType;
result xmlType;
begin
thisLevel := currentLevel;
thisNode := currentNode;
fetch query into currentLevel, currentNode;
if (query%NOTFOUND) then
currentLevel := -1;
end if;
while (currentLevel >= thisLevel) loop
-- Next Node is a decendant of sibling of this Node.
if (currentLevel > thisLevel) then
-- Next Node is a decendant of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlElement
"Collection",
extract(thisNode,'/Collection/*'),
xmlElement
"NestedCollections",
result
into thisNode
from dual;
else
-- Next node is a sibling of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlconcat(thisNode,result) into thisNode from dual;
end if;
end loop;
-- Next Node is a sibling of some ancestor of this node.
return thisNode;
end;
function printNestedTables(XML_TABLE varchar2)
return XMLType
is
query SYS_REFCURSOR;
result XMLType;
rootLevel number := 0;
rootNode xmlType;
begin
open query for
select level, xmlElement
"Collection",
xmlElement
"CollectionId",
PARENT_TABLE_COLUMN
) as XML
from USER_NESTED_TABLES
connect by PRIOR TABLE_NAME = PARENT_TABLE_NAME
start with PARENT_TABLE_NAME = XML_TABLE;
fetch query into rootLevel, rootNode;
result := processNestedTable(rootLevel, rootNode, query);
select xmlElement
"NestedTableStructure",
result
into result
from dual;
return result;
end;
function generateSchemaFromTable(P_TABLE_NAME varchar2, P_OWNER varchar2 default USER)
return XMLTYPE
as
xmlSchema XMLTYPE;
begin
select xmlElement
"xsd:schema",
xmlAttributes
'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",
'http://xmlns.oracle.com/xdb' as "xmlns:xdb"
xmlElement
"xsd:element",
xmlAttributes
'ROWSET' as "name",
'rowset' as "type"
xmlElement
"xsd:complexType",
xmlAttributes
'rowset' as "name"
xmlElement
"xsd:sequence",
xmlElement
"xsd:element",
xmlAttributes
'ROW' as "name",
table_name || '_T' as "type",
'unbounded' as "maxOccurs"
xmlElement
"xsd:complexType",
xmlAttributes
table_name || '_T' as "name"
xmlElement
"xsd:sequence",
xmlAgg(ELEMENT order by INTERNAL_COLUMN_ID)
into xmlSchema
from (select TABLE_NAME, INTERNAL_COLUMN_ID,
case
when DATA_TYPE = 'VARCHAR2' then
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
xmlElement
"xsd:simpleType",
xmlElement
"xsd:restriction",
xmlAttributes
'xsd:string' as "base"
xmlElement
"xsd:maxLength",
xmlAttributes
DATA_LENGTH as "value"
when DATA_TYPE = 'DATE' then
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
'xsd:dateTime' as "type",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
else
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
'xsd:anySimpleType' as "type",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
end ELEMENT
from all_tab_cols c
where c.TABLE_NAME = P_TABLE_NAME
and c.OWNER = P_OWNER
group by TABLE_NAME;
return xmlSchema;
end;
end XDB_ANALYZE_XMLSCHEMA_11100;
show errors
--You can use this as follows...
SQL> set long 100000
SQL> select xdb_analyze_xmlschema.analyzeStorageModel('ComponentA') from dual;
<ComponentA type="COMPONENTA_T" owner="XDBTEST" columns="50">
<RootType type="COMPONENTA_T" typeOwner="XDBTEST" columns="50">
<SQLAttributes columns="14">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<COMPONENTA_UNIQUENAME type="COMPONENTA_UNIQUENAME_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTA_UNIQUENAME_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTA_UNIQUENAME>
<COMPONENTA_DESCRIPTION type="COMPONENTA_DESCRIPTION_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTA_DESCRIPTION_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTA_DESCRIPTION>
</SQLAttributes>
<ExtendedType type="COMPONENTB_T" typeOwner="XDBTEST" columns="30">
<SQLAttributes columns="12">
<COMPONENTB_CONTROLNUMBER type="COMPONENTB_CONTROLNUMBER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTB_CONTROLNUMBER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTB_CONTROLNUMBER>
<COMPONENTB_COREFOLDER type="COMPONENTB_COREFOLDER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTB_COREFOLDER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTB_COREFOLDER>
</SQLAttributes>
<ExtendedType type="COMPONENTD_T" typeOwner="XDBTEST" columns="18">
<SQLAttributes columns="18">
<COMPONENTD_FINDINGTYPE type="COMPONENTD_FINDINGTYPE_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_FINDINGTYPE_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_FINDINGTYPE>
<COMPONENTD_PRIORITY type="COMPONENTD_PRIORITY_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_PRIORITY_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_PRIORITY>
<COMPONENTD_SUMMARY type="COMPONENTD_SUMMARY_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_SUMMARY_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_SUMMARY>
</SQLAttributes>
</ExtendedType>
</ExtendedType>
<ExtendedType type="COMPONENTC_T" typeOwner="XDBTEST" columns="6">
<SQLAttributes columns="6">
<COMPONENTC_CONTROLNUMBER type="COMPONENTC_CONTROLNUMBER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTC_CONTROLNUMBER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTC_CONTROLNUMBER>
</SQLAttributes>
</ExtendedType>
</RootType>
</ComponentA>THis will tell you that a table based xml element of the complexType 'componentA' will have approx 50 columns..
Similar Messages
-
XPATH-expressions and namespaces
I have a xml-file for testing my xpath expression, like this:
<a>
<b>
<c>aaa</c>
<d>
<e>111</e>
</d>
</b>
<b>
<c>bbb</c>
<d>
<e>222</e>
</d>
</b>
<b>
<c>ccc</c>
<d>
<e>333</e>
</d>
</b>What I want is to get the value of element 'e', based on a check on what the value of element 'c' is. I alway know the value of element 'c'.
I solve this by using this xpath-expression in my xsl-file:
<xsl:variable name="xpathTest" select="//e[../preceding-sibling::c = 'bbb']" />This expression should return '222', and it works!!!
But, when I use the another xml-file with a similar structure, with namespaces, like this:
<body xsi:type="fkpsoap:FKPSOAPOperationResponse">
<FKPSOAPOperationResponse>
<fkpsoap_1:fkrdk178_output_data>
<fkpsoap_1:fkrdk178_list_cust_information>
<fkpsoap_1:fkrdk178_list_customerinfo>
<fkpsoap_1:fkrdk178_list_variable_code> aaa </fkpsoap_1:fkrdk178_list_variable_code>
<fkpsoap_1:fkrdk178_list_value_name>
<fkpsoap_1:fkrdk178_list_value_text> 111 </fkpsoap_1:fkrdk178_list_value_text>
</fkpsoap_1:fkrdk178_list_customerinfo>
<fkpsoap_1:fkrdk178_list_customerinfo>
<fkpsoap_1:fkrdk178_list_variable_code> bbb </fkpsoap_1:fkrdk178_list_variable_code>
<fkpsoap_1:fkrdk178_list_value_name>
<fkpsoap_1:fkrdk178_list_value_text> 222 </fkpsoap_1:fkrdk178_list_value_text>
</fkpsoap_1:fkrdk178_list_customerinfo>
<fkpsoap_1:fkrdk178_list_customerinfo>
<fkpsoap_1:fkrdk178_list_variable_code> ccc </fkpsoap_1:fkrdk178_list_variable_code>
<fkpsoap_1:fkrdk178_list_value_name>
<fkpsoap_1:fkrdk178_list_value_text> 333 </fkpsoap_1:fkrdk178_list_value_text>
</fkpsoap_1:fkrdk178_list_customerinfo>
</fkpsoap_1:fkrdk178_list_cust_information>
</fkpsoap_1:fkrdk178_output_data>
</FKPSOAPOperationResponse>
</body>Then the xpath-expression does not work!
I can easily extract the value of the element similar to the element 'e' in my test-file, but then I will always get the value from the first occurance of 'e', which is '111'.
Can anyone help me with this?Most APIs which let you create XPath objects allow you to create a namespace context and attach it to the XPath object. Your API most likely does too, whatever it is. Then you would just use the prefixes which the namespace context describes in your XPath expression.
(This namespace context generally maps prefixes to namespace URIs. Remember that the namespace URI is really what the XPath is looking for and the prefix is just a short cut for you to use.) -
Using xpath.evaluate(): xpath exp with multiple namespaces
Hi,
I have to evaluate a xpath expression with parent node and child node having different namespaces. Like : env:parent/mig:child.
I have set the namespacecontext for the child node[i.e., for the prefix 'mig'.]
But am getting this error :
javax.xml.transform.TransformerException: Prefix must resolve to a namespace: env
How can I set the namespace context for both the parent and child nodes? Or is there are any other way of doing it?
I cant use //mig:child as the requirement needs the whole xpath expression [env:parent/mig:child] to be given as input for the xpath.evaluate() method.
Here's the code :
File file = new File("D:\\Backup\\XMLs\\test.xml");
Document xmlDocument = builder.parse(file);
XPath xpathEvaluator = XPathFactory.newInstance().newXPath();
xpathEvaluator.setNamespaceContext(new NamespaceContextProvider("env", "http://xmlns.oracle.com/apps/account/1.0"));
NodeList nodeList =
(NodeList)xpathEvaluator.evaluate("/env:parent/mig:child", xmlDocument,
XPathConstants.NODESET);
xpathEvaluator.setNamespaceContext(new NamespaceContextProvider("mig", "http://xmlns.oracle.com/apps/account/1.0"));
Thanks in advance.If you want, I can help you tomorrow. Call me at my nieuwegein office or mail me at marco[dot]gralike[at]amis[dot]nl
I have some time tomorrow, so I can help you with this. My next presentation for UKOUG will be on XML indexes strategies anyway...
In the meantime and/or also have a look at:
XML Howto's (http://www.liberidu.com/blog/?page_id=441) specifically:
XML Indexing
* Unstructured XMLIndex (part 1) – The Concepts (http://www.liberidu.com/blog/?p=228)
* Unstructured XMLIndex (Part 2) – XMLIndex Path Subsetting (http://www.liberidu.com/blog/?p=242)
* Unstructured XMLIndex (Part 3) – XMLIndex Syntax Dissected (http://www.liberidu.com/blog/?p=259)
* Unstructured XMLIndex Performance and Fuzzy XPath Searches (http://www.liberidu.com/blog/?p=310)
* Structured XMLIndex (Part 1) – Rules of Numb (http://www.liberidu.com/blog/?p=1791)
* Structured XMLIndex (Part 2) – Howto build a structured XMLIndex (http://www.liberidu.com/blog/?p=1798)
* Structured XMLIndex (Part 3) – Building Multiple XMLIndex Structures (http://www.liberidu.com/blog/?p=1805)
The posts were based on Index for XML with Repeated Elements maybe that is a bit better to read than on my notepad on the internet (aka blog)
Edited by: Marco Gralike on Oct 28, 2010 7:51 PM -
XPath expression with multiple namespaces?
Hello all.
I have been scouring the forums and Google and can't seem to find anything similar to my problem.
I have the following XML with three namespaces. Two are defined in the root element and the third is defined in the the IdSession element. To make things even more confusing, the second and third namespaces have the same prefix, 'f'.
This is the xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<NamespaceTestCall xmlns="http://my.default/namespace"
xmlns:f="http://my.second/namespace">
...<f:Level1>
......<f:IdSession xmlns:f="http://my.third/namespace">12345</f:IdSession>
......<Language>ENG</Language>
...</f:Nivel1>
</NamespaceTestCall>
My question is, how do I get at the IdSession element? Don't I need to create an XPath object and assign it more than one NamespaceContext?
This is what I am doing:
Document xmlDocument = loadXML(xmlSource);
XPath xpathEvaluator = XPathFactory.newInstance().newXPath();
xpathEvaluator.setNamespaceContext(new NamespaceContextProvider("a", "http://my.third/namespace"));
... xpathEvaluator.evaluate("//a:IdSession", ...);
This code works but it might not return the 'IdSession' I want, since by searching like this '//a:IdSession' it is looking in the whole document. If there were another 'IdSession' somewhere else in the document with the same URI, it would be returned. I want the 'IdSession' that lives inside of 'Level1'.
So what I would like to do is something like this:
... xpathEvaluator.evaluate("/*/Level1/a:IdSession", ...);
But this does NOT work because 'Level1' has its own namespace. So what it seems like I need to do is the following:
... xpathEvaluator.evaluate("/*/b:Level1/a:IdSession", ...);
Having already added the 'Level1' namespace to the XPath object, with the prefix 'b'. But unlike JDOM, there is no 'add' functionality, only 'set', meaning if you call set twice the second call overwrites the first.
Is there anyway to do this?
Many thanks!
BobHello,
Sorry, that was my bad. I should have explained that NamespaceContextProvider is nothing more than my implementation of the NamespaceContext interface. The way I did it, I simply implemented getNamespaceURI() and getPrefix(). And the constructor accepted two parameters -- prefix and URI. So my problem was that when I assigned this NamespaceContext to my XPath object it would only have one prefix and one URI.
But I found an implementation here:
http://www.oreillynet.com/cs/user/view/cs_msg/50304
that instead of only having one prefix and URI uses a map. Thus its method setNamespace() adds the prefix and URi to the map, and getPrefix() and getPrefixes() retrieve them from the map.
Now when I want to use more than one namespace I simply call setNamespace() as many times as necessary, adding a prefix and URI pair each time, and when I am done I assign it to my XPath object.
And it works!
Thanks for the response!
Bob -
EXTREMELY SLOW XQUERY PERFORMANCE AND SLOW DOCUMENT INSERTS
EXTREMELY SLOW XQUERY PERFORMANCE AND SLOW DOCUMENT INSERTS.
Resolution History
12-JUN-07 15:01:17 GMT
### Complete Problem Description ###
A test file is being used to do inserts into a schemaless XML DB. The file is inserted and then links are made to 4
different collection folders under /public. The inserts are pretty slow (about
15 per second and the file is small)but the xquery doesn't even complete when
there are 500 documents to query against.
The same xquery has been tested on a competitors system and it has lightening fast performance there. I know it
should likewise be fast on Oracle, but I haven't been able to figure out what
is going on except that I suspect somehow a cartesian product is the result of
the query on Oracle.
### SQLXML, XQUERY, PL/SQL syntax used ###
Here is the key plsql code that calls the DBMS_XDB procedures:
CREATE OR REPLACE TYPE "XDB"."RESOURCEARRAY" AS VARRAY(500) OF VARCHAR2(256);
PROCEDURE AddOrReplaceResource(
resourceUri VARCHAR2,
resourceContents SYS.XMLTYPE,
public_collections in ResourceArray
) AS
b BOOLEAN;
privateResourceUri path_view.path%TYPE;
resource_exists EXCEPTION;
pragma exception_init(resource_exists,-31003);
BEGIN
/* Store the document in private folder */
privateResourceUri := GetPrivateResourceUri(resourceUri);
BEGIN
b := dbms_xdb.createResource(privateResourceUri, resourceContents);
EXCEPTION
WHEN resource_exists THEN
DELETE FROM resource_view WHERE equals_path(res, privateResourceUri)=1;
b := dbms_xdb.createResource(privateResourceUri, resourceContents);
END;
/* add a link in /public/<collection-name> for each collection passed in */
FOR i IN 1 .. public_collections.count LOOP
BEGIN
dbms_xdb.link(privateResourceUri,public_collections(i),resourceUri);
EXCEPTION
WHEN resource_exists THEN
dbms_xdb.deleteResource(concat(concat(public_collections(i),'/'),resourceUri));
dbms_xdb.link(privateResourceUri,public_collections(i),resourceUri);
END;
END LOOP;
COMMIT;
END;
FUNCTION GetPrivateResourceUri(
resourceUri VARCHAR2
) RETURN VARCHAR2 AS
BEGIN
return concat('/ems/docs/',REGEXP_SUBSTR(resourceUri,'[a-zA-z0-9.-]*$'));
END;
### Info for XML Querying ###
Here is the XQuery and a sample of the output follows:
declare namespace c2ns="urn:xmlns:NCC-C2IEDM";
for $cotEvent in collection("/public")/event
return
<cotEntity>
{$cotEvent}
{for $d in collection("/public")/c2ns:OpContextMembership[c2ns:Entity/c2ns:EntityIdentifier
/c2ns:EntityId=xs:string($cotEvent/@uid)]
return
$d
</cotEntity>
Sample output:
<cotEntity><event how="m-r" opex="o-" version="2" uid="XXX541113454" type="a-h-G-" stale="2007-03-05T15:36:26.000Z"
start="2007-03-
05T15:36:26.000Z" time="2007-03-05T15:36:26.000Z"><point ce="" le="" lat="5.19098483230079" lon="-5.333597827082126"
hae="0.0"/><de
tail><track course="26.0" speed="9.26"/></detail></event></cotEntity>19-JUN-07 04:34:27 GMT
UPDATE
=======
Hi Arnold,
you wrote -
Please use Sun JDK 1.5 java to perform the test case.Right now I have -
$ which java
/usr/bin/java
$ java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
sorry as I told you before I am not very knowledgeable in Java. Can you tell me what setting
s I need to change to make use of Sun JDK 1.5. Please note I am testing on Linux
. Do I need to test this on a SUN box? Can it not be modify to run on Linux?
Thanks,
Rakesh
STATUS
=======
@CUS -- Waiting for requested information -
Nice to see 13" retina but it has only Intel HD Graphics 4000 and does not have NVIDIA GeForce GT 650M with 1GB of GDDR5 memory card. How it will affect the speed, performance and other things compared to 15" retina where NVIDIA GeForce card is available.
The 15" Retina's will have better performance than any 13" Retina. Not only do the 15" machines have dedicated GPU's, but they also have quad-core processors, whereas the 13" Retina's only have dual-core processors.
-
QUERY PERFORMANCE AND DATA LOADING PERFORMANCE ISSUES
WHAT ARE QUERY PERFORMANCE ISSUES WE NEED TO TAKE CARE PLEASE EXPLAIN AND LET ME KNOW T CODES...PLZ URGENT
WHAT ARE DATALOADING PERFORMANCE ISSUES WE NEED TO TAKE CARE PLEASE EXPLAIN AND LET ME KNOW T CODES PLZ URGENT
WILL REWARD FULL POINT S
REGARDS
GURUBW Back end
Some Tips -
1)Identify long-running extraction processes on the source system. Extraction processes are performed by several extraction jobs running on the source system. The run-time of these jobs affects the performance. Use transaction code SM37 Background Processing Job Management to analyze the run-times of these jobs. If the run-time of data collection jobs lasts for several hours, schedule these jobs to run more frequently. This way, less data is written into update tables for each run and extraction performance increases.
2)Identify high run-times for ABAP code, especially for user exits. The quality of any custom ABAP programs used in data extraction affects the extraction performance. Use transaction code SE30 ABAP/4 Run-time Analysis and then run the analysis for the transaction code RSA3 Extractor Checker. The system then records the activities of the extraction program so you can review them to identify time-consuming activities. Eliminate those long-running activities or substitute them with alternative program logic.
3)Identify expensive SQL statements. If database run-time is high for extraction jobs, use transaction code ST05 Performance Trace. On this screen, select ALEREMOTE user and then select SQL trace to record the SQL statements. Identify the time-consuming sections from the results. If the data-selection times are high on a particular SQL statement, index the DataSource tables to increase the performance of selection (see no. 6 below). While using ST05, make sure that no other extraction job is running with ALEREMOTE user.
4)Balance loads by distributing processes onto different servers if possible. If your site uses more than one BW application server, distribute the extraction processes to different servers using transaction code SM59 Maintain RFC Destination. Load balancing is possible only if the extraction program allows the option
5)Set optimum parameters for data-packet size. Packet size affects the number of data requests to the database. Set the data-packet size to optimum values for an efficient data-extraction mechanism. To find the optimum value, start with a packet size in the range of 50,000 to 100,000 and gradually increase it. At some point, you will reach the threshold at which increasing packet size further does not provide any performance increase. To set the packet size, use transaction code SBIW BW IMG Menu on the source system. To set the data load parameters for flat-file uploads, use transaction code RSCUSTV6 in BW.
6)Build indexes on DataSource tables based on selection criteria. Indexing DataSource tables improves the extraction performance, because it reduces the read times of those tables.
7)Execute collection jobs in parallel. Like the Business Content extractors, generic extractors have a number of collection jobs to retrieve relevant data from DataSource tables. Scheduling these collection jobs to run in parallel reduces the total extraction time, and they can be scheduled via transaction code SM37 in the source system.
8). Break up your data selections for InfoPackages and schedule the portions to run in parallel. This parallel upload mechanism sends different portions of the data to BW at the same time, and as a result the total upload time is reduced. You can schedule InfoPackages in the Administrator Workbench.
You can upload data from a data target (InfoCube and ODS) to another data target within the BW system. While uploading, you can schedule more than one InfoPackage with different selection options in each one. For example, fiscal year or fiscal year period can be used as selection options. Avoid using parallel uploads for high volumes of data if hardware resources are constrained. Each InfoPacket uses one background process (if scheduled to run in the background) or dialog process (if scheduled to run online) of the application server, and too many processes could overwhelm a slow server.
9). Building secondary indexes on the tables for the selection fields optimizes these tables for reading, reducing extraction time. If your selection fields are not key fields on the table, primary indexes are not much of a help when accessing data. In this case it is better to create secondary indexes with selection fields on the associated table using ABAP Dictionary to improve better selection performance.
10)Analyze upload times to the PSA and identify long-running uploads. When you extract the data using PSA method, data is written into PSA tables in the BW system. If your data is on the order of tens of millions, consider partitioning these PSA tables for better performance, but pay attention to the partition sizes. Partitioning PSA tables improves data-load performance because it's faster to insert data into smaller database tables. Partitioning also provides increased performance for maintenance of PSA tables for example, you can delete a portion of data faster. You can set the size of each partition in the PSA parameters screen, in transaction code SPRO or RSCUSTV6, so that BW creates a new partition automatically when a threshold value is reached.
11)Debug any routines in the transfer and update rules and eliminate single selects from the routines. Using single selects in custom ABAP routines for selecting data from database tables reduces performance considerably. It is better to use buffers and array operations. When you use buffers or array operations, the system reads data from the database tables and stores it in the memory for manipulation, improving performance. If you do not use buffers or array operations, the whole reading process is performed on the database with many table accesses, and performance deteriorates. Also, extensive use of library transformations in the ABAP code reduces performance; since these transformations are not compiled in advance, they are carried out during run-time.
12)Before uploading a high volume of transaction data into InfoCubes, activate the number-range buffer for dimension IDs. The number-range buffer is a parameter that identifies the number of sequential dimension IDs stored in the memory. If you increase the number range before high-volume data upload, you reduce the number of reads from the dimension tables and hence increase the upload performance. Do not forget to set the number-range values back to their original values after the upload. Use transaction code SNRO to maintain the number range buffer values for InfoCubes.
13)Drop the indexes before uploading high-volume data into InfoCubes. Regenerate them after the upload. Indexes on InfoCubes are optimized for reading data from the InfoCubes. If the indexes exist during the upload, BW reads the indexes and tries to insert the records according to the indexes, resulting in poor upload performance. You can automate the dropping and regeneration of the indexes through InfoPackage scheduling. You can drop indexes in the Manage InfoCube screen in the Administrator Workbench.
14)IDoc (intermediate document) archiving improves the extraction and loading performance and can be applied on both BW and R/3 systems. In addition to IDoc archiving, data archiving is available for InfoCubes and ODS objects.
Hope it Helps
Chetan
@CP.. -
My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
Please suggest me which method (is Helper classes or Using EJBs) is perferable
1) to get better performance and.
2) for less network traffic
3) for better container resource utilization
I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
Please give detailed explanation.
thank you,
sudheer<i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
1) to get better performance</i>
EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
<i>2) for less network traffic</i>
There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
<i>3) for better container resource utilization</i>
Again, the EJB version will consume a lot more container resources. -
Looking for a high-performance and reliable NAS
Hi,
I have been searching for a high-performance and reliable SOHO NAS storage but I have seen very mixed and contradicting reviews for the products I have looked at so far. From QNAP to Synology to etc.
However I've not found a good review for Promise SOHO NAS devices such NSx700 and NSx600.
Is anybody here using them? If so how would you rate these devices?
Thanks in advance,
BehrangMy g/f is using a Synology 1511+ with 2TB WB black drives - set up for 2 disk redundancy.
http://www.synology.com/us/products/DS1511+/index.php
She has her lightroom images on there and it works very well with her MBP 10.6.8
If you have specific questions, please ask
Michael -
Revision: 5558
Author: [email protected]
Date: 2009-03-25 14:50:18 -0700 (Wed, 25 Mar 2009)
Log Message:
Add hack to Grammar.jj to allow special component tags in spark and halo namespaces to resolve to special node in the parser. This will be re-addressed once we stabilize on the renames and can better enforce the contents of MXML 2006, MXML 2009, FXG, Spark and Halo.
Add a work around for the step building the AIR Updater UI to set -compatibility-version=3.0.0. This involved checking in a local copy to override the sample-frameworks-build.xml checked into the AIR Integration Kit.zip.
Adding missing base halo and spark classes that appear as qualified type selectors in our defaults.css files but have historically not been in our manifests for MXML tag mappings.
QE: This should help pass more tests.
Dev: Not yet
Doc: Not yet
Modified Paths:
flex/sdk/trunk/frameworks/build.xml
flex/sdk/trunk/frameworks/halo-manifest.xml
flex/sdk/trunk/frameworks/spark-manifest.xml
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/Grammar.jj
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MXMLNamespaces.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/MxmlScanner.java
Added Paths:
flex/sdk/trunk/in/air/sample-frameworks-build.xml -
Performance and Stability Problem with PE9
I just upgraded my computer to a Core i5 with 8G of memory and everything is running much faster. But my NEW PE9 just run very slow. Some of the simple tasks take 10-30 second to complete. Even Windows 7 will often come out to ask if I want to wait for PE9 to wake up or kill the process. When I want to change the size of a video clip, it just doesn't work at all due to performance. It will take PE9 20-30 seconds to resize the video clip. Without some realtime feedback of the size, it is impossible to do the resizing and this is a very fundamental operation. PE9 often crash or seize up as well, I didn't have any of these problem with PE3.0. I upgraded to PE9 simply because my PE3.0 for WIndows XP is not comletely compatible with Windows 7 (some of the text displace does not show up).
Do anyone else have issue with performance and stability?Some general comments, and reading (some for PPro, but concepts are the same)
http://forums.adobe.com/thread/416679
Some specific information that is needed...
Brand/Model Computer (or Brand/Model Motherboard if self-built)
How much system memory you have installed, such as 2Gig or ???
Operating System version, such as Win7 64bit Pro... or whatevevr
-including your security settings, such as are YOU the Administrator
-and have you tried to RIGHT click the program Icon and then select
-the Run as Administrator option (for Windows, not sure about Mac)
Your Firewall settings and brand of anti-virus are you running
Brand/Model graphics card, sush as ATI "xxxx" or nVidia "xxxx"
-or the brand/model graphics chip if on the motherboard
-and the exact driver version for the above graphics card/chip
-and how much video memory you have on your graphics card
Brand/Model sound card, or sound "chip" name on Motherboard
-and the exact driver version for the above sound card/chip
Size(s) and configuration of your hard drive(s)... example below
-and how much FREE space is available on each drive (in Windows
-you RIGHT click the drive letter while using Windows Explorer
-and then select the Properties option to see used/free space)
While in Properties, be sure you have drive indexing set OFF
-for the drive, and for all directories, to improve performance
My 3 hard drives are configured as... (WD = Western Digital)
1 - 320G WD Win7 64bit Pro and all programs
2 - 320G WD Win7 swap file and video projects
3 - 1T WD all video files... read and write
Make sure you have the default Windows hard drive indexing set to OFF for all hard drives and folders
Some/Much of the above are available by going to the Windows
Control Panel and then the Hardware option (Win7 option name)
OR Control Panel--System--Hardware Tab--Device Manager for WinXP
Plus Video-Specific Information http://forums.adobe.com/thread/459220?tstart=0
And, finally, the EXACT type and size of file that is causing you problems
-for pictures, that includes the camera used and the pixel dimensions
Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037?tstart=0
What is a CODEC... a Primer http://forums.adobe.com/thread/546811?tstart=0
What CODEC is INSIDE that file? http://forums.adobe.com/thread/440037?tstart=0
For PC http://www.headbands.com/gspot/ or http://mediainfo.sourceforge.net/en
This is aimed at Premiere Pro, but may help
Work through all of the steps (ideas) listed at http://forums.adobe.com/thread/459220?tstart=0
If your problem isn't fixed after you follow all of the steps, report back with ALL OF THE DETAILS asked for in the FINALLY section at the troubleshooting link
Also, tuning Win7
http://www.pcworld.com/businesscenter/article/220753/windows_7_godmode_tips_tricks_tweaks. html
Temp/Cookie Cleaner http://www.mixesoft.com/
http://forums.adobe.com/thread/789809?tstart=0
Win7 Toolbar http://WindowsSecrets.com/comp/110210
More Win7 Tips http://windowssecrets.com/comp/110127
Utilities http://windowssecrets.com/comp/110106 (Startup Solutions)
Win7 Help http://social.technet.microsoft.com/Forums/en-US/category/w7itpro/
Win7 Configuration Article http://windowssecrets.com:80/comp/100218
Win7 Monitor http://windowssecrets.com:80/comp/100304
Win7 Optimizing http://www.blackviper.com/Windows_7/servicecfg.htm
Win7 Virtual XP http://www.microsoft.com/windows/virtual-pc/
More on Virtual XP http://blogs.zdnet.com/microsoft/?p=5607&tag=col1;post-5607
Win7 Adobe Notes http://kb2.adobe.com/cps/508/cpsid_50853.html#tech
Win7 Adobe Update Server Problem http://forums.adobe.com/thread/586346?tstart=0
An Adobe Win7 FAQ http://forums.adobe.com/thread/511916?tstart=0
More Win7 Tips/FAQ http://forums.adobe.com/thread/513640?tstart=0
Processes http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Compatibility http://www.microsoft.com/windows/compatibility/windows-7/en-us/Default.aspx
Win7 God Mode http://forums.adobe.com/thread/595255?tstart=0
CS5 Install Error http://forums.adobe.com/thread/629281?tstart=0
CS5 Help Problem http://kb2.adobe.com/cps/842/cpsid_84215.html
Win7 and Firewire http://forums.adobe.com/thread/521842?tstart=0
http://lifehacker.com/5634978/top-10-things-to-do-with-a-new-windows-7-system
http://www.downloadsquad.com/2009/05/29/7-free-windows-7-tweaking-utilities/
Win7 64bit Crashing and "a" fix http://forums.adobe.com/thread/580435?tstart=0
http://prodesigntools.com/if-any-problems-downloading-or-installing-cs5.html
Harm's Tools http://forums.adobe.com/thread/504907
Also http://www.tune-up.com/products/tuneup-utilities/
Also http://personal.inet.fi/business/toniarts/ecleane.htm -
Event Date: October 1, 2002 at 11:00 AM Pacific (US), 02:00 PM Eastern (US)
To register: http://regsvc.placeware.com/?wily-bea1001
Title: Achieving Availability, Performance and Control of Java Applications
in Financial Services
Abstract:
In today's competitive environment, financial institutions must focus on
three key business goals:
a.. Creating a customer-centric enterprise to maximize value to customers
and increase share of wallet
b.. Improving transactional efficiency for rapid delivery of the right
products, services and information to customers and to employees
c.. Accelerating the decision making process to mitigate risk and improve
returns.
BEA and Wily Technology have helped a number of financial services firms
meet these objectives by delivering high-performance business solutions that
meet rigorous demands for performance, reliability and scalability.
On October 1, 2002, Wily Technology and BEA will present a joint Web seminar
titled "Achieving Availability, Performance and Control of Java Applications
in Financial Services" with Eric Gudgion, Principal System Architect,
Technical Solutions Group at BEA and Chris Farrell, Director of Technical
Marketing at Wily. This Webinar will showcase the many advantages that the
WebLogic® Enterprise PlatformT and Wily's Introscope® offer financial
services firms.
Attendees will learn how WebLogic Server, BEA's unified, simplified and
extensible solution, provides a robust platform for the development and
deployment of enterprise Java applications. Some examples of what financial
institutions can achieve with BEA include Multi-channel Services Delivery,
Straight-Through Processing, Wealth Management and Cash Management.
Wily Technology will highlight Introscope's ability to manage financial
services Java applications by pinpointing component-level performance issues
in real-time, whether in the application, application server or
Java-connected back-end systems. Wily's suite of Java application management
solutions offers a comprehensive platform for achieving 24x7 application
availability, enhanced performance and better control of IT resources.First of all you should check out which products are supported on 64bit :- http://www.oracle.com/technology/products/bi/hyperion-supported-platforms.html
If you are planning on using windows 64bit EAS then you will have to manually deploy the web application, it cannot be automatically deployed.
Cheers
John
http://john-goodwin.blogspot.com/ -
Is there a way to view Flash videos on my iMac without downloading Adobe Flash Player? I'm concerned about performance and security with Adobe Flash Player.
If the video is only available in a format that requires Flash player : then no.
However, a great many can also be viewed in an HTML5 version, in which case http://hoyois.github.io/safariextensions/clicktoplugin/ or similar can be set up so that Flash never runs unless you specifically choose it to. -
FAQ's, intros and memorable discussions in the Performance and Tuning Forum
Welcome to the SDN ABAP Performance and Tuning Forum!
In addition to release dependent information avalaible by:
- pressing the F1 key on an ABAP statement,
- or searching for them in transaction ABAPDOCU,
- using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
- the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
- the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
- the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
... this "sticky post" lists some threads from the ABAP forums as:
- An introduction for new members / visitors on topics discussed in threads,
- An introduction to how the forums are used and the quality expected,
- A collection of some threads which provided usefull answers to questions which are frequently asked, and,
- A collection of some memorable threads if you feel like reading some ABAP related material.
The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.ABAP Performance and Tuning
Read Performance => Gurus take over the discussion from Guests caught cheating the points-system.
SELECT INTO TABLE => Initial questions often result in interesting follow-up discussions.
Inner Joins vs For all Entries. => Including infos about system parameters for performance optimization.
Inner Join Vs Database view Vs for all entries => Usefull literature recommended by performance guru YukonKid.
Inner Joins vs For All Entries - performance query => Performance legends unplugged... read the blogs as well.
The ABAP Runtime Trace (SE30) - Quick and Easy => New tricks in old tools. See other blogs by the same author as well.
Skip scan used instead of (better?) range scan => Insider information on how index access works.
DELETE WHERE sample case that i would like to share with you => Experts discussing the deletion of data from internal tables.
Impact of Order of fields in Secondary index => Also discussing order of fields in WHERE-clause
"SELECT SINGLE" vs. "SELECT UP TO 1 ROWS" => Better for performance or semantics?
into corresponding fields of table VERSUS into table => detailed discussion incl. runtime measurements
Indexes making program run slower... => Everything you ever wanted to know about Oracle indexes.
New! Mass reading standard texts (STXH, STXL) => avoiding single calls to READ_TEXT for time-critical processes
New! Next Generation ABAP Runtime Analysis (SAT) => detailed introduction to the successor of SE30
New! Points to note when using FOR ALL ENTRIES => detailed blog on the pitfall(s) a developer might face when using FAE
New! Performance: What is the best way to check if a record exist on a table ? => Hermann's tips on checking existence of a record in a table
Message was edited by: Oxana Noa Zubarev -
Performance and Sprite objects
I've written an application in Flex 2 that consists of
several accordions containing custom canvas objects, and it is
having performance problems.
I'm running the application within IE 6.0 under Windows 2000.
The application loads an XML file and uses the data to create
custom Sprite objects in the canvases. Each Sprite consists of two
swf images that are loaded using the Loader class, a small
rectangle created by using the Sprite graphics property, and a text
label. In addition, each Sprite is connected to one or more other
Sprites by a line drawn using the Sprite's graphics property. The
Sprites have the capability for being dragged, and for being
highlighted when clicked.
My problem is performance; these Sprites perform slower than
a similiar program that I wrote in ActionScript 2.0. From what I
understand, Flex 2.0, ActionScript 3.0, Flash 9, and the new Sprite
class are supposed to deliver greatly improved performance, but my
new application seems worse than the old one under Flash 7 using
MovieClips. The more Sprites on the screen, the worse the
performance, and the lines seem to contribute to the degradation.
There is way too much code involved to include in this
message, so I'm looking for general info. Is there some basic point
I am missing?
The performance is also degraded when triggering instances of
the Menu and Popup classes. When running the Task Manager during
the application, I've noticed that both Memory Usage and GDI
objects increase whenever I display a Menu or Popup. Both Memory
Usage and GDI objects go up and down, but there is a steady
increase in both metrics as I continue to use Menus and Popups. As
far as I can tell, I am disposing of both types of objects
properly, but it appears that their allocation is remaining in
memory.I've written an application in Flex 2 that consists of
several accordions containing custom canvas objects, and it is
having performance problems.
I'm running the application within IE 6.0 under Windows 2000.
The application loads an XML file and uses the data to create
custom Sprite objects in the canvases. Each Sprite consists of two
swf images that are loaded using the Loader class, a small
rectangle created by using the Sprite graphics property, and a text
label. In addition, each Sprite is connected to one or more other
Sprites by a line drawn using the Sprite's graphics property. The
Sprites have the capability for being dragged, and for being
highlighted when clicked.
My problem is performance; these Sprites perform slower than
a similiar program that I wrote in ActionScript 2.0. From what I
understand, Flex 2.0, ActionScript 3.0, Flash 9, and the new Sprite
class are supposed to deliver greatly improved performance, but my
new application seems worse than the old one under Flash 7 using
MovieClips. The more Sprites on the screen, the worse the
performance, and the lines seem to contribute to the degradation.
There is way too much code involved to include in this
message, so I'm looking for general info. Is there some basic point
I am missing?
The performance is also degraded when triggering instances of
the Menu and Popup classes. When running the Task Manager during
the application, I've noticed that both Memory Usage and GDI
objects increase whenever I display a Menu or Popup. Both Memory
Usage and GDI objects go up and down, but there is a steady
increase in both metrics as I continue to use Menus and Popups. As
far as I can tell, I am disposing of both types of objects
properly, but it appears that their allocation is remaining in
memory.
Maybe you are looking for
-
my icloud stopped working photo streem wont streem and when I go to icloud web page it says error in cloudos when I try to sumitt this to apple it says icloud stopped working I don't know what to do
-
Cannot synch due to lack of access privileges
Trouble began when I unplugged during a synch. Have not been able to synch since with error message, "You do not have authority". New Nano 6
-
Where is Verizons customer loyalty?
I've had this account for well over 20 years. Why am I paying the same rates as a new customer? Why do I need to jump through hoops to get new equipment? With all the companies and plans out here, you should provide more for your customers. Why aren'
-
Pre Numbered forms for Chile - picks up wrong document type for a lot
Hi I have done the config as per the OSS instructions for IDCP and it is OK the problem we have is we have defined lots for invoices and Credits and when I run the IDCP with Invoice lot number it shows me the credits also which it shouldnt did anyone
-
Preserving transparency using Contact Sheet II or similar
Hoping someone can help with this. We currently print using a flat bed ink jet printer CMYK++(fixative) capable of printing several images at one time. We create the file using PS then use bridge and contact sheet II to create the print ready documen