Written by

Sales Engineer at InterSystems
Question Guillaume Rongier · Jun 17, 2019

iFind Index With Relationship RowID Specification

Hi,

I try to implement an iFind index.

Here is my definition class :

ClassAviation.TestSQLSrchExtends%Persistent [ DdlAllowed, Owner = {UnknownUser}, SqlRowIdPrivate, SqlTableName = TestSQLSrch ]
{

 

PropertyUniqueNumAs%Integer;

 

PropertyCrashDateAs%TimeStamp [ SqlColumnNumber = 2 ];

 

PropertyNarrativeAs%String(MAXLEN = 100000) [ SqlColumnNumber = 3 ];

 

IndexNarrSemanticIdx On (Narrative) As %iFind.Index.Basic;

 

IndexUniqueNumIdxOnUniqueNum [ Type = index, Unique ];

 

}

The problem start when I add an Relationship in my indexed class, I end up with this error :

ERROR #5585: Unable to define default RowID Specifications for class Aviation.TestSQLSrch, map NarrSemanticIdx, field Aviation.Relationship.ID. RowID Specifications must be defined manually for this map definition.

Here is my new defintion class:

ClassAviation.TestSQLSrchExtends%Persistent [ DdlAllowed, Owner = {UnknownUser}, SqlRowIdPrivate, SqlTableName = TestSQLSrch ]
{

 

PropertyUniqueNumAs%Integer;

 

RelationshipRelationship As Relationship [Cardinality = parent, Inverse = TestSQLSrch];

 

PropertyCrashDateAs%TimeStamp [ SqlColumnNumber = 2 ];

 

PropertyNarrativeAs%String(MAXLEN = 100000) [ SqlColumnNumber = 3 ];

 

IndexNarrSemanticIdx On (Narrative) As %iFind.Index.Basic;

 

IndexUniqueNumIdxOnUniqueNum [ Type = index, Unique ];

 

}

and his relation :

ClassAviation.RelationshipExtends%Persistent
{

 

PropertytxtAs%String;

 

RelationshipTestSQLSrch As TestSQLSrch [Cardinality = children, Inverse = Relationship];

 

}

How can i define the default RowID Specifications ?

Comments

Benjamin De Boe · Jun 17, 2019

Hi Guillaume,

iFind indices, like bitmap indices before, require a bitmap-friendly ID key (positive integer). When you make a table the child in a parent-child relationship, the underlying storage structure will use a composite key that therefore no longer satisfies the bitmap friendliness. We do plan to lift this limitation in a future release, as it's already the case for bitmap indices, but for now you'll have to review your schema and see if a one-to-many or (preferred) foreign key would work for you.

Thanks,
benjamin

0