The values on the RHS of constraints are generally not known until (bound values) or after (joins) the query is executed. At that point, having a better estimate is moot.
-----Ursprüngliche Nachricht----- Von: Dominique Devienne [mailto:ddevie...@gmail.com] Gesendet: Montag, 07. Juli 2014 10:39 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Error xBestIndex returned an invalid plan On Mon, Jul 7, 2014 at 10:25 AM, Hick Gunter <h...@scigames.at> wrote: > "fred" is only known if your select statement references only that one table > and the value is supplied as a literal. Known to whom? AFAIK, even in that case, http://www.sqlite.org/vtab.html#xbestindex does not know about 'fred'. Which field of struct sqlite3_index_info would 'fred' be available from? aConstraint.iTermOffset which is internal to SQLite? All I'm saying is that vtables would have the opportunity to report correct/better estimates if the right-hand-sides of constraints, when they are literals or bind values (i.e. bind peeking), were available to xBestIndex. I don't know what that entails, but I'm making it known to SQLite devs, just in case, in the hope it might become available in the future, even if only in a reduced capacity like the single-table-with-literal use case you mentioned Hick. Thanks, --DD _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ----------------------------------------------------------------------- Gunter Hick Software Engineer Scientific Games International GmbH Klitschgasse 2 – 4, A - 1130 Vienna, Austria FN 157284 a, HG Wien Tel: +43 1 80100 0 E-Mail: h...@scigames.at This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice as to its status and accordingly please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any person as to do so could be a breach of confidence. Thank you for your cooperation. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users