Commit Graph

14 Commits

Author SHA1 Message Date
drh
e802c5da01 Improved handling of USING and NATURAL JOIN in 3-way and higher joins.
Ticket [3338b3fa19ac4ab]

FossilOrigin-Name: 551ce407bd77149865423511bd52eba2f404161a
2011-10-18 18:10:40 +00:00
drh
f6cf1ffb39 Do not generate sqlite_stat1 entries for empty tables when running
ANALYZE.  Ticket [83ea97620bd31016451]

FossilOrigin-Name: 3a27af5b3c688c651ba1fae261026ef77b7ff5e3
2011-03-30 14:54:05 +00:00
drh
47fe5533a6 Merge the stat2 query planner enhancements into the trunk.
FossilOrigin-Name: 499edcbc8ab70fcf35431d4e672c68dbcb6c5aad
2011-02-04 06:36:44 +00:00
drh
083310dfcc Change the weighting of binary searches on tables to 1/10th the cost of a
search on an index.  Change the assumed reduction in search space from a
indexed range constraint from 1/3rd to 1/4th.  Do not let the estimated 
number of rows drop below 1.

FossilOrigin-Name: 4847c6cb71423248b186ab7842b97c83e2f5fefd
2011-01-28 01:57:41 +00:00
dan
4bc39fa188 Change the EXPLAIN QUERY PLAN output to use "USING INDEX" instead of "BY INDEX", and to use "SEARCH" instead of "SCAN" for loops that are not full-table scans.
FossilOrigin-Name: 6611b76b0296875fb9903b25dfaa783a9c12eaa1
2010-11-13 16:42:27 +00:00
dan
47eb16d4ce Modifications to test cases to account for new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 30904ef8412348464e893e9e1551ef22cad24a3e
2010-11-11 10:36:25 +00:00
drh
547caad4c4 Fix a performance regression (relative to version 3.6.23.1) caused by the
query planner taking into account non-indexable WHERE clause terms to select
the outermost join loops when it should be selecting tables for the outermost
loop that do not benefit from being in an inner loop.

FossilOrigin-Name: ece641eb8951c6314cedbdb3243f91cb199c3239
2010-10-04 23:55:50 +00:00
drh
aa0ba4345d Fix the query planner so that when it has a choice of full-scan tables to
move to the outer loop, it chooses the one that is likely to give the fewest
output rows.

FossilOrigin-Name: 309bbedf9648c750d7b8aedbc15d4fd68f846824
2010-08-05 02:52:32 +00:00
drh
5e377d90ed If the outer loop of a join must be a full table scan, make sure that an
incomplete ANALYZE does not trick the planner into use a table that might
be indexable in an inner loop.  Ticket [13f033c865f878]

FossilOrigin-Name: e7a714b52c45af096af74049826d32c647abfe3f
2010-08-04 21:17:16 +00:00
drh
ed754ce2cc Further refinements to table order selection on join query planning.
FossilOrigin-Name: defaf0d99a807027f8883bf821b6482025f9f54e
2010-04-15 01:04:54 +00:00
drh
dafc0ce818 Additional work on ticket #3015. The previous fix (check-in (4919)) did
not appear to work in all cases and it disabled indexing in some places
where it should not have.  New test cases added to help insure that the
current fix is better. (CVS 5026)

FossilOrigin-Name: 0d2e258e1a3276e55903ba2ded987f8d8a18cacd
2008-04-17 19:14:02 +00:00
drh
61dfc31d80 Query optimizer enhancement: In "FROM a,b,c left join d" allow the C table
to be reordered with A and B.  This used to be the case but the capability
was removed by (3203) and (3052) in response to ticket #1652.  This change
restores the capability. (CVS 3529)

FossilOrigin-Name: 7393c81b8cb9d4344ae744de9eabcb3af64f1db8
2006-12-16 16:25:15 +00:00
drh
df26fd5edd In joins of the form "A left B, C" make sure they are not transformed into
"A left C, B".  Ticket #1830.  See also #1652. (CVS 3203)

FossilOrigin-Name: 2baa983653796e16d36739e37b0be1672bf59a92
2006-06-06 11:45:54 +00:00
drh
570b935c2a In joins of the form: "A, B left C" make sure that the reordering optimization
does not put table A after table C.  Ticket #1652. (CVS 3052)

FossilOrigin-Name: 248b9be93d9532e31c640432b75c3310e180acb3
2006-02-01 02:45:02 +00:00