Menu

#43 Create additional indexes for references and parts

v2.1
open
nobody
Core (22)
5
2012-11-03
2007-03-23
No

In "TInstantModelCatalog.InitTableMetadatas AddExternalTableMetadata" create two additional indexes for parent and child, this will increase performance for queries.

Only if "Indexed" is marked for the attribute, this comes up that it is not used in some cases, like when will be few instances.

Here comes a possible code:

// Additional indexes for best performance
if AttributeMetadata.IsIndexed then
begin
IndexMetadatas.AddIndexMetadata('IDX_' + AttributeMetadata.ExternalStorageName + '_PARENT',
UpperCase(InstantParentClassFieldName+','+InstantParentIdFieldName), []);

IndexMetadatas.AddIndexMetadata('IDX_' + AttributeMetadata.ExternalStorageName + '_CHILD',
UpperCase(InstantChildClassFieldName+','+InstantChildIdFieldName), []);

end;

Discussion


Log in to post a comment.