Question
· Jun 17, 2019

iFind Index With Relationship RowID Specification

Hi,

I try to implement an iFind index.

Here is my definition class :

Class Aviation.TestSQLSrch Extends %Persistent [ DdlAllowed, Owner = {UnknownUser}, SqlRowIdPrivate, SqlTableName = TestSQLSrch ]
{
 
Property UniqueNum As %Integer;
 
Property CrashDate As %TimeStamp [ SqlColumnNumber = 2 ];
 
Property Narrative As %String(MAXLEN = 100000) [ SqlColumnNumber = 3 ];
 
Index NarrSemanticIdx On (Narrative) As %iFind.Index.Basic;
 
Index UniqueNumIdx On UniqueNum [ 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:

Class Aviation.TestSQLSrch Extends %Persistent [ DdlAllowed, Owner = {UnknownUser}, SqlRowIdPrivate, SqlTableName = TestSQLSrch ]
{
 
Property UniqueNum As %Integer;
 
Relationship Relationship As Relationship [Cardinality = parent, Inverse = TestSQLSrch];
 
Property CrashDate As %TimeStamp [ SqlColumnNumber = 2 ];
 
Property Narrative As %String(MAXLEN = 100000) [ SqlColumnNumber = 3 ];
 
Index NarrSemanticIdx On (Narrative) As %iFind.Index.Basic;
 
Index UniqueNumIdx On UniqueNum [ Type = index, Unique ];
 
}

 

and his relation :

Class Aviation.Relationship Extends %Persistent
{
 
Property txt As %String;
 
Relationship TestSQLSrch As TestSQLSrch [Cardinality = children, Inverse = Relationship];
 
}

 

How can i define the default RowID Specifications ?

Discussion (1)1
Log in or sign up to continue

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