Hi,

I have a virtual table.
   create table store (id int, stamp int, value blob);

When i execute the following sql
   select stamp, to_text(value) from store where id = 42;

I get as expected sqlite3_index_info to have one usable entry with
    aConstraint[i].iColumn = 0
    aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ
In xBestIndex I set the aConstraintUsage[i].argvIndex value to 1, to indicate 
that '42' should be the first argument in corresponding xFilter call.

And in the corresponding xFilter I get a value of 42 as the first argument and  
I can initialize the cursor with just one element with id = 42.

When i execute the following sql
   select stamp, to_text(value) from store where id = 42 or id = 24;

I am expecting two usable entries in sqlite3_index_info with 
aConstraint[i].iColumn = 0 and aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ 
for each check

xBestIndex is called twice,

  a) once with only one non-usable entry with  aConstraint[i].iColumn = 0 and 
aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ and
  b) once with only one usable entry with aConstraint[i].iColumn = 0 and 
aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ.

And the xFilter called corresponds to the  first call to xBestIndex. Thus it 
does a table scan to find entries (42, 24)

Am i missing something here ?

-venkat murty

Fiberlink Disclaimer: The information transmitted is intended only for the 
person or entity to which it is addressed and may contain confidential and/or 
privileged material.  Any review, retransmission, dissemination or other use 
of, or taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited.  If you received this 
in error, please contact the sender and delete the material from any computer.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to