JET/Esent: SeekEQ finds no matches with multi-column index and wildcards

75 Views Asked by At

I have a 5-column table with a 2-column primary index. Let's say the index is defined as (Col1, Col2).

In the the following snippet, Api.TrySeek returns false and I'm not sure why:

Api.JetSetCurrentIndex(session, table, null);

// this should match on Col1 = colVal1 and Col2 = *
Api.MakeKey(session, table, colVal1, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnStartLimit);

if (Api.TrySeek(session, table, SeekGrbit.SeekEQ)) // why is this false??
{
    Api.MakeKey(session, table, colVal1, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);

    if (Api.TrySetIndexRange(session, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
    {
         <loop through entries in index range>

However, it returns true if I use SeekGrbit.SeekGE. Could someone explain why? Does SeekEQ not work with wildcard columns but SeekGE does?

In the loop, I've double-checked that the entries all have Col1 == colVal1, to rule out the possibility that it's just finding entries where Col1 > colVal1.

0

There are 0 best solutions below