Commit Graph

31 Commits

Author SHA1 Message Date
drh
790adfd8ec Do not overflow the Index.aSample[] array if the same index appears in
the sqlite_stat4 table under multiple names because it is a WITHOUT ROWID
primary key index.  [forum:/info/537d8ab118df7edd|Forum post 537d8ab118df7edd]

FossilOrigin-Name: 9350a25ac0b55a6b901bc50e4db6d4e883c2617e1d2a8fdc90effabe52bb0012
2023-05-03 05:00:10 +00:00
drh
223c6b48a9 The sqlite_stat4.idx field is case insensitive. It should work even if
some entries use a different case than others.  Fix for
[forum:/info/6c118daad0f1f5ef|forum post 6c118daad0f1f5ef].

FossilOrigin-Name: f097ca70b5b967d1aadebd74ac5020813e00b7c30cc543814dbf5f359d1328f1
2023-04-22 22:32:19 +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
dan
ca3ee7e18a Do not attempt to run test script analyze3.test as part of the "prepare" permutation.
FossilOrigin-Name: f7f13cb1bc699c034a3f5f7a2431c8055cb79e2a14d5e70e1fc5dd6dec00fb26
2020-08-27 14:53:47 +00:00
drh
175b8f06f7 Remove support for STAT3. The sqlite_stat3 tables are ignored, if they
exist.  STAT4 continues to work as it always has, and as it is a superset of
STAT3 is the recommended replacement.

FossilOrigin-Name: 1e17ea2fd1df4ad49138c787c8fe3207dd0c25c93f9001d52a9b69f8c12e841c
2019-08-08 15:24:17 +00:00
drh
03c3905f94 Fix a dangling-else problem that was causing recursive CTEs to malfunction.
Begin fixing test cases to work with the new EQP output.

FossilOrigin-Name: 82ca44b82fed6814c84440ba8bfaa019488ab956e84ac165180e2fcece6facb2
2018-05-02 14:24:34 +00:00
drh
169dd928c5 Add the SQLITE_DBCONFIG_ENABLE_QPSG option to activate the query planner
stability guarantee.  This involves refactoring the sqlite3.flags bitvector
to carve out a free bit to use.

FossilOrigin-Name: 7076e8283ebae1b45a5d85d9538b49b6da399d38c3c6935de100f948f814f6a9
2017-06-26 13:57:49 +00:00
drh
41d2e66ef3 Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option.
FossilOrigin-Name: 9e1d6d4c391ff90077f0d1cdeb567969fee9f747
2015-12-01 21:23:07 +00:00
dan
4eed05347c Fix a memory leak caused by duplicate entries in the sqlite_stat1 table.
FossilOrigin-Name: 2f58c8c9722fffc486610f9e6b08178d53a56b64
2015-04-20 15:13:08 +00:00
drh
cef2584335 Fix an obscure memory leak in sqlite3Stat4ProbeFree()
FossilOrigin-Name: c72abbe2c1735f3d563c6672616b2918b6209922
2015-04-20 13:59:18 +00:00
drh
a9c18a9067 Test cases added. Comments fixed. Proposed solution for
ticket [05f43be8fdda9fbd9].

FossilOrigin-Name: 6b993bd54035b67f4d84941e3f444ca79b7feee1
2015-03-06 20:49:52 +00:00
dan
b51926e67c Update test script analyze3.test to account for the fact that SQLite now prefers a full-table scan over a non-covering index scan that visits a large percentage of the table rows.
FossilOrigin-Name: 35f46a55d866b9a87c1321aab8e0cfe86ccadb93
2014-04-28 10:00:59 +00:00
dan
8ad169abb4 If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4.
FossilOrigin-Name: cca8bf4372ab7a0258aa5c9397818415c6cf0abf
2013-08-12 20:14:04 +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
f52bb8d385 Begin adding experimental sqlite_stat4 table. This commit is buggy.
FossilOrigin-Name: 2beea303a1d609cd2ff252412c50b966b9e5e8f1
2013-08-03 20:24:58 +00:00
dan
2acbc0dd78 Add test case for the problem fixed by [127a5b776d].
FossilOrigin-Name: 65816718b59b286c11d939235a23c7325f25594b
2013-08-01 17:43:35 +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
74e7c8f51f Purge lingering references to SQLITE_STAT2 from the code and test scripts.
FossilOrigin-Name: aed2bf7a3c828a7191389b3f8235a9387977b476
2011-10-21 19:06:32 +00:00
drh
d4b0ff9926 Merge the STAT3 changes into trunk.
FossilOrigin-Name: 774d0842bcce8862f2aac371f1689536ed234a0a
2011-10-03 15:30:33 +00:00
drh
50a1c56a2e Update some test cases to work with sqlite_stat3 instead of sqlite_stat2.
FossilOrigin-Name: 2504bcfb0cf14b5ce51db0af1269ac28384714e0
2011-08-15 12:58:23 +00:00
drh
4e50c5ec48 Further testing and bug fixing for sqlite_stat3. Added the Index.avgEq
field to index statistics.  Fixed several problems in the query planner
associated with stat3.

FossilOrigin-Name: 89b2f70884cad0abdf4c66cb64ecddb2820ded74
2011-08-13 19:35:19 +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
3985479b9d Change some test cases to account for the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 88a854e18fc6bd619fa8d8a911abff50a9b76b9e
2010-11-15 16:12:58 +00:00
dan
d08640871c Experimental refactoring of the Pager object state.
FossilOrigin-Name: 03a240514aa07a22db787d221641253f23933e88
2010-08-02 14:32:52 +00:00
drh
93ee23cc03 Try to optimize LIKE and GLOB operators when RHS contains no wildcard.
Ticket [e090183531fc274747]

FossilOrigin-Name: 613a87d62fd1f8526d53136efae5adae91824bcf
2010-07-22 12:33:57 +00:00
drh
cda455b7ff Add a sqlite3_log() call on anonymous constraint failures.
Fix the output of test cases having to do with improved reprepare reporting.
Fix the VACUUM command to report more helpful error messages when things go
wrong.

FossilOrigin-Name: 69a493182fd77bec91598516ee42c11a6db1d039
2010-02-24 19:23:56 +00:00
drh
8cff69df11 Enhance the OP_Found and OP_NotFound opcodes so that they can accept an
array of registers as an unpacked record in addition to a record built
using OP_MakeRecord.  Use this to avoid OP_MakeRecord calls during IN
expression processing.

FossilOrigin-Name: b9eab885cd2ca1a1633329e7036c125e8dba62c5
2009-11-12 19:59:44 +00:00
dan
c94b859560 Fix cases where modifying bound variables using the clear_bindings() or transfer_bindings() APIs can invalidate a query plan.
FossilOrigin-Name: e6808c988c9cd7b2db23f18b5fe2177151b6f586
2009-10-20 07:01:24 +00:00
dan
1d2ce4f804 Remove the sqlite3_reoptimize() API. The same functionality is now provided automatically to queries prepared using prepare_v2().
FossilOrigin-Name: 2c50b3d5aab7cd8cc841d61f8c3b2b34d2f0b54b
2009-10-19 18:11:09 +00:00
dan
d893ed8eea Fix a problem in the analyze3.test script.
FossilOrigin-Name: 61174aea74db59f6792e275aa366b7f0e1f2270b
2009-10-16 15:59:35 +00:00
dan
937d0dea4f Add the experimental sqlite3_reoptimize() API.
FossilOrigin-Name: 9bd6f3d8864d422fe42074688b191915b27ad8ea
2009-10-15 18:35:38 +00:00