Commit Graph

37 Commits

Author SHA1 Message Date
drh
47b1d68f25 In the query planner, do not consider index X to be a proper subset of
index Y if X is a covering index but Y is not.

FossilOrigin-Name: ee31c04353cd75ea4bbadee2994c30d3808b696a4f680187502d104902988a5d
2017-10-15 22:16:25 +00:00
drh
4fb48e4eb1 Improved debugging output with wheretrace. Fix some typos in test script
comments.

FossilOrigin-Name: 13a37fd487ce7d4f98a12f7a67a9c05dadc66557
2016-03-01 22:41:27 +00:00
drh
a23bc8a345 From test scripts, remove stray "breakpoint" commands and blank lines
at the ends of files.

FossilOrigin-Name: a6b35273239669189f33402144f58328b133d182
2016-02-05 16:46:09 +00:00
dan
a0d56aef18 Another test case for the planner change on this branch.
FossilOrigin-Name: f2207a0691ed361061719f4dacf021a677a9d892
2015-03-16 09:21:30 +00:00
dan
a3d0c13654 When estimating the number of rows visited by a range scan for which the keys consist of more than one field, consider prefixes of stat4 samples as well as the full samples.
FossilOrigin-Name: e1caf93c9ad0ee15d42030af95619f212d3fcf9d
2015-03-14 18:59:58 +00:00
dan
f741e0491e In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned.
FossilOrigin-Name: e06dc6f0c35f87c44292c71677111b74f073a5c4
2014-08-25 18:29:38 +00:00
drh
25df48d967 Enhance the sqlite_stat1.stat parsing to allow additional text parameters
at the end.  Unrecognized parameters are silently ignored.

FossilOrigin-Name: ca2a5a2c770fa94cd8db1b1b241ede058a7c58e2
2014-07-22 14:58:12 +00:00
dan
43fbe5e2c9 Add another test to verify that SQLite is using stat4 data for composite primary keys on WITHOUT ROWID tables.
FossilOrigin-Name: 0df1fe72f8271abc86cd552027d938c910f90967
2014-07-01 15:22:11 +00:00
dan
39caccf83d Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys.
FossilOrigin-Name: 21981e35062cc6b30e9576786cbf55265a7a4d41
2014-07-01 11:54:02 +00:00
dan
fd984b8114 Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table.
FossilOrigin-Name: 053a210e3169732c58f84cb54c9b6f6df3a8f4ea
2014-06-30 18:02:20 +00:00
dan
9881d60d17 Add an extra column to a table in analyze9.test to give the planner a little more reason to select an index.
FossilOrigin-Name: 1b95544f84bf83c28cc15f6d0690fdf8a6bb3941
2014-04-28 12:08:23 +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
dan
597515d70c Update some test cases that deal with corrupt databases.
FossilOrigin-Name: 3a09f5605ac7c6e503eb10acfdc607010414d917
2014-02-28 18:39:51 +00:00
drh
c8606e416a Further performance tweaks to OP_Column.
FossilOrigin-Name: 0e3f5df695216a27602a53eed5d25231b055adc8
2013-11-20 19:28:03 +00:00
drh
abfa6d52ed Tweaks to the index selection logic.
FossilOrigin-Name: 52d52688644f635a50a60ff17b160f3affa8fa6c
2013-09-11 03:53:22 +00:00
drh
36fabb6297 Merge trunk fixes into the unlikely-func branch.
FossilOrigin-Name: a51d751553b14aa26912c516f60727551deb8e60
2013-09-10 01:53:18 +00:00
drh
1d2b3c1f8a Deterministically initialize the PRNG used as a tie-breaker in the ANALYZE
command, so that the analysis is always the same given the same database.
This simplifies testing.

FossilOrigin-Name: 48ed8b565b84c8fa7898c2f9817c01f7e9c9182e
2013-09-10 01:41:25 +00:00
drh
cca9f3d291 Initial implementation of the unlikely() SQL function used as a hint to
the query planner.

FossilOrigin-Name: 036fc37a034093a4c6fc190633bd41c2b7230d77
2013-09-06 15:23:29 +00:00
dan
b13af4c5dd Fix another problem in stat4 sample selection.
FossilOrigin-Name: d59f580904e6e7e90fc0a692a3dd4eeff5942479
2013-09-03 14:43:12 +00:00
dan
b49d1047c6 Further stat4 related tests.
FossilOrigin-Name: 0a702c4b4c35fdbcb62e3ab88b9e57d7ea0052a8
2013-09-02 18:58:11 +00:00
dan
84f48296fa Add tests to check if ANALYZE is choosing common non-periodic samples for the stat4 table.
FossilOrigin-Name: 175842997af134138784bff6f8e93573deb5b36b
2013-09-02 11:52:11 +00:00
dan
575ab2f8f6 Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument.
FossilOrigin-Name: c21f58d84859e479a6cc619671a0df48b2f9692e
2013-09-02 07:16:40 +00:00
dan
4a1aa3851a Fix a problem causing SQLite not to use stat4 or stat3 data to analyze constraints of the form "column = expr COLLATE collation" (those with an explicit COLLATE on the non-column side of the comparison operator).
FossilOrigin-Name: 1e86d81d46c9da6aaee0c6938ee40933f35e3d0d
2013-08-31 17:21:26 +00:00
dan
0e8194a9c7 Add a test for the problem fixed by [91733bc485].
FossilOrigin-Name: 5c591104813a7e55e59f4f557cbb3e500fa817c2
2013-08-16 17:46:49 +00:00
dan
22d73b1cbe Fixes for test code that was not working with utf16 databases. Run the analyze*.test scripts as part of the 'utf16' permutation test.
FossilOrigin-Name: fe99494d99df95f699ffab07b1e212800b5ff00d
2013-08-16 14:48:23 +00:00
dan
585c823256 Add extra tests. No code changes.
FossilOrigin-Name: 949127d53e0a907ed6f73c6828637d94b265468c
2013-08-16 14:23:02 +00:00
dan
c367d4c052 Avoid buffer overreads and false OOM error reports that could be caused by corrupted sample records in the sqlite_stat4 table.
FossilOrigin-Name: 9f85b6a52a0b9b1524daa6f24d85257e7f591e95
2013-08-16 14:09:43 +00:00
dan
0adbed8a60 Fix a crash that can occur if the sqlite_stat3 or sqlite_stat4 table is corrupt.
FossilOrigin-Name: d51df8a8fcc31c37f6e1c9612204af5738ed865e
2013-08-15 19:56:32 +00:00
dan
af2583c83c Fix a crash that can occur following an OOM fault.
FossilOrigin-Name: 9f80b2687012ab7c4d6d654fe19f40878bd78bd8
2013-08-15 18:43:21 +00:00
dan
3bc9f74fe9 Change some assert() statements in vdbe.c to ensure that a memory cell used to store a VdbeCursor object is not also used for some other purpose.
FossilOrigin-Name: 71070c9fce86103f174220e07771df99b2e01405
2013-08-15 16:18:39 +00:00
dan
1f616ad8fa Add tests for sqlite_stat4 sample selection. And a fix for the same.
FossilOrigin-Name: 1fb4d9d6f2675515feb8e3d971bbd54716372549
2013-08-15 14:39:09 +00:00
dan
0106e378f1 Re-enable reading from the sqlite_stat3 table (as well as sqlite_stat4).
FossilOrigin-Name: 6d45078e621526fc2bac0eaefbb0f9602b9a8ec5
2013-08-12 16:34:32 +00:00
dan
dd6e1f193e Add the rowid field to the end of sample records stored in the sqlite_stat4 table.
FossilOrigin-Name: 3a5e8ab7ddbe1d943b35ef329fe4e5a1bfdb0d9d
2013-08-10 19:08:30 +00:00
dan
ddc2d6e8f5 Fixes for builds without SQLITE_ENABLE_STAT4.
FossilOrigin-Name: 84999e27cc0d14b89d9fe024e29d287c69285369
2013-08-06 20:15:06 +00:00
dan
e043201d3d Use N separate cursors when scanning an index with N columns to collect sqlite_stat4 data. This fixes a problem with collecting incorrect nEq values from multi-column indexes.
FossilOrigin-Name: 3a71afe67418ce00097cd9714c395fe9ff16f23b
2013-08-05 18:00:56 +00:00
dan
c55521a60b Fix a couple of problems in code related to sqlite_stat4.
FossilOrigin-Name: badd24d987240db5528b37d1c177431617079f9b
2013-08-05 05:34:30 +00:00
dan
f52bb8d385 Begin adding experimental sqlite_stat4 table. This commit is buggy.
FossilOrigin-Name: 2beea303a1d609cd2ff252412c50b966b9e5e8f1
2013-08-03 20:24:58 +00:00