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
drh
f0459fc410
Make sure the ANALYZE command allocates enough VDBE registers.
...
FossilOrigin-Name: 46fec9b1a1c4616df5a634dbf9235bd13408d3a9
2013-08-15 16:15:00 +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
f00e902580
Change the way ANALYZE works to use a single cursor when scanning indices.
...
FossilOrigin-Name: bdce612b35193abf72de1a563ea7962375b3574e
2013-08-14 19:54:12 +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
86f69d98d2
If there is data in both the sqlite_stat4 and sqlite_stat3 tables for a single index, ignore the sqlite_stat3 records.
...
FossilOrigin-Name: 2a41736728d83a777ea8112da927cb047ec6684e
2013-08-12 17:31:32 +00:00
drh
6b0ae91930
Handle a NULL input to decodeIntArray() that can result from a prior OOM.
...
FossilOrigin-Name: fa1588adab6759fd3d1be02524aa19a0d1c6adaa
2013-08-12 17:00:08 +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
5133c78cae
Fix a bug in calculating the average number of entries for keys not present in the sqlite_stat4 table.
...
FossilOrigin-Name: ec3ffb174844406a6186c3dcc41b76d0331b502c
2013-08-12 11:21:10 +00:00
dan
568cd51b79
Fix minor problems caused by adding the rowid to the records in stat4.
...
FossilOrigin-Name: 088d1ff94890ada50d43e6a366a58167ec5a8e96
2013-08-12 09:29: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
84d4fcc52d
Fix a couple of typos in a comment in analyze.c. No code changes.
...
FossilOrigin-Name: 5bcccb93df98f5dfee0ea4d797b07fe0257258a9
2013-08-09 19:04:07 +00:00
drh
c8af850479
Update the header comment on analyze.c to describe the sqlite_stat4 table
...
format.
FossilOrigin-Name: 4d97809d6b29809f12d753043bda1976bdb1bd3b
2013-08-09 14:07:55 +00:00
dan
b3c02e210f
Fix problems in estimating the number of rows visited by a range query using sqlite_stat4 data when the column subject to the range query is not the leftmost of the index.
...
FossilOrigin-Name: 9228aaf54dd2700c4f460f94f9c2309407578983
2013-08-08 19:38:40 +00:00
dan
84c309b6ae
Use a binary search instead of a linear scan when comparing a sample key against data from the sqlite_stat4 table.
...
FossilOrigin-Name: e50dc30523210ba12324d5d8379503610f13aa34
2013-08-08 16:17:12 +00:00
dan
ad45ed7414
Fix a segfault in "ALTER TABLE t1 ADD COLUMN b DEFAULT (-+1)". Also an assert() failure that could occur if SQLITE_ENABLE_STAT4 were not defined.
...
FossilOrigin-Name: 9fec3e38287067d60874530300fbeb602958c951
2013-08-08 12:21:32 +00:00
dan
6cb8d76ccb
Fix a bug in using stat4 data to estimate the number of rows selected by a range constraint.
...
FossilOrigin-Name: f783938ea999731ea073cd2c78e278095f7bea6d
2013-08-08 11:48:57 +00:00
dan
eea568d68e
Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq.
...
FossilOrigin-Name: 7b70b419c43b2c3b2daf11d833a1d60245bfaef5
2013-08-07 19:46:15 +00:00
dan
3d40759803
Merge latest trunk changes with this branch.
...
FossilOrigin-Name: 08f74c45ecf711a2373af578d44470add9082377
2013-08-07 18:42:27 +00:00
dan
32c693a6e6
Fix typos in a comment in analyze.c. No code changes.
...
FossilOrigin-Name: 812ed0c58fc5f729a2d4f16775fad6724cc367a6
2013-08-07 16:38:33 +00:00
dan
1f28eaddc4
Change the way samples for the sqlite_stat4 table are collected.
...
FossilOrigin-Name: 13ed5ac13562e7a39905d70fd47059f4d8001bba
2013-08-07 16:15:32 +00:00
drh
7ed103210d
Fix the ".dump" command on the command-line shell so that it works for
...
"sqlite_stat4" in addition to "sqlite_stat1".
FossilOrigin-Name: 1e80c4b12dbb5beab422e2a33a8782ac9d767321
2013-08-07 16:04:27 +00:00
drh
4bfd4ad9a7
Remove the unused sqlite3Utf8to16() utility function.
...
FossilOrigin-Name: 9159b43eb2cb5d6ed18a5ad168fa27134fec2553
2013-08-07 15:57:24 +00:00
dan
87cd93215e
When estimating the number of rows scanned using data from the sqlite_stat4 table, avoid allocating UnpackedRecord and KeyInfo structures until they are definitely required.
...
FossilOrigin-Name: 353950a5269fa439cc3e57b62e16558a84ea2557
2013-08-07 15:52:41 +00:00
drh
3b449ee481
Add a guard #ifndef to test_intarray.h to prevent harm if it is #included
...
more than once. Add a comment on the closing #endif of the guards on
sqlite3.h and test_multiplex.h.
FossilOrigin-Name: 0ad83ceb79767738bd06a28840cf84da0464ab4f
2013-08-07 14:18:45 +00:00
drh
4a6fc3596b
Fix typos and add clarification to comments in where.c. No code changes.
...
FossilOrigin-Name: f8d8790ede0fcaf6c5b60ac22919c1d97c74e838
2013-08-07 01:18:38 +00:00
dan
ddc2d6e8f5
Fixes for builds without SQLITE_ENABLE_STAT4.
...
FossilOrigin-Name: 84999e27cc0d14b89d9fe024e29d287c69285369
2013-08-06 20:15:06 +00:00
dan
7a4192358a
When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan.
...
FossilOrigin-Name: 2973f5ca736c4a6f13c653d54b6a29d7cae8d0ed
2013-08-06 20:01:43 +00:00
drh
9fe809c561
Fix a test case related to partial indices so that it works even if
...
STAT3 is disabled.
FossilOrigin-Name: 153c645025637bbff14dfce793e4b92210ded7e8
2013-08-06 19:18:17 +00:00
drh
d3f4964168
Adjust #ifdefs in test_autoext.c so that it compiles with
...
SQLITE_OMIT_LOAD_EXTENSION. Fix compiler warnings in two other
test modules. No changes to the core.
FossilOrigin-Name: 89930ea3c3b3bd078f641b2c5203d851083bbf1a
2013-08-06 18:35:31 +00:00
drh
d9b8c0d761
Update the configure script to use the latest version number (3.8.0).
...
FossilOrigin-Name: 52e8ec5e24730efa6d89cbaf1e03bc1d5c59cc05
2013-08-06 18:21:21 +00:00
drh
812ea83343
Add a testcase() macro to verify OOM coverage.
...
FossilOrigin-Name: d43dcbc488120aeb7104ab9e6a27f62bb348bf6a
2013-08-06 17:24:23 +00:00
drh
3535ec3e10
Remove unreachable branches in expr.c, replacing them with assert() and
...
testcase() statements.
FossilOrigin-Name: 9103c27ceb3f4023ea3a41b679a10717d3f80210
2013-08-06 16:56:44 +00:00
drh
2d463113f0
For the ".import" command of the command-line shell, start a transaction
...
if there is not one active already.
FossilOrigin-Name: 5dcc2d91bd343cd0fac79d3c8f079a5ce534cdf7
2013-08-06 14:36:36 +00:00
drh
9f099fd45a
Clean up the input reader in the command-line shell for improved legibility
...
and performance.
FossilOrigin-Name: 2b1743d60171635c1e5a6ede6b4928f4671f948d
2013-08-06 14:01:46 +00:00
drh
8c8a8c4573
More than double the speed of the resolveP2Values() routine in vdbeaux.c by
...
moving from an extended if-else on every opcode to a switch. Opcodes are
reordered in mkopcodesh.awk to put the switched opcodes close together,
for additional performance and to reduce code footprint.
FossilOrigin-Name: 924f7e4d7a8fa2fe9100836663f3733b6e1a9084
2013-08-06 07:45:08 +00:00
drh
d58d3278cb
Performance optimization: Avoid calling convertCompoundSelecctToSubquery()
...
on queries that do not use the UNION, EXCEPT, or INTERSECT operators.
FossilOrigin-Name: c589b2fed7beabc2337d701094c22635914d9c23
2013-08-05 22:05:02 +00:00
mistachkin
f3d2aaeca2
For the vtshim module, always zero out the xChildDestroy function pointer after calling it.
...
FossilOrigin-Name: 240f7252c66ad3ff5ae0ef06455c1ff9bd78bbb4
2013-08-05 21:54:17 +00:00
drh
323df7907e
Factor all KeyInfo object allocations into a single function:
...
sqlite3KeyInfoAlloc(). Always allocate enough space so that
sqlite3VdbeRecordCompare() can avoid checking boundaries and hence
run faster.
FossilOrigin-Name: 7301bedd94c8610568349953b18ff3575203e1b2
2013-08-05 19:11:29 +00:00
dan
c612970c9d
Modify the vdbe code generated by ANALYZE to use fewer memory cells and cursor slots.
...
FossilOrigin-Name: 4a51cf289fad8aebc637b5f96488de18e861195d
2013-08-05 19:04:07 +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
drh
af5b2af77d
Improve performance of sqlite3VdbeRecordCompare() by using an approximation
...
that might give false negatives and only running the more expensive exact
subexpression if the approximation fails.
FossilOrigin-Name: 28979dcd16f53e0ddca8eed74b668834e2856f03
2013-08-05 15:32:09 +00:00
drh
407ceeb84d
Add a missing '#include "tcl.h"' to test_rtree.c.
...
FossilOrigin-Name: 4b8b426f10f8ae13bf553f7adf5ae09383fa0bd4
2013-08-05 12:31:41 +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
drh
3975974780
Updates to requirements marks. No code changes.
...
FossilOrigin-Name: 213020769f310aec1591d97756b53891d0b64005
2013-08-02 23:40:45 +00:00
drh
e0c7efd9ae
Add NEVER() and ALWAYS() macros on some unreachable yet prudent branches.
...
FossilOrigin-Name: c5c0a8ab6c222185d5f9d4321e64d9f93cd36b7d
2013-08-02 20:11:19 +00:00
drh
b47e07f1c1
Add support for partial indices.
...
FossilOrigin-Name: 478113f18b1d28606b107b5a0bed04cb90a82cf2
2013-08-02 16:41:02 +00:00