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
ad4c7aa10f
Fix compiler warnings in analyze.c.
...
FossilOrigin-Name: 5bbd2ccb3d2d6286fd667dac2ab658d6b89640a6
2013-08-30 20:19:52 +00:00
mistachkin
79e8445f63
Fix comment typo in analyze.c. No changes to code.
...
FossilOrigin-Name: dbc31750440226702fbf88f1bf6140ef403c9be1
2013-08-30 19:59:48 +00:00
drh
6d57bbfe25
Label a certain branch as NEVER() only for non-STAT3/4 builds.
...
FossilOrigin-Name: b5ccf6e995ac2fe010f49d46d40b487ddbd28e5a
2013-08-28 11:43:49 +00:00
drh
1435a9a126
Adjust ANALYZE for improved test coverage. Use the SQLITE_ENABLE_STAT3_OR_STAT4
...
macro (created in sqliteInt.h) to conditionally include code, instead of
a boolean specifying both macros separately.
FossilOrigin-Name: 67a9a392edd62ef5a5a1ad3010b20a39b285793d
2013-08-27 23:15:44 +00:00
drh
9fecc546cb
Reduce the amount of code run and memory used for ANALYZE in the common case
...
where neither STAT3 and STAT4 are enabled.
FossilOrigin-Name: 9d1424c91a21ed740aca53e437b8f7c1f0823c03
2013-08-27 20:16:48 +00:00
drh
59b08dd449
In the ANALYZE command implementation make statInit() a 2-value function
...
since the 3rd parameter was always the same constant.
FossilOrigin-Name: 959bb5acdc3b4e2b481e3c38f20867131bfc9dbc
2013-08-27 14:14:14 +00:00
drh
92707acfd0
Adjustments to #ifdefs in analyze.c to all a clean compile with no
...
extra code with both ENABLE_STAT3 and ENABLE_STAT4 and with neither.
FossilOrigin-Name: f86b75b6c7290ee6ddb3636090b00e99fc68c45e
2013-08-17 18:57:15 +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
drh
61b3440603
Fix a potential segfault following an OOM while running ANALYZE.
...
FossilOrigin-Name: 0118797823c9093e68113578f3f3aae65de41453
2013-08-16 13:34:50 +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
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
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
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
dan
ddc2d6e8f5
Fixes for builds without SQLITE_ENABLE_STAT4.
...
FossilOrigin-Name: 84999e27cc0d14b89d9fe024e29d287c69285369
2013-08-06 20:15:06 +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
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
721dfcf544
Fix the ANALYZE command to work with partial indices.
...
FossilOrigin-Name: 60353124f4e965393ecd864019bdbca1999fb69e
2013-08-01 04:39:17 +00:00
drh
f7b5496e8e
Many small harmless comment changes. Removal of obsolete comments and
...
fixing misspelled words. No changes to code.
FossilOrigin-Name: a0d5cc9315dc6e9ef7dee4c3dfabf4e562d64376
2013-05-28 12:11:54 +00:00
drh
503a686e09
Always use strncmp() rather than memcmp() when comparing strings where one
...
or other string might be less than the length parameter, since optimized
versions of memcmp() might read past the first difference and in so doing
generate an access violation.
FossilOrigin-Name: d73435587ba7459e2e2c32980d0e17abdeceb4bc
2013-03-01 01:07:17 +00:00
dan
428c218c90
When reusing pages as part of creating a new index, allocate the leaves from each free-list trunk page in ascending order, instead of trying to maximize localization for each individual allocation. This increases the chance that pages will be written to disk in ascending order by a large CREATE INDEX statement, improving overall performance.
...
FossilOrigin-Name: d045f8b2d44e388d8c4549ff02d4ca7eff4e2038
2012-08-06 18:50:11 +00:00
dan
6809c96df3
Replace a few sqlite3_malloc()+memset() sequences with calls to sqlite3MallocZero().
...
FossilOrigin-Name: 305b6667265353b858b79bfea1745e64ff3bb7d3
2012-07-30 14:53:54 +00:00
dan
0d1614c731
Ensure that compatible malloc and free functions are used with stat3 data if SQLITE_ENABLE_STAT3 is defined.
...
FossilOrigin-Name: 32bb1ecee4e43a4683512dbca047abf735afd313
2012-03-19 10:21:37 +00:00
drh
e752cda894
Fix STAT3 so that it works with the new uninitialized register logic of
...
the VDBE. Ticket [7bbfb7d4422ff]
FossilOrigin-Name: d11a57985c394772043c63d4c2b534944be0a664
2011-12-11 02:30:35 +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
08ccfaa1b1
Change the ANALYZE command so that it no longer tried to delete unused
...
sqlite_stat2 and sqlite_stat3 tables. Change the DROP TABLE command so
that it is able to drop those tables.
FossilOrigin-Name: 589f3f5652e3674d3203f8bd32784a46b5ed530c
2011-10-07 23:52:25 +00:00
drh
369980189b
Fix typos in the format description comment of analyze.c.
...
FossilOrigin-Name: 74e27fad339a2d7899c1f42805e615128929f07a
2011-09-23 13:25:03 +00:00
drh
2b9cf669d8
Remove the restriction on the number of entries per index in sqlite_stat3.
...
FossilOrigin-Name: 374343c8ad53829c4ad715ed623d16635797de9a
2011-09-22 20:52:56 +00:00
drh
5c62486cd8
Fix an issue in ANALYZE when STAT3 is disabled but both sqlite_stat2 and
...
sqlite_stat3 tables exist. Also add testability tweaks to the STAT3 code.
FossilOrigin-Name: 3ca7e449e2e20d95e516cf7fe87bfa0b51c07086
2011-09-22 18:46:34 +00:00
drh
93c6384ca6
Fix an uninitialized variable and a misuse of memcpy().
...
FossilOrigin-Name: ee110d5a4a6f29400bb632a9a18c7dcd04638657
2011-09-22 00:28:55 +00:00
drh
d3ed73406c
Pull in the latest changes from trunk. Update the STAT3 documentation.
...
FossilOrigin-Name: 63fc3e4bea6a7f5dc34b2af83f30458eb10b8fe0
2011-09-21 00:09:41 +00:00
drh
8e3937ff0d
Fix the stat3 analysis loader to be compatible with sqlite3_db_status().
...
Also fix some OOM issues with the stat3 analysis loader.
FossilOrigin-Name: eaf447ea87b0ff29ae06283204f522fcd005b284
2011-08-18 13:45:23 +00:00
drh
88ab5b08ad
Fix an error with OOM processing in the ANALYZE logic.
...
FossilOrigin-Name: b26ec79c69f44b55bc4bb11e293f11b3afa3b724
2011-08-18 01:10:35 +00:00
drh
6825719667
Fix a few harmless compiler warnings. Add SQLITE_ENABLE_STAT3 to the
...
standard compiler warning script.
FossilOrigin-Name: 3d68f9afee02f95103eb1682b8f2362f8d249437
2011-08-16 17:06:21 +00:00
dan
23e7c4de7b
Fix a couple of typos in comments in analyze.c.
...
FossilOrigin-Name: ae31dc67aa0637150f964de31a6da6f5797b462a
2011-08-15 12:02:21 +00:00