Re: [EXTERNAL] Optimizer limitation with partial indexes

Jens Alfke <jens-mAcipnqRhZf2eFz/[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <[email protected]>

> On Feb 12, 2020, at 5:30 AM, Hick Gunter <[email protected]> wrote:
> 
> This is documented here https://sqlite.org/partialindex.html <https://sqlite.org/partialindex.html> and here https://sqlite.org/queryplanner.html <https://sqlite.org/queryplanner.html>
> 
> Specifically, SQLIte does not prove theorems in first-order logic.

Thanks — I hadn't seen the section "Queries Using Partial Indexes" before, and it gives more detail about how the matching is done. However, it seems that my query does match one of the rules:

	"If W [the query's WHERE clause] is AND-connected terms
	 and X [the index's WHERE clause]  is OR-connected terms
	 and if any term of W appears as a term of X,
	 then the partial index is usable."

Here W = (expr1 > val1 OR expr2 > val2) AND expr3
 and X = expr3, which is a degenerate case of one OR-connected term.

So I'm not sure why the indexes aren't useable, unless there are limitations of the actual rule that aren't described in that English text.

—Jens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.