Quantcast

Doc issue: No explanation of record counts for EXPLAIN QUERY PLAN

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Doc issue: No explanation of record counts for EXPLAIN QUERY PLAN

Jens Alfke-2
In the documentation of EXPLAIN QUERY PLAN[1], I found the following:

>     sqlite> EXPLAIN QUERY PLAN SELECT a, b FROM t1 WHERE a=1;
>     0|0|0|SCAN TABLE t1
> The example above shows SQLite estimating that the full-table scan will visit approximately 100,000 records.

There’s no justification given for the number 100,000. It doesn’t appear in the output of the command, and there’s nothing on the page that describes table t1 or the size of the data set.

The next example:

>     sqlite> CREATE INDEX i1 ON t1(a);
>     sqlite> EXPLAIN QUERY PLAN SELECT a, b FROM t1 WHERE a=1;
>     0|0|0|SEARCH TABLE t1 USING INDEX i1

> […] SQLite estimates that about 10 records will match the "a=1" term.

Again, no justification for the number 10. Even knowing the table has 100k records, I can’t see how one can derive that the search will visit 10 of them.

—Jens

[1]: https://www.sqlite.org/eqp.html
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc issue: No explanation of record counts for EXPLAIN QUERY PLAN

Richard Hipp-3
Thanks.  Those sentences are obsolete and need to be removed from the
documentation.

On 2/3/17, Jens Alfke <[hidden email]> wrote:

> In the documentation of EXPLAIN QUERY PLAN[1], I found the following:
>
>>     sqlite> EXPLAIN QUERY PLAN SELECT a, b FROM t1 WHERE a=1;
>>     0|0|0|SCAN TABLE t1
>> The example above shows SQLite estimating that the full-table scan will
>> visit approximately 100,000 records.
>
> There’s no justification given for the number 100,000. It doesn’t appear in
> the output of the command, and there’s nothing on the page that describes
> table t1 or the size of the data set.
>
> The next example:
>
>>     sqlite> CREATE INDEX i1 ON t1(a);
>>     sqlite> EXPLAIN QUERY PLAN SELECT a, b FROM t1 WHERE a=1;
>>     0|0|0|SEARCH TABLE t1 USING INDEX i1
>
>> […] SQLite estimates that about 10 records will match the "a=1" term.
>
> Again, no justification for the number 10. Even knowing the table has 100k
> records, I can’t see how one can derive that the search will visit 10 of
> them.
>
> —Jens
>
> [1]: https://www.sqlite.org/eqp.html
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...