On 05/20/2017 06:17 PM, graf0 post.pl wrote:
Hello,

I'm trying to implement vtable, and I don't understand what is meaning of usable
field in sqlite3_index_constraint struct?

Can I assume it will be false when my vtable is joined by that field with some
other table?

Basically just that. Say "vtab" is your virtual table and "tbl" a normal table. If you do:

   SELECT * FROM vtab, tbl WHERE vtab.a=? AND vtab.b=tbl.c

then the sqlite3_index_info structure will contain two constraints. The xBestIndex method will be invoked twice, once with only vtab.a=? marked as enabled and once with both of the constraints enabled. So that the planner knows the cost of using virtual table vtab as both the inner and outer loop of the join.

Dan.


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to