Hi,

I'm trying to implement "optional incoming" parameters for my virtual
tables. It's when there are columns required, but also there are some
fine-tuning columns that should be noticed when provided in the query and
assumed some default if not. The system that I tried seems to work, but I
would like an opinion whether it is future-proof.
- When the required parameters are not provided, xBestIndex returns a large
cost for earlier sqlite version and additionallly SQLITE_CONSTRAINT for
3.26.0 onward.
- When the required parameters provided and all optional provided the cost
is 1.
- For every optional parameter not provided, the cost is increased by 1. So
if there are 3 optional parameters and no provided, the cost is 4, if one
optional provided - the cost is 2.

Should this always work as expected or sqlite might not always choose the
lowest cost index amongst the ones with small values? I tested it with a
couple of vt implementations, but the  number of columns in both
required/optional pool are low and I expect some trouble when the number
will go up.

Thanks,

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

Reply via email to