Commit Graph

26 Commits

Author SHA1 Message Date
drh
57c98747cb Improvements to the query planner to address the inefficiency described
by [forum/forumpost/2568d1f6e6|forum post 2568d1f6e6].

FossilOrigin-Name: 72fcc12cda910a0e3f7875eb3d117b2a5608705c97703985427a02960f1ab5c5
2023-12-23 19:03:50 +00:00
drh
8210233c7b Revise tests cases to align with the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 50fbd532602d2c316813046ed6be8be2991c281eb5f295c4c28520a0de73862c
2021-03-20 15:11:29 +00:00
drh
cdf88760da More test case updates. Tests are all running now.
FossilOrigin-Name: dab5e5294813891469660cceb211ac1a1e526715bb57dcdbb1ab90321e6a4dad
2018-05-02 19:42:33 +00:00
dan
c497441406 Fix a duplicate test name in cursorhint2.test.
FossilOrigin-Name: fcd12b69cee1335224a65aa6d22c4e302b889398
2016-06-17 14:59:40 +00:00
dan
aa9933c115 Changes to the way the planner calculates the costs of various table and index scans. Some test cases still failing.
FossilOrigin-Name: c5a6ec0a880652dc8f4593d9f7acd58ddc3dc5f3
2014-04-24 20:04:49 +00:00
drh
d0aa2f3afd Ignore IS NOT NULL and NOT NULL constraints on NOT NULL columns.
FossilOrigin-Name: e476408e3c5ba5f3ba5e98ff264167c163d72e3f
2013-08-20 17:00:55 +00:00
drh
9d5a579c35 Fix an issue with the OmitNoopJoin optimization and add test cases that
are specifically for that optimization.

FossilOrigin-Name: 5480d124b74c9adaacc4fa9cb81560865b44f3e1
2013-06-28 13:43:33 +00:00
drh
4fe425ad79 "make test" now passing.
FossilOrigin-Name: addd7f466d6ff55f82d907286650c26b06e9397b
2013-06-12 17:08:06 +00:00
drh
8a4380d761 Fixes to EXPLAIN QUERY PLAN output. Change weights back to something closer
to what they are in legacy.  More test case fixes.

FossilOrigin-Name: 36373b85f9a97840aa06e24ae31c12fcfbae084e
2013-06-11 02:32:50 +00:00
drh
5822d6feb2 Fix test cases for the new EXPLAIN QUERY PLAN format. Add the
wherecosttest tool.  Other fixes to logarithm cost.

FossilOrigin-Name: aa580e368e3c398b8377b80342dfdd906324c248
2013-06-10 23:30:09 +00:00
drh
e353ee3898 Update some variable names and comments in the ORDER BY optimizer. Fix a
bug in the ORDER BY optimizer dealing with IS NULL constraints.  Updates
to test cases.

FossilOrigin-Name: cf96eb5945a9bab71104cb1581ee13ab30022566
2013-06-04 23:40:53 +00:00
drh
7c171098b7 Remove more vestiges of sqlite_query_plan from the test cases.
FossilOrigin-Name: eb27086e8a8a4d5fcb2ea358256a555e34339423
2013-06-03 22:08:20 +00:00
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