/ All files named "src/analyze.c"
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/analyze.c

2020-10-22
18:58
[eb5fae65] part of check-in [263293f1] Minor tweaks to query planning weights so that when STAT4 is enabled and functioning, a full table scan is more likely to be selected if that seems like the fastest solution. Only do this when STAT4 info is available because an error has a large potential downside. (check-in: [263293f1] user: drh branch: branch-3.28, size: 67368)
15:47
[01c6c676] part of check-in [0f42099a] Sometimes it makes sense to do a full table scan rather than try to use an index when most of the rows will be selected. This branch is trying to tune the query planner to make that happen more often. (check-in: [0f42099a] user: drh branch: avoid-bad-indexes, size: 67677)
2020-08-11
14:55
[5eab9cfb] part of check-in [b1a77b7e] Merge all changes since the 3.32.0 release into the reuse-schema branch. (check-in: [b1a77b7e] user: drh branch: reuse-schema, size: 67678)
2020-07-22
13:38
[5cffff3d] part of check-in [9ce1710a] Continuing work toward supporting unsigned 32-bit page numbers. (check-in: [9ce1710a] user: drh branch: larger-databases, size: 67634)
2020-05-30
00:30
[2c77bcbb] part of check-in [1cb248a3] Improved VDBE comments on the ANALYZE code generator. This change also fixes a harmless use of an uninitialized integer variable as an input to the %d format on a VDBE comment. (check-in: [1cb248a3] user: drh branch: trunk, size: 67619)
2020-05-16
19:00
[b2b878f8] part of check-in [5af4abe9] Merge trunk enhancements in the reuse-schema branch. (Actual date of this check-in is 2020-05-18.) (check-in: [5af4abe9] user: drh branch: reuse-schema, size: 66861)
2020-05-04
19:52
[953a6c43] part of check-in [8eee591d] Fix harmless compiler warnings. (check-in: [8eee591d] user: drh branch: trunk, size: 66817)
2020-05-02
03:29
[f71fb976] part of check-in [77a55c39] Add a missing VdbeCoverage() macro. (check-in: [77a55c39] user: drh branch: approximate-analyze, size: 66808)
2020-04-01
17:10
[b05704c7] part of check-in [7e666b60] Add support for the "ANALYZE WITH LIMIT=N" syntax. (check-in: [7e666b60] user: drh branch: analyze-with-limit, size: 67210)
01:15
[05c99006] part of check-in [c20d4fde] Simple fixes to PRAGMA analysis_limit. (check-in: [c20d4fde] user: drh branch: approximate-analyze, size: 66783)
2020-03-31
20:57
[4b139fa0] part of check-in [a279b151] Add "PRAGMA analysis_limit=N;" to limit the number of rows visited by ANALYZE when N is positive. Positive N also disables collecting stat4. (check-in: [a279b151] user: drh branch: approximate-analyze, size: 66886)
2020-03-18
15:58
[3d90f566] part of check-in [8f0a8c2a] Fix the build for when SQLITE_ENABLE_STAT4 is defined. (check-in: [8f0a8c2a] user: drh branch: approximate-analyze, size: 66482)
14:43
[2ae3d2e1] part of check-in [a773fd46] Add the SQLITE_ANALYZE_LIMIT compile-time option (expected to be temporary) that sets a threshold at which ANALYZE starts to use approximations during the analysis process. (check-in: [a773fd46] user: drh branch: approximate-analyze, size: 66471)
2020-03-17
17:11
[0df49eed] part of check-in [714419fe] Provide an estimated row count to stat_init() for STAT1 analysis. (check-in: [714419fe] user: drh branch: approximate-analyze, size: 65535)
13:41
[aaeb41ef] part of check-in [a9bfa47a] Remove the SQLITE_OMIT_BTREECOUNT option. Btree count is required. (check-in: [a9bfa47a] user: drh branch: approximate-analyze, size: 65492)
13:07
[5f09eb4e] part of check-in [c38ea413] Improved bytecode comments for the ANALYZE command. (check-in: [c38ea413] user: drh branch: approximate-analyze, size: 65394)
2020-03-10
01:24
[cc340128] part of check-in [29d1cc5c] Background work for experiments trying to enhance ANALYZE so that it runs off of samples of the entire index and does not need to read the entire index. (check-in: [29d1cc5c] user: drh branch: approximate-analyze, size: 65285)
2020-03-09
18:26
[831bb090] part of check-in [3df07e5a] Cleaner separation of the STAT4-specific logic in the implementation of ANALYZE. (check-in: [3df07e5a] user: drh branch: trunk, size: 64742)
2020-01-15
14:26
[caa9cc97] part of check-in [f7839178] Merge all recent enhancements and fixes from trunk. (check-in: [f7839178] user: drh branch: reuse-schema, size: 64830)
2019-10-30
16:29
[b3ceec3f] part of check-in [84e02d77] Simplify the bytecode generation for SQL function calls such that the OP_Function or OP_PureFunc opcodes are coded directly, rather than using the intermediate OP_Function0 or OP_PureFunc0 - opcodes that are now removed. (check-in: [84e02d77] user: drh branch: trunk, size: 64786)
2019-10-19
13:29
[fd70b9c7] part of check-in [27ab41c9] Refactor names of column index transformation functions, for clarity. Get generated columns working with ALTER TABLE RENAME COLUMN. (check-in: [27ab41c9] user: drh branch: generated-columns, size: 64846)
2019-10-09
17:06
[777b2290] part of check-in [5ba8cee8] An alternative, experimental lookaside memory allocator that uses two different slot sizes. (check-in: [5ba8cee8] user: sperry branch: 2-size-lookaside, size: 64946)
2019-10-05
14:39
[481d9cf3] part of check-in [17ce1c49] Performance optimization to the lookaside-memory disabling mechanism. (check-in: [17ce1c49] user: drh branch: trunk, size: 64841)
2019-09-16
12:35
[050e013f] part of check-in [27eb2236] Merge all recent trunk enhancements into the reuse-schema branch. (check-in: [27eb2236] user: drh branch: reuse-schema, size: 64902)
2019-08-15
14:35
[a3f4ea45] part of check-in [98357d8c] Ensure that the optional "sz=N" parameter that can be manually added to the end of an sqlite_stat1 entry does not have an N value that is too small. Ticket [e4598ecbdd18bd82] (check-in: [98357d8c] user: drh branch: trunk, size: 64858)
2019-08-13
15:22
[01ee7d24] part of check-in [5b4689d8] Merge latest trunk changes with this branch. (check-in: [5b4689d8] user: dan branch: reuse-schema, size: 64854)
2019-08-08
16:23
[0278dbf6] part of check-in [845d2f17] More legacy STAT3 code removed. (check-in: [845d2f17] user: drh branch: omit-stat3, size: 64810)
15:24
[eed90d1d] part of check-in [1e17ea2f] 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. (check-in: [1e17ea2f] user: drh branch: omit-stat3, size: 64938)
2019-02-18
18:16
[9ffcf938] part of check-in [88cbf54e] Ensure that creating temp schema items does not cause an OPEN_SHARABLE_SCHEMA connection to load all schemas into memory. (check-in: [88cbf54e] user: dan branch: reuse-schema, size: 67387)
2019-02-08
19:30
[e75c3c1d] part of check-in [2b2e9f81] Add test cases and fix problems on this branch. (check-in: [2b2e9f81] user: dan branch: reuse-schema, size: 67369)
2019-02-05
19:51
[1f1af7b0] part of check-in [c089cc4f] Merge latest trunk into this branch. (check-in: [c089cc4f] user: dan branch: reuse-schema, size: 67363)
2018-12-29
02:26
[58db6634] part of check-in [4a0929ac] A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. (check-in: [4a0929ac] user: drh branch: trunk, size: 67325)
2018-11-16
17:04
[09c96842] part of check-in [9780829a] Fix further REUSE_SCHEMA issues. (check-in: [9780829a] user: dan branch: reuse-schema1, size: 67223)
2018-10-08
18:58
[44f9189f] part of check-in [2ac72114] Merge latest trunk changes into this branch. (check-in: [2ac72114] user: dan branch: reuse-schema, size: 67358)
2018-07-20
19:24
[3dc6b98c] part of check-in [489f3caf] Change the SQLITE_Stat34 bit of the optimization test-control so that it prevents STAT4 data from being used but allows it to be loaded into the Index objects. This permits STAT4 to be turned on and off on a per-statement basis. (check-in: [489f3caf] user: drh branch: trunk, size: 67320)
18:01
[3c64f4f1] part of check-in [085f17e1] Experimental change to ANALYZE so that when computing values for sqlite_stat1, it uses the maximum number for the number of rows having equivalent values, rather than the average. (check-in: [085f17e1] user: drh branch: stat1-max, size: 67896)
2018-07-10
17:10
[91b5e7c0] part of check-in [76e42b70] Further improvements to bytecode branch testing. Fix cases where the macros said a branch could not be taken when in fact it could be. Alter some window function branch coverage macros to indicate that comparison operands cannot be NULL. (check-in: [76e42b70] user: drh branch: trunk, size: 67362)
2018-06-10
07:42
[41f0b8d6] part of check-in [16db7384] Update Makefile.msc to include window.c in the build. (check-in: [16db7384] user: dan branch: exp-window-functions, size: 67542)
2018-05-16
20:58
[1250e69b] part of check-in [3781e520] Start of experimental implementation of SQL window functions. Does not yet work. (check-in: [3781e520] user: dan branch: exp-window-functions, size: 67440)
2018-03-23
12:59
[71fbbeb7] part of check-in [0249d9ae] Fix the ANALYZE command so that it will process tables whose names begin with "sqlite" as long as they do not being with "sqlite_". (check-in: [0249d9ae] user: drh branch: trunk, size: 67416)
2018-01-17
20:57
[6b42e36a] part of check-in [25bf734b] Fix a problem in the sessions module with logging sqlite_stat1 rows for which (idx IS NULL) is true. (check-in: [25bf734b] user: dan branch: sessions-stat1, size: 67411)
2018-01-12
16:44
[f9bfffd0] part of check-in [bd46c442] Experimental change to include changes made to the sqlite_stat1 table in changesets generated by the sessions module. sqlite_stat1 entries in such changesets are ignored by legacy clients. (check-in: [bd46c442] user: dan branch: sessions-stat1, size: 67311)
2017-08-09
20:35
[a40d5a30] part of check-in [a6256980] Add experimental sqlite3_open_v2() flag SQLITE_OPEN_REUSE_SCHEMA. For sharing identical in-memory schema objects between connections. (check-in: [a6256980] user: dan branch: reuse-schema, size: 66634)
2017-06-07
10:55
[62a35801] part of check-in [c81f260c] Cause the ANALYZE command to build sqlite_stat1 table entries for empty tables with the assumption that such tables really contain 10 elements. This gives better query plans for tables that are truely empty, but is likely to cause problems in legacy systems, so the change is kept off trunk. Some TCL tests fail on this check-in due to the new stat1 entries. (check-in: [c81f260c] user: drh branch: analyze-empty-tables, size: 66619)
2017-03-21
18:56
[0d0ccf75] part of check-in [ad741976] Fix an incorrect assert in the ANALYZE logic for STAT4 on WITHOUT ROWID tables. (check-in: [ad741976] user: drh branch: trunk, size: 66596)
2017-02-23
00:58
[6d823491] part of check-in [188300a3] Do a single OP_Expire at the very end of "PRAGMA optimize", and omit the OP_Expire on ANALYZE commands invoked by the pragma. (check-in: [188300a3] user: drh branch: auto-analyze, size: 66593)
2017-02-22
19:49
[b4857ec5] part of check-in [fe073905] Merge integrity_check and other improvements from trunk. (check-in: [fe073905] user: drh branch: auto-analyze, size: 66904)
19:41
[8a2af8a1] part of check-in [d6afd98d] Move a branch condition in analyze.c inside an #ifdef SQLITE_ENABLE_STAT4 block. (check-in: [d6afd98d] user: dan branch: trunk, size: 66648)
19:27
[844359e7] part of check-in [737a8244] Improve the performance of ANALYZE when SQLITE_ENABLE_STAT4 is defined. (check-in: [737a8244] user: dan branch: trunk, size: 66648)
2017-02-18
02:42
[e01e5362] part of check-in [4229caec] Fix errors in the table resize detection. (check-in: [4229caec] user: drh branch: auto-analyze, size: 69062)
02:19
[eb50045b] part of check-in [882599a4] In the analyze_as_needed pragma, avoid running unnecessary OP_LoadAnalysis and OP_Expire opcodes. Make the analyze_as_needed pragma responsive to the schema name. (check-in: [882599a4] user: drh branch: auto-analyze, size: 69032)
2017-02-17
19:24
[acef9c48] part of check-in [bfbdd074] The analyze_as_needed pragma now responds to table size growth and will automatically rerun the analysis after each 10x size increase. (check-in: [bfbdd074] user: drh branch: auto-analyze, size: 68696)
16:26
[39206f31] part of check-in [e93db237] Add the "PRAGMA analyze_as_needed" command. (check-in: [e93db237] user: drh branch: auto-analyze, size: 67589)
13:38
[1b7197d6] part of check-in [85026c8e] Enhance the Index and Table objects so that they remember if their stats come from the sqlite_stat1 table. Make the "PRAGMA stats" an SQLITE_DEBUG only pragma. Add the flags column to "PRAGMA stats". These are all preliminary steps toward a "PRAGMA analyze_ifneeded;" feature. (check-in: [85026c8e] user: drh branch: auto-analyze, size: 66187)
2017-02-01
01:34
[ac7a5d7e] part of check-in [9663eea2] Improved comments on the statGet() implementation in ANALYZE. No changes to code. (check-in: [9663eea2] user: drh branch: trunk, size: 65931)
2017-01-11
14:21
[92d7ab85] part of check-in [4f83f680] In the STAT4 computations, ensure that the aAvgEq values do not go negative. (check-in: [4f83f680] user: drh branch: branch-3.8.9, size: 65554)
14:15
[317dbaf3] part of check-in [f58f75b5] In the STAT4 computations, ensure that the aAvgEq values do not go negative. (check-in: [f58f75b5] user: drh branch: trunk, size: 65644)
2016-12-30
14:15
[3c4a63ff] part of check-in [56ff72ab] Avoid passing NULL pointers to memcmp() or memcpy(), even when the "number-of-bytes" argument is passed 0. (check-in: [56ff72ab] user: dan branch: trunk, size: 65630)
2016-08-18
14:33
[8b62b2cf] part of check-in [92a22f01] Rename the Db.zName field to Db.zDbSName to make it more descriptive and to distinguish it from all of the other "zName" variables scattered throughout the code. (check-in: [92a22f01] user: drh branch: zDbSName, size: 65600)
2016-04-04
12:38
[37fedc80] part of check-in [0213d6af] Fix harmless compiler warnings. (check-in: [0213d6af] user: drh branch: trunk, size: 65582)
2016-04-01
12:35
[39b21e4d] part of check-in [a62340dc] When reading an sqlite_stat1 table with missing entries for some indexes, set the default for the missing indexes after all other indexes are set so that the default values are more in line with indexes that are actually in the stat1 table. (check-in: [a62340dc] user: drh branch: trunk, size: 65570)
2016-03-04
19:55
[a89554ee] part of check-in [c4488730] Simplify the computation of Index.aAvgEq. (check-in: [c4488730] user: drh branch: analyze-worst-case, size: 67334)
2016-03-01
14:31
[dac2f49d] part of check-in [21bfd47c] Change the estimated row counts in stat1 to be one-third worst-case and two-threads average case. (check-in: [21bfd47c] user: drh branch: analyze-worst-case, size: 67376)
2016-02-29
23:02
[997b0ce0] part of check-in [421b5b54] Improvements to the logic for adding the "noskipscan" flag to stat1 entries. (check-in: [421b5b54] user: drh branch: analyze-worst-case, size: 66150)
21:27
[95b2e37e] part of check-in [6326ba58] The ANALYZE command automatically appends "noskipscan" to sqlite_stat1 entries that have large worst-case repeat estimates but small average repeat estimates. (check-in: [6326ba58] user: drh branch: analyze-worst-case, size: 66147)
18:30
[37343619] part of check-in [5a0143c9] Modify the ANALYZE command to store worst-case statistics in sqlite_stat1, rather thn average case. (check-in: [5a0143c9] user: drh branch: analyze-worst-case, size: 65484)
2016-02-15
18:15
[ab57b676] part of check-in [9b345476] Add the SQLITE_NOMEM_BKPT macro to enhance the ability to debug OOM errors. Only effective with compiling with SQLITE_DEBUG. (check-in: [9b345476] user: drh branch: trunk, size: 65330)
00:34
[b148441c] part of check-in [3201fbcc] Improvements to the application-defined function mechanism so that it is more compact and runs faster, especially when the application defines thousands of new SQL functions. (check-in: [3201fbcc] user: drh branch: many-app-functions, size: 65305)
2016-02-13
23:43
[8f89d016] part of check-in [6a9c4a3e] Enhance ability to debug out-of-memory errors. (check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 65516)
2016-02-05
13:38
[fbf0e80d] part of check-in [0a802e96] Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majority cases where db is guaranteed to be not NULL. (check-in: [0a802e96] user: drh branch: oom-handling, size: 65491)
01:55
[5338dbbc] part of check-in [c3ef0347] Improvements to the way that OOM errors are processed. (check-in: [c3ef0347] user: drh branch: oom-handling, size: 65487)
2016-02-04
02:34
[e98b1f4c] part of check-in [1c8d3001] Add and use the sqlite3VdbeZeroRegister() interface for coding the common operation of writing zero into a register. (check-in: [1c8d3001] user: drh branch: zero-register, size: 65556)
2016-01-26
15:23
[dfc20750] part of check-in [12ef3a8f] Change the automatic index mechanism so that it avoids creating transient indexes on columns that are known to have low cardinality. (check-in: [12ef3a8f] user: drh branch: autoindex-planning, size: 65981)
2016-01-16
15:12
[0043d3e5] part of check-in [a4258cd4] Use sqlite3VdbeAddOp4() rather than a separate sqlite3VdbeChangeP4() call, for a slightly smaller and faster binary. (check-in: [a4258cd4] user: drh branch: trunk, size: 65565)
2016-01-14
22:19
[905d387f] part of check-in [0d1b3d7d] Combine the xFunc and xStep pointers of the FuncDef object into a single pointer xSFunc. (check-in: [0d1b3d7d] user: drh branch: trunk, size: 65597)
2015-11-24
21:23
[977bd50c] part of check-in [e70ec71d] Add the sqlite3_strlike() interface, which might be useful for implementing LIKE operators on virtual tables. (check-in: [e70ec71d] user: drh branch: vtab-like-operator, size: 65687)
2015-09-03
14:18
[4c308880] part of check-in [1ab10cbf] Merge enhancements from trunk. (check-in: [1ab10cbf] user: drh branch: index-expr, size: 65687)
13:46
[e4ad1495] part of check-in [847387ec] Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). (check-in: [847387ec] user: drh branch: trunk, size: 65735)
2015-09-02
18:19
[eb4683b5] part of check-in [be78f413] Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). (check-in: [be78f413] user: drh branch: trunk, size: 65772)
2015-08-25
16:57
[3ec61c51] part of check-in [efaabdb7] Add code to maintain indexes with expression arguments across DELETE, INSERT, and UPDATE statements. Legacy tests pass, but the new code paths are still largely untested. The query planner currently makes no effort to use expression indexes. (check-in: [efaabdb7] user: drh branch: index-expr, size: 65735)
2015-06-26
18:16
[f89727c3] part of check-in [2abc44eb] Cache the sqlite3_context structure in the P4 operand of VDBE programs for faster SQL function dispatch. (check-in: [2abc44eb] user: drh branch: trunk, size: 65783)
2015-04-20
15:13
[d2379078] part of check-in [2f58c8c9] Fix a memory leak caused by duplicate entries in the sqlite_stat1 table. (check-in: [2f58c8c9] user: dan branch: trunk, size: 65780)
2015-01-01
23:02
[91540f83] part of check-in [2835e79a] Add logic to releasetest.tcl that detects -fsanitize=undefined errors. Fix a few false-positivies that come up when running the sanitize=undefined test. (check-in: [2835e79a] user: drh branch: trunk, size: 65540)
2014-12-05
21:04
[7a2986e6] part of check-in [c1ae1268] Fix a buffer overread that might occur in analyze.c if SQLITE_ENABLE_STAT4 was defined. (check-in: [c1ae1268] user: dan branch: trunk, size: 65530)
20:43
[614428e1] part of check-in [194c90db] Fix a buffer overread that might occur in analyze.c if SQLITE_ENABLE_STAT4 was defined. (check-in: [194c90db] user: dan branch: branch-3.8.7, size: 65284)
2014-11-22
21:37
[f7d77435] part of check-in [1e1221fc] Always reinitialized the Index.bUnordered and Index.noSkipscan flags before rereading the sqlite_stat1 table, even if SQLITE_ENABLE_STAT4 is defined. (check-in: [1e1221fc] user: drh branch: trunk, size: 65509)
2014-11-19
14:05
[c59f238a] part of check-in [9ed97a85] Add an ALWAYS on an always-true branch in wal.c. Fix the ANALYZE command so that it resets the "unordered" and "noskipscan" flags on indices when reloading the sqlite_stat1 table. (check-in: [9ed97a85] user: drh branch: trunk, size: 65470)
2014-11-15
19:08
[951fd859] part of check-in [00fe0950] Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. (check-in: [00fe0950] user: drh branch: noskipscan-token, size: 65418)
2014-10-22
19:57
[afbcca66] part of check-in [ca3b00c4] Change the 0x800 bit of SQLITE_TESTCTRL_OPTIMIZATIONS so that it disables the loading of STAT3 and STAT4 content, not just the using of that content. Change the internal name of that bit to SQLITE_Stat34. (check-in: [ca3b00c4] user: drh branch: trunk, size: 65334)
15:27
[567c94b7] part of check-in [3c933bf9] Take steps to avoid misestimating range query costs based on STAT4 data due to the roundoff error of converting from integers to LogEst and back to integers. (check-in: [3c933bf9] user: drh branch: trunk, size: 65292)
2014-10-06
18:33
[8c322e1e] part of check-in [80e1baa5] Remove unreachable branches in decodeIntArray() when compiling without STAT3 or STAT4. (check-in: [80e1baa5] user: drh branch: trunk, size: 65263)
2014-10-04
00:07
[ee85c504] part of check-in [efd87ba1] Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine has a chance to run. Since the aiRowEst now might be deleted from freeIndex() which does not always have a db pointer, make sure the aiRowEst memory is not held in lookaside. (check-in: [efd87ba1] user: drh branch: stat4-avgeq, size: 65244)
2014-10-03
19:29
[8d5a1389] part of check-in [f9c053b2] Fix a division-by-zero error that might occur if the sqlite_stat1 table is corrupt. (check-in: [f9c053b2] user: dan branch: stat4-avgeq, size: 65211)
19:16
[418c2fc2] part of check-in [e6f7f97d] Improve the accuracy of the estimates used when searching an index for values not present in any stat4 samples under some circumstances. (check-in: [e6f7f97d] user: dan branch: stat4-avgeq, size: 65182)
2014-09-19
20:13
[6290a109] part of check-in [3f3ca76a] Fix the affinity on inserts into the ANALYZE tables. Change the affinity characters to be upper case, to make the P5 parameter of comparison operators easier to read. (check-in: [3f3ca76a] user: drh branch: trunk, size: 64323)
2014-09-06
16:39
[79383a54] part of check-in [e62aab5e] Fix typos in comments. No code changes. (check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 64241)
2014-09-01
23:06
[f00f06e6] part of check-in [9779c7a9] Update comments in the ANALYZE command that describe how the Stat4Accum objecct is passed around within the VDBE. No changes to functional code. (check-in: [9779c7a9] user: drh branch: trunk, size: 64243)
22:34
[75345fa5] part of check-in [4cae93f8] Avoid a confusing (though correct) argument to the sqlite3_result_blob() function in the implementation of ANALYZE. (check-in: [4cae93f8] user: drh branch: trunk, size: 64036)
2014-08-04
15:12
[095daf23] part of check-in [2f724cba] Changed my mind: This opcode name changes mere creates unnecessary diff marks between older and newer versions without significantly improving readability. Was: Rename the IsNull opcode to IfNull and rename the NotNull opcode to IfNotNull. (check-in: [2f724cba] user: drh branch: deadend, size: 64037)
2014-07-31
22:59
[f98a3519] part of check-in [e75b26ee] Refactoring: Change "pIndex->onError!=OE_None" to use a macro: "IsUniqueIndex(pIndex)". Easier to understand that way. (check-in: [e75b26ee] user: drh branch: trunk, size: 64035)
2014-07-24
23:23
[de34a73b] part of check-in [114dcf33] Improve the performance of the ANALYZE command by taking advantage of UNIQUE constraints on indices. (check-in: [114dcf33] user: drh branch: trunk, size: 64038)
20:25
[9799a65d] part of check-in [85e2bade] Avoid trying to allocation zero bytes when analyzing a unique non-null index. (check-in: [85e2bade] user: drh branch: faster-analyze, size: 63847)
19:54
[45216a14] part of check-in [4690e99c] Avoid change tests when analyzing single-column unique indexes after getting past the initial NULL entries. (check-in: [4690e99c] user: drh branch: faster-analyze, size: 63838)
2014-07-23
23:57
[1c983101] part of check-in [729ece40] Add experimental "costmult" logic. Only enabled when compiled with -DSQLITE_ENABLE_COSTMULT. (check-in: [729ece40] user: drh branch: trunk, size: 62486)
19:37
[7f893416] part of check-in [30033f96] Ugh. Consecutive UNIQUE index entries are only distinct if the index is on NOT NULL columns. So the previous version was not quite right. This check-in fixes the problem. (check-in: [30033f96] user: drh branch: faster-analyze, size: 63422)
18:36
[c72bb669] part of check-in [3e1e79e1] Improve the performance of the ANALYZE command by taking advantage of the fact that every row of a UNIQUE index is distinct. (check-in: [3e1e79e1] user: drh branch: faster-analyze, size: 63427)
2014-07-22
22:46
[ab1e4415] part of check-in [48f40861] When running ANALYZE, it is not necessary to check the right-most key column for changes since that column will always change if none of the previous columns have. (check-in: [48f40861] user: drh branch: trunk, size: 62295)
14:58
[56799121] part of check-in [ca2a5a2c] Enhance the sqlite_stat1.stat parsing to allow additional text parameters at the end. Unrecognized parameters are silently ignored. (check-in: [ca2a5a2c] user: drh branch: trunk, size: 62289)
14:42
[9f4e473c] part of check-in [b083a961] Expire prepared statements after running ANALYZE. (check-in: [b083a961] user: drh branch: trunk, size: 62171)
2014-07-01
11:54
[61bc3467] part of check-in [21981e35] Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys. (check-in: [21981e35] user: dan branch: trunk, size: 62087)
2014-06-30
17:07
[ec6e0691] part of check-in [5d8628fd] Fix the STAT4 information for WITHOUT ROWID tables. (check-in: [5d8628fd] user: drh branch: stat4-without-rowid, size: 61694)
13:56
[0f9ee2f8] part of check-in [de826c31] Omit non-primary-key columns from the STAT4 samples for WITHOUT ROWID tables. Indexes, both rowid and without-rowid, still hold an exact copy of the index entry. (check-in: [de826c31] user: drh branch: stat4-without-rowid, size: 61289)
13:32
[b53dddb5] part of check-in [8cb43edd] Generate complete samples for sqlite_stat4 on WITHOUT ROWID tables. Ticket [b2fa5424e6fcb15b5] (check-in: [8cb43edd] user: drh branch: stat4-without-rowid, size: 61160)
2014-05-27
18:18
[e8c8a9d2] part of check-in [d16e575d] Change the name of the Index.autoIndex field to Index.idxType and provide symbolic names for the various values of that field rather than using magic numbers. (check-in: [d16e575d] user: drh branch: trunk, size: 61096)
2014-05-19
15:16
[0cca10e0] part of check-in [17349a49] Changes to help ensure that a multiplication does not overflow when computing the number of bytes needed for a memory allocation, and cause a malfunction. No problems existing problems were discovered. However, these changes should help to ensure that no problems arise in the future. (check-in: [17349a49] user: drh branch: safer-malloc, size: 61157)
2014-05-01
20:24
[3596f863] part of check-in [be2702ce] Add #ifdefs for test coverage. Add a testcase(). (check-in: [be2702ce] user: drh branch: trunk, size: 61091)
2014-04-25
15:01
[92f14953] part of check-in [1bd74c49] Store values loaded from the stat1 table as logarithmic values in memory. (check-in: [1bd74c49] user: dan branch: experimental-costs, size: 60986)
2014-03-06
13:38
[663e0b29] part of check-in [0a4200f9] Improved EXPLAIN indentation of a loop in the ANALYZE logic for STAT4. Mark the not-found jump of a seek operation in that loop as never taken. (check-in: [0a4200f9] user: drh branch: trunk, size: 60849)
2014-02-17
22:40
[69761e16] part of check-in [ce184c7b] Add logic to do test coverage measurements on the VDBE code. (check-in: [ce184c7b] user: drh branch: insert-optimization, size: 60641)
14:59
[3ec44440] part of check-in [35b4d6e9] Avoid unnecessary calls to applyAffinity() during INSERT and UPDATE operations, especially for table that have indices and tables for which all columns have affinity "NONE". (check-in: [35b4d6e9] user: drh branch: insert-optimization, size: 60517)
2013-11-13
15:32
[581d5c18] part of check-in [d3e6e9b2] Add test cases for skip-scan. Enhance "do_test" so that if the expected result is of the form "/*..*/" or "~/*..*/" it treats the expected result as a glob pattern rather than as a regular expression. Fix a bug in ANALYZE result loading associated with WITHOUT ROWID tables. (check-in: [d3e6e9b2] user: drh branch: skip-scan, size: 60530)
2013-11-06
19:59
[27f0c132] part of check-in [defd5205] Reference count the KeyInfo object. Cache a copy of an appropriate KeyInfo for each index in the Index object, and reuse that one copy as much as possible. (check-in: [defd5205] user: drh branch: omit-rowid, size: 60431)
2013-11-04
22:04
[f8092cb6] part of check-in [79befe3a] Add the index7.test script for testing partial indices with WITHOUT ROWID tables. Fix bugs in ANALYZE located by that script. (check-in: [79befe3a] user: drh branch: omit-rowid, size: 60567)
21:44
[0727d846] part of check-in [1ea43c0f] Bug fixes in the INSERT constraint checker. Refactor the Rowid handling logic for ANALYZE with STAT3/4. (check-in: [1ea43c0f] user: drh branch: omit-rowid, size: 60538)
2013-11-02
19:34
[b583d62c] part of check-in [4ee4d310] Change the "idx" name of the primary key index for WITHOUT ROWID tables in sqlite_statN statistics tables to be the name of the table rather than the fabricated index name (ex: sqlite_autoindex_xyz_1). This makes it consistent with sqlite_master table. (check-in: [4ee4d310] user: drh branch: omit-rowid, size: 60015)
18:46
[86f6a6cc] part of check-in [9075770e] Update the ANALYZE logic so that it works with WITHOUT ROWID tables. (check-in: [9075770e] user: drh branch: omit-rowid, size: 59374)
2013-10-25
14:46
[b6b115d6] part of check-in [9eafafa3] Basic DELETE operations now working on WITHOUT ROWID tables. (check-in: [9eafafa3] user: drh branch: omit-rowid, size: 56991)
2013-10-22
18:01
[ee880a4c] part of check-in [a106ce86] The Index object now has nKeyCol and nColumn. nColumn is the total number of columns and nKeyCol is the number of key columns. Currently these always differ by one. Refactor aiColumn[] to be of type i16 instead of int. (check-in: [a106ce86] user: drh branch: omit-rowid, size: 57038)
2013-10-14
14:21
[f1c5ed1f] part of check-in [e06f74d3] Corrects to comments on the STAT4 implementation. (check-in: [e06f74d3] user: drh branch: trunk, size: 57038)
13:21
[c6259f93] part of check-in [1660efbe] Make subroutines sampleCopy() and valueFromExpr() have file scope. (check-in: [1660efbe] user: drh branch: trunk, size: 57072)
2013-10-11
15:05
[f9e4eec9] part of check-in [7df06684] Fix various harmless compiler warnings. Change the "warnings.sh" script to work with STAT4 instead of STAT3. (check-in: [7df06684] user: drh branch: trunk, size: 57065)
2013-10-09
19:07
[4383cd3c] part of check-in [e97d7d30] Make sure the correct printf format is used for type tRowcnt regardless of whether 32-bit or 64-bit row counts are specified at compile-time. (check-in: [e97d7d30] user: drh branch: row-size-est, size: 56802)
2013-10-08
23:16
[bc391d7c] part of check-in [f7cc30d4] Move a conditional inside of an #ifdef in order to make all branches reachable regardless of compile-time options used. (check-in: [f7cc30d4] user: drh branch: row-size-est, size: 56792)
2013-10-07
16:53
[3994309c] part of check-in [8e78557a] Try to remember statistics from ANALYZE using LogEst instead of u64. (check-in: [8e78557a] user: drh branch: log-stats, size: 56805)
2013-10-06
22:12
[c27da557] part of check-in [e9e932aa] Accept the sz=N parameter on table-only lines of sqlite_stat1. (check-in: [e9e932aa] user: drh branch: row-size-est, size: 56716)
2013-10-05
19:18
[9f71f387] part of check-in [8b4aa0c7] Completely remove the iScanRatio field. The PRAGMA index_list(TABLE) command shows the estimated row size in the forth column. It also generates a row for the table with an index name of NULL. The query planner still does not take row size estimates into account - that is the next step. (check-in: [8b4aa0c7] user: drh branch: row-size-est, size: 56608)
2013-10-04
18:29
[c692855a] part of check-in [e5d9371d] Further refinements of the index scanning speed logic. (check-in: [e5d9371d] user: drh branch: index-scan-rate, size: 56732)
02:36
[6aa46f04] part of check-in [6c352edb] Progress toward using the iScanRatio information on indices. Many tests are still failing. (check-in: [6c352edb] user: drh branch: index-scan-rate, size: 56872)
2013-10-03
19:21
[41caf5d0] part of check-in [d59d97b0] Experimental branch allowing different postulated scan rates for each index. (check-in: [d59d97b0] user: drh branch: index-scan-rate, size: 56787)
2013-09-10
01:41
[d322972a] part of check-in [48ed8b56] 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. (check-in: [48ed8b56] user: drh branch: trunk, size: 56369)
2013-09-06
13:10
[7da9d6a0] part of check-in [97b10e66] Combine the FuncDef.iPrefEnc and FuncDef.flags fields into a single new FuncDef.funcFlags field. (check-in: [97b10e66] user: drh branch: trunk, size: 56349)
2013-09-04
04:04
[3f1c87b0] part of check-in [8df95bb0] Fix out-of-order variable declaration. Fix harmless compiler warning. (check-in: [8df95bb0] user: mistachkin branch: trunk, size: 56439)
02:07
[a4924848] part of check-in [a48948a1] Conditionally exclude code from analyze.c that is not used by STAT3. (check-in: [a48948a1] user: drh branch: trunk, size: 56405)
2013-09-03
14:43
[51e6e5d5] part of check-in [d59f5809] Fix another problem in stat4 sample selection. (check-in: [d59f5809] user: dan branch: trunk, size: 56371)
2013-09-02
18:58
[66903e3e] part of check-in [0a702c4b] Further stat4 related tests. (check-in: [0a702c4b] user: dan branch: trunk, size: 55487)
2013-08-30
20:19
[128f85d9] part of check-in [5bbd2ccb] Fix compiler warnings in analyze.c. (check-in: [5bbd2ccb] user: dan branch: trunk, size: 55279)
19:59
[be10d326] part of check-in [dbc31750] Fix comment typo in analyze.c. No changes to code. (check-in: [dbc31750] user: mistachkin branch: trunk, size: 55268)
2013-08-28
11:43
[7f869a25] part of check-in [b5ccf6e9] Label a certain branch as NEVER() only for non-STAT3/4 builds. (check-in: [b5ccf6e9] user: drh branch: trunk, size: 55265)
2013-08-27
23:15
[fa1a9eee] part of check-in [67a9a392] 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. (check-in: [67a9a392] user: drh branch: trunk, size: 55195)
20:16
[f1dbc79c] part of check-in [9d1424c9] Reduce the amount of code run and memory used for ANALYZE in the common case where neither STAT3 and STAT4 are enabled. (check-in: [9d1424c9] user: drh branch: trunk, size: 55121)
14:14
[ce2a3385] part of check-in [959bb5ac] In the ANALYZE command implementation make statInit() a 2-value function since the 3rd parameter was always the same constant. (check-in: [959bb5ac] user: drh branch: trunk, size: 54145)
2013-08-17
18:57
[10a4f1cd] part of check-in [f86b75b6] 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. (check-in: [f86b75b6] user: drh branch: sqlite_stat4, size: 54268)
2013-08-16
14:09
[30dd8962] part of check-in [9f85b6a5] Avoid buffer overreads and false OOM error reports that could be caused by corrupted sample records in the sqlite_stat4 table. (check-in: [9f85b6a5] user: dan branch: sqlite_stat4, size: 53812)
13:34
[0427f9ea] part of check-in [01187978] Fix a potential segfault following an OOM while running ANALYZE. (check-in: [01187978] user: drh branch: sqlite_stat4, size: 53389)
2013-08-15
19:56
[9533c7e9] part of check-in [d51df8a8] Fix a crash that can occur if the sqlite_stat3 or sqlite_stat4 table is corrupt. (check-in: [d51df8a8] user: dan branch: sqlite_stat4, size: 53358)
16:15
[e60d6329] part of check-in [46fec9b1] Make sure the ANALYZE command allocates enough VDBE registers. (check-in: [46fec9b1] user: drh branch: sqlite_stat4, size: 53376)
14:39
[f7494349] part of check-in [1fb4d9d6] Add tests for sqlite_stat4 sample selection. And a fix for the same. (check-in: [1fb4d9d6] user: dan branch: sqlite_stat4, size: 53379)
2013-08-14
19:54
[37b78257] part of check-in [bdce612b] Change the way ANALYZE works to use a single cursor when scanning indices. (check-in: [bdce612b] user: dan branch: sqlite_stat4, size: 53161)
2013-08-12
20:14
[cbd13a1b] part of check-in [cca8bf43] If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4. (check-in: [cca8bf43] user: dan branch: sqlite_stat4, size: 54815)
17:31
[c020f2ff] part of check-in [2a417367] If there is data in both the sqlite_stat4 and sqlite_stat3 tables for a single index, ignore the sqlite_stat3 records. (check-in: [2a417367] user: dan branch: sqlite_stat4, size: 54949)
17:00
[cfbf5b63] part of check-in [fa1588ad] Handle a NULL input to decodeIntArray() that can result from a prior OOM. (check-in: [fa1588ad] user: drh branch: sqlite_stat4, size: 54570)
16:34
[e5ce42f0] part of check-in [6d45078e] Re-enable reading from the sqlite_stat3 table (as well as sqlite_stat4). (check-in: [6d45078e] user: dan branch: sqlite_stat4, size: 54547)
11:21
[fd1bcb9b] part of check-in [ec3ffb17] Fix a bug in calculating the average number of entries for keys not present in the sqlite_stat4 table. (check-in: [ec3ffb17] user: dan branch: sqlite_stat4, size: 51095)
09:29
[49729c11] part of check-in [088d1ff9] Fix minor problems caused by adding the rowid to the records in stat4. (check-in: [088d1ff9] user: dan branch: sqlite_stat4, size: 50520)
2013-08-10
19:08
[178c33a7] part of check-in [3a5e8ab7] Add the rowid field to the end of sample records stored in the sqlite_stat4 table. (check-in: [3a5e8ab7] user: dan branch: sqlite_stat4, size: 50509)
2013-08-09
19:04
[aba0749f] part of check-in [5bcccb93] Fix a couple of typos in a comment in analyze.c. No code changes. (check-in: [5bcccb93] user: dan branch: sqlite_stat4, size: 49040)
14:07
[9fced5c1] part of check-in [4d97809d] Update the header comment on analyze.c to describe the sqlite_stat4 table format. (check-in: [4d97809d] user: drh branch: sqlite_stat4, size: 49036)
2013-08-07
19:46
[0f54320f] part of check-in [7b70b419] Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq. (check-in: [7b70b419] user: dan branch: sqlite_stat4, size: 47808)
16:38
[fcc42c3a] part of check-in [812ed0c5] Fix typos in a comment in analyze.c. No code changes. (check-in: [812ed0c5] user: dan branch: sqlite_stat4, size: 47621)
16:15
[8dfc6a70] part of check-in [13ed5ac1] Change the way samples for the sqlite_stat4 table are collected. (check-in: [13ed5ac1] user: dan branch: sqlite_stat4, size: 47487)
2013-08-06
20:15
[b8b0d153] part of check-in [84999e27] Fixes for builds without SQLITE_ENABLE_STAT4. (check-in: [84999e27] user: dan branch: sqlite_stat4, size: 47137)
2013-08-05
19:04
[726a63b1] part of check-in [4a51cf28] Modify the vdbe code generated by ANALYZE to use fewer memory cells and cursor slots. (check-in: [4a51cf28] user: dan branch: sqlite_stat4, size: 47103)
18:00
[a0979f7f] part of check-in [3a71afe6] 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. (check-in: [3a71afe6] user: dan branch: sqlite_stat4, size: 48002)
05:34
[b9fb000c] part of check-in [badd24d9] Fix a couple of problems in code related to sqlite_stat4. (check-in: [badd24d9] user: dan branch: sqlite_stat4, size: 47206)
2013-08-03
20:24
[7c272ae2] part of check-in [2beea303] Begin adding experimental sqlite_stat4 table. This commit is buggy. (check-in: [2beea303] user: dan branch: sqlite_stat4, size: 46994)
2013-08-01
04:39
[a33fcb0b] part of check-in [60353124] Fix the ANALYZE command to work with partial indices. (check-in: [60353124] user: drh branch: partial-indices, size: 40034)
2013-05-28
12:11
[27e541b9] part of check-in [a0d5cc93] Many small harmless comment changes. Removal of obsolete comments and fixing misspelled words. No changes to code. (check-in: [a0d5cc93] user: drh branch: trunk, size: 39849)
2013-03-01
01:07
[d5f89581] part of check-in [d7343558] 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. (check-in: [d7343558] user: drh branch: trunk, size: 39849)
2012-08-06
18:50
[7553068d] part of check-in [d045f8b2] 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. (check-in: [d045f8b2] user: dan branch: sorter-coalesce-writes, size: 39843)
2012-07-30
14:53
[a4790912] part of check-in [305b6667] Replace a few sqlite3_malloc()+memset() sequences with calls to sqlite3MallocZero(). (check-in: [305b6667] user: dan branch: trunk, size: 39830)
2012-07-18
16:07
[1f05d25f] part of check-in [defd828e] Remove another branch from the DbMalloc() paths. (check-in: [defd828e] user: dan branch: calloc, size: 39812)
2012-03-19
10:21
[70c46504] part of check-in [32bb1ece] Ensure that compatible malloc and free functions are used with stat3 data if SQLITE_ENABLE_STAT3 is defined. (check-in: [32bb1ece] user: dan branch: trunk, size: 39846)
2011-12-11
02:30
[f32ff304] part of check-in [d11a5798] Fix STAT3 so that it works with the new uninitialized register logic of the VDBE. Ticket [7bbfb7d4422ff] (check-in: [d11a5798] user: drh branch: trunk, size: 39664)
2011-10-21
19:06
[5a1db16a] part of check-in [aed2bf7a] Purge lingering references to SQLITE_STAT2 from the code and test scripts. (check-in: [aed2bf7a] user: drh branch: trunk, size: 39605)
2011-10-07
23:52
[682fd999] part of check-in [589f3f56] 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. (check-in: [589f3f56] user: drh branch: trunk, size: 39605)
2011-09-23
13:25
[775421ce] part of check-in [74e27fad] Fix typos in the format description comment of analyze.c. (check-in: [74e27fad] user: drh branch: stat3-trunk, size: 40008)
2011-09-22
20:52
[f2b6e33f] part of check-in [374343c8] Remove the restriction on the number of entries per index in sqlite_stat3. (check-in: [374343c8] user: drh branch: stat3-trunk, size: 40004)
18:46
[12c096a7] part of check-in [3ca7e449] 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. (check-in: [3ca7e449] user: drh branch: stat3-trunk, size: 40070)
00:28
[78a513d6] part of check-in [ee110d5a] Fix an uninitialized variable and a misuse of memcpy(). (check-in: [ee110d5a] user: drh branch: stat3-trunk, size: 40043)
2011-09-21
00:09
[002e0854] part of check-in [63fc3e4b] Pull in the latest changes from trunk. Update the STAT3 documentation. (check-in: [63fc3e4b] user: drh branch: stat3-trunk, size: 40040)
2011-08-26
15:51
[46536438] part of check-in [01cc4ff6] Get stat3 working after import from trunk-based the stat3-enhancement branch. There is still a problem in the wal2 test. (check-in: [01cc4ff6] user: drh branch: stat3-3.7.2, size: 39124)
13:52
[107333cc] part of check-in [0df04f92] Merge branches branch-3.7.2 and stat3-enhancement into a new branch for testing purposes. (check-in: [0df04f92] user: drh branch: stat3-3.7.2, size: 38596)
2011-08-18
13:45
[3fbffcfb] part of check-in [eaf447ea] Fix the stat3 analysis loader to be compatible with sqlite3_db_status(). Also fix some OOM issues with the stat3 analysis loader. (check-in: [eaf447ea] user: drh branch: stat3-enhancement, size: 39268)
01:10
[6beb1c0a] part of check-in [b26ec79c] Fix an error with OOM processing in the ANALYZE logic. (check-in: [b26ec79c] user: drh branch: stat3-enhancement, size: 39204)
2011-08-16
17:06
[f436b0f5] part of check-in [3d68f9af] Fix a few harmless compiler warnings. Add SQLITE_ENABLE_STAT3 to the standard compiler warning script. (check-in: [3d68f9af] user: drh branch: stat3-enhancement, size: 39213)
2011-08-15
12:02
[8a41063d] part of check-in [ae31dc67] Fix a couple of typos in comments in analyze.c. (check-in: [ae31dc67] user: dan branch: stat3-enhancement, size: 39108)
2011-08-13
19:35
[c04d95f4] part of check-in [89b2f708] 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. (check-in: [89b2f708] user: drh branch: stat3-enhancement, size: 39108)
15:25
[6901cc6e] part of check-in [1dcd2428] Add the sqlite_stat3.nDLT field. Use an linear congruence PRNG to choose which samples to select from among those with the same nEq field. (check-in: [1dcd2428] user: drh branch: stat3-enhancement, size: 38667)
00:58
[31a1ea5a] part of check-in [8225924e] The ANALYZE command picks for 15 samples for sqlite_stat3 with the largest nEq fields, plus 5 other evenly spaced samples. (check-in: [8225924e] user: drh branch: stat3-enhancement, size: 37874)
2011-08-12
01:51
[da6661db] part of check-in [52e1d7e8] Begin a branch that experimentally replaces sqlite_stat2 with a new table called sqlite_stat3 that will hopefully facilitate better query planning decisions. (check-in: [52e1d7e8] user: drh branch: stat3-enhancement, size: 32030)
2011-08-08
17:18
[dcdbff4a] part of check-in [d1248165] Add code to actually use the sqlite_stat2.cnt field in the query planner. This changes some plans resulting in a few failures in analyze5.test. (check-in: [d1248165] user: drh branch: query-planner-tweaks, size: 32186)
2011-08-07
00:21
[ab43a0de] part of check-in [794fde6f] The ANALYZE command adds the sqlite_stat2.cnt column if it does not already exist. (check-in: [794fde6f] user: drh branch: query-planner-tweaks, size: 32111)
2011-08-06
19:48
[8a5343a2] part of check-in [6d1e2372] The sqlite_stat2.cnt field is parsed if it is present. But it is not yet used. A large comment added to analyze.c to explain the format of the ANALYZE system tables. (check-in: [6d1e2372] user: drh branch: query-planner-tweaks, size: 31792)
02:03
[19894783] part of check-in [2daab6bd] Merge together the fork in the query-planner-tweaks branch. (check-in: [2daab6bd] user: drh branch: query-planner-tweaks, size: 26169)
01:22
[b1df43e5] part of check-in [7e914aa9] Fix a compiler warning when STAT2 is off. More test cases. Fix legacy tests to deal with the new STAT2 logic. (check-in: [7e914aa9] user: drh branch: query-planner-tweaks, size: 26302)
2011-08-05
22:31
[533077e1] part of check-in [e93c248c] Bug fixes to the sample-count logic for STAT2. A few test cases added. (check-in: [e93c248c] user: drh branch: query-planner-tweaks, size: 26302)
21:13
[dcac3850] part of check-in [eb434228] Add a column to the sqlite_stat2 table that contains the number of entries with exactly the same key as the sample. We do not yet do anything with this extra value. Some tests in analyze2.test are failing. (check-in: [eb434228] user: drh branch: query-planner-tweaks, size: 26292)
01:09
[ddc492c1] part of check-in [b9d41c34] Allow the sqlite_stat2 table to contain a number of samples other than the default of 10. (check-in: [b9d41c34] user: drh branch: query-planner-tweaks, size: 25132)
2011-04-09
03:20
[a425d62e] part of check-in [8a42e236] If the keyword "unordered" appears at the end of the SQLITE_STAT1.STAT column for an index, then use that index for equality lookups only, never for range queries or sorting. This feature is currently undocumented and my change or be removed in a future release. (check-in: [8a42e236] user: drh branch: trunk, size: 25265)
2011-04-04
18:22
[a1ad9f4d] part of check-in [ae8374af] Add a description of access rules for the Schema object and lots of asserts to verify that the access rules are followed. (check-in: [ae8374af] user: drh branch: schema-parse-refactor, size: 25175)
2011-04-01
14:26
[d0a673d3] part of check-in [7e237aea] Merge the ANALYZE-index enhancement into trunk. (check-in: [7e237aea] user: drh branch: trunk, size: 25085)
02:26
[6b536214] part of check-in [e3bf2d5c] Fix two compiler errors associated with non-standard compile-time options. (check-in: [e3bf2d5c] user: drh branch: trunk, size: 24435)
01:38
[b3a3d2e6] part of check-in [4dc148bb] Fix a compiler warning and an unreachable branch. Restore 100% branch test coverage. (check-in: [4dc148bb] user: drh branch: trunk, size: 24378)
2011-03-31
02:03
[ecc36fc1] part of check-in [c8f9edd9] Change the ANALYZE command so that it will accept an index name as its argument and only reanalyze that one index. A quick smoke-test works. Need to study the implications to the query planner and test corner cases. (check-in: [c8f9edd9] user: drh branch: analyze-idx, size: 25095)
2011-03-30
14:54
[cafa5a22] part of check-in [3a27af5b] Do not generate sqlite_stat1 entries for empty tables when running ANALYZE. Ticket [83ea97620bd31016451] (check-in: [3a27af5b] user: drh branch: trunk, size: 24445)
2011-03-29
15:00
[0a58e3d8] part of check-in [3b964155] If the keyword "unordered" appears at the end of the SQLITE_STAT1.STAT column for an index, then use that index for equality lookups only, never for range queries or sorting. (check-in: [3b964155] user: drh branch: unordered-index-hack, size: 24517)
2011-01-24
19:14
[a0381623] part of check-in [a1ad7fb3] Fix a harmless compiler warning (a shadowed local variable) in analyze.c. (check-in: [a1ad7fb3] user: drh branch: trunk, size: 24427)
2011-01-04
20:06
[3af3fdb5] part of check-in [73128d4e] Fix a null-pointer dereference that can occur on an OOM error while running ANALYZE with SQLITE_ENABLE_STAT2. (check-in: [73128d4e] user: drh branch: trunk, size: 24424)
19:01
[a2257126] part of check-in [a5867cfc] Fix the ANALYZE command so that it takes collating sequences into account when gathering index statistics. (check-in: [a5867cfc] user: drh branch: trunk, size: 24324)
17:57
[62ccd3a4] part of check-in [824c8dd3] The ANALYZE command now counts at all rows of an index, even those containing NULL values. A valid sqlite_stat1 entry is created even if the index contains nothing but NULLs. (check-in: [824c8dd3] user: drh branch: trunk, size: 24172)
2010-09-28
17:34
[1ea594a9] part of check-in [b7a26427] Get ANALYZE working again with -DSQLITE_ENABLE_STAT2 and virtual tables. (check-in: [b7a26427] user: drh branch: trunk, size: 23913)
14:26
[041ebe72] part of check-in [7be03ecc] Fix several harmless compiler warnings. (check-in: [7be03ecc] user: drh branch: trunk, size: 23895)
2010-09-25
22:32
[df69779a] part of check-in [a7645d29] Enhance the ANALYZE command so that it gathers statistics in the sqlite_stat1 table even for tables that are empty or have no indices. (check-in: [a7645d29] user: drh branch: trunk, size: 23895)
2010-08-17
19:40
[da65ce99] part of check-in [3f8c068a] Suppress harmless compiler warning. (check-in: [3f8c068a] user: drh branch: trunk, size: 22489)
2010-07-26
11:07
[3642ebcd] part of check-in [629e38a8] Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). (check-in: [629e38a8] user: drh branch: experimental, size: 22465)
2010-07-25
02:12
[c949a108] part of check-in [da2f62c5] Further examples of using automatic deallocation to replace "delete" methods. (check-in: [da2f62c5] user: drh branch: malloc-enhancement, size: 22157)
2010-07-24
16:34
[c1bcd04b] part of check-in [ac1f37a6] Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). (check-in: [ac1f37a6] user: drh branch: malloc-enhancement, size: 22503)
11:28
[6c2bdb1d] part of check-in [9aa30342] Experimental code to measure memory consumed by database schemas and prepared statements. (check-in: [9aa30342] user: dan branch: experimental, size: 22518)
2010-07-23
15:41
[4ffed15a] part of check-in [6eddc6e6] Remove the Table.dbMem variable, as it is no longer being used for its original purpose. (check-in: [6eddc6e6] user: dan branch: trunk, size: 22495)
2010-06-02
05:53
[3457a2af] part of check-in [e7073e23] Add some 'const' markers to static data that is really constant. (check-in: [e7073e23] user: dan branch: trunk, size: 22642)
2010-03-26
01:54
[8dfd781a] part of check-in [c33b38b5] Fix OOM error on ANALYZE with STAT2 enabled with zero-length data. Ticket [cbd054fa6b]. (check-in: [c33b38b5] user: shaneh branch: trunk, size: 22636)
2010-02-23
17:36
[92a65a5a] part of check-in [7c4cca6d] Remove the obsolete sqlite3SafetyOn() mechanism. Add additional logging output for CORRUPT, and CANTOPEN errors. (check-in: [7c4cca6d] user: drh branch: trunk, size: 22517)
2009-11-10
01:30
[55155f05] part of check-in [f6c045f6] Remove the obsolete "$Id:$" RCS identifier strings from the source code. (check-in: [f6c045f6] user: drh branch: trunk, size: 22714)
2009-09-07
04:38
[5a8b8aa3] part of check-in [26cd015c] Warning cleanup from the MSVC compile. (check-in: [26cd015c] user: shane branch: trunk, size: 22777)
2009-08-20
23:05
[4584556d] part of check-in [d30ceeb8] Remove a redundant OOM test from the sqlite_stat2 analysis loader. (check-in: [d30ceeb8] user: drh branch: trunk, size: 22738)
16:11
[e3ad83c1] part of check-in [cbfe6e9d] Change the code that collects samples for sqlite_stat2 so that the first sample taken is the (nRow/(2*SQLITE_INDEX_SAMPLES))th entry in the index, where nRow is the total number of index entries. (check-in: [cbfe6e9d] user: dan branch: trunk, size: 22720)
2009-08-19
16:34
[b62fc66f] part of check-in [14a715c5] Fix an assert() failure that may follow an OOM error. (check-in: [14a715c5] user: dan branch: trunk, size: 22442)
14:34
[98594913] part of check-in [aa728e06] Clean up sqlite_stat2 related code. Add test cases. (check-in: [aa728e06] user: dan branch: trunk, size: 22080)
09:09
[3213d61e] part of check-in [67207a15] Fix a problem where a buffer allocated from a lookaside pool was being released using the system free(). (check-in: [67207a15] user: dan branch: trunk, size: 21028)
08:18
[1a5bf2ad] part of check-in [362665e8] Add the SQLITE_ENABLE_STAT2 macro. If this is not defined at build-time, the stat2 table is not created, populated, or used. (check-in: [362665e8] user: dan branch: trunk, size: 20891)
2009-08-18
16:24
[7f086e4d] part of check-in [ded9dec6] Change the sqlite_stat2 schema to be more flexible. (check-in: [ded9dec6] user: dan branch: trunk, size: 19842)
2009-08-17
17:06
[c3f1ea34] part of check-in [dd96bda2] First version of sqlite_stat2 (schema forces exactly 10 samples). (check-in: [dd96bda2] user: dan branch: trunk, size: 17942)
2009-04-16
17:45
[e239496c] part of check-in [fbbc80ea] Add NEVER and ALWAYS tags to conditionals in analyze.c that always false or true. (CVS 6515) (check-in: [fbbc80ea] user: drh branch: trunk, size: 14290)
2009-02-28
10:47
[3585d1a4] part of check-in [3befe1ef] Instead of linking temporary triggers on non-temporary tables into the Table.pTrigger list, search the temp schema for them on demand. Fix for #3688. (CVS 6329) (check-in: [3befe1ef] user: danielk1977 branch: trunk, size: 14268)
2009-02-20
10:58
[9fc52fed] part of check-in [e43ed649] Instead of using SetNumColumns, specify the number of columns in a table or index using the P4 argument. (CVS 6310) (check-in: [e43ed649] user: danielk1977 branch: trunk, size: 14268)
2009-02-19
14:39
[2ca143d8] part of check-in [d9f6ffbc] Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305) (check-in: [d9f6ffbc] user: danielk1977 branch: trunk, size: 14320)
2009-02-13
16:59
[fc605682] part of check-in [88a6355c] Make sure OOM errors in the ANALYSIS loader get reported back out to high-level layers. Strange behavior can result otherwise. (CVS 6292) (check-in: [88a6355c] user: drh branch: trunk, size: 14310)
2008-12-10
16:45
[c86fd6a1] part of check-in [da1cbfa7] Add explicit casts to silence nuisance warnings from VC++. (CVS 6004) (check-in: [da1cbfa7] user: drh branch: trunk, size: 14200)
2008-11-19
16:52
[301a1358] part of check-in [d1abe8a1] Fix some compiler warnings that show up when building the amalgamation only. (CVS 5927) (check-in: [d1abe8a1] user: danielk1977 branch: trunk, size: 14209)
09:05
[0c69f21c] part of check-in [88134322] Changes to avoid "unused parameter" compiler warnings. (CVS 5921) (check-in: [88134322] user: danielk1977 branch: trunk, size: 14202)
2008-11-03
20:55
[91b95843] part of check-in [fdb98fd8] Change the name of the Cursor object to VdbeCursor. (CVS 5857) (check-in: [fdb98fd8] user: drh branch: trunk, size: 14166)
2008-07-28
19:34
[747ce8cb] part of check-in [e48f9697] Implement the "lookaside" memory allocation cache. Use of this cache makes the speed1.test script run about 15% faster. Added new interfaces to control the cache. (CVS 5488) (check-in: [e48f9697] user: drh branch: trunk, size: 14150)
2008-03-25
09:47
[9ee63497] part of check-in [04715364] Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912) (check-in: [04715364] user: danielk1977 branch: trunk, size: 14143)
2008-01-25
15:04
[a78ac494] part of check-in [50815a82] Error messages says "no such view" instead of "no such table" when trying to DROP a VIEW that does not exist. (CVS 4750) (check-in: [50815a82] user: drh branch: trunk, size: 14148)
2008-01-23
03:03
[13d64eeb] part of check-in [5375ad6b] Make sqlite3SafetyOn() and sqlite3SafetyOff() macros which disappear when compiling without -DSQLITE_DEBUG=1. (CVS 4744) (check-in: [5375ad6b] user: drh branch: trunk, size: 14142)
2008-01-17
02:36
[ac17da1f] part of check-in [b3a141b2] Registerification of the WHERE clause logic. (CVS 4716) (check-in: [b3a141b2] user: drh branch: trunk, size: 14130)
2008-01-12
12:48
[5aa93f19] part of check-in [a6dddebc] Continuing work toward converting the VM into a register machine. (CVS 4707) (check-in: [a6dddebc] user: drh branch: trunk, size: 14130)
2008-01-10
23:50
[52cbc357] part of check-in [8cbd4651] More work toward converting the VM into a register-based machine. (CVS 4704) (check-in: [8cbd4651] user: drh branch: trunk, size: 14085)
2008-01-09
23:04
[6cd38a98] part of check-in [e3cf1c1c] All essential opcodes can now operate out of registers and completely avoid the stack. Many still optionally use the stack to support legacy code generation, but the stack is not required. The next step is to update all code generation to avoid using the stack. (CVS 4700) (check-in: [e3cf1c1c] user: drh branch: trunk, size: 13503)
2008-01-08
23:54
[6327934f] part of check-in [8862ce9c] Registerify the comparison opcodes. (CVS 4697) (check-in: [8862ce9c] user: drh branch: trunk, size: 13446)
2008-01-05
16:29
[96e12e03] part of check-in [66396d2f] Registerify binary operators. Add register tracing to debugging output. (CVS 4686) (check-in: [66396d2f] user: drh branch: trunk, size: 13411)
05:20
[d80f65d2] part of check-in [3e8a07dd] Register-ify the OP_AddImm and all casting opcodes. Omit the OP_MemIncr opcode. (CVS 4683) (check-in: [3e8a07dd] user: drh branch: trunk, size: 13542)
04:06
[4e24deee] part of check-in [cc149eb9] Get rid of OP_Dup, OP_MemStore, OP_MemLoad, and OP_MemMove. Replace with OP_Copy, OP_SCopy, and OP_Move. Add the infrastructure for operation properties in1, in2, in3, out2, and out3 but do not yet use any of these. (CVS 4682) (check-in: [cc149eb9] user: drh branch: trunk, size: 13541)
2008-01-04
22:01
[117e6009] part of check-in [fe057a88] Implement the out2-prerelease opcode design pattern. (CVS 4681) (check-in: [fe057a88] user: drh branch: trunk, size: 13595)
2008-01-03
18:03
[addc8e75] part of check-in [0b849805] Registers (aka memory cells) in the VM are now numbered starting with 1 instead of 0. A register number of 0 means "no such register". (CVS 4669) (check-in: [0b849805] user: drh branch: trunk, size: 13597)
09:51
[d7b4dace] part of check-in [46501f49] Change the OP_Insert opcode to read the key and data to insert from memory cells, not the stack. (CVS 4666) (check-in: [46501f49] user: danielk1977 branch: trunk, size: 13601)
07:54
[1fb7ada6] part of check-in [35da261d] Change OP_OpenRead and OP_OpenWrite so that the database number is read from the P3 operand, not the stack. (CVS 4663) (check-in: [35da261d] user: danielk1977 branch: trunk, size: 13607)
00:01
[09e55b6b] part of check-in [027875e4] Refactoring the VM. The P3 parameter is changed to P4. A P5 parameter is added (though not currently used.) Add routines sqlite3VdbeAddOpX() where X is one of 0, 1, 2, 3, or 4. (CVS 4660) (check-in: [027875e4] user: drh branch: trunk, size: 13676)
2008-01-02
14:28
[40806c79] part of check-in [4c7f35da] Add opcodes OP_ResultRow and OP_RegMakeRec which are register-based equivalents to OP_Callback and OP_MakeRecord. Use the new opcodes. (CVS 4656) (check-in: [4c7f35da] user: drh branch: trunk, size: 13681)
00:34
[cb25936f] part of check-in [051ec01f] Begin setting a foundation on which to convert the VM from a stack-based to a register-based machine. Everything is still mostly stack based with this check-in. This change merely begins adding infrastructure to support a register-based architecture. (CVS 4652) (check-in: [051ec01f] user: drh branch: trunk, size: 13681)
2007-11-15
13:10
[fd1a3d75] part of check-in [d05eb67d] Fix a segfault that can occur after a malloc failure in an ANALYZE statement. Ticket #2772. (CVS 4544) (check-in: [d05eb67d] user: danielk1977 branch: trunk, size: 13691)
2007-08-29
17:43
[49b4bd45] part of check-in [2732af0e] Improvements to mutex asserts. The quick test runs to completion without assertion faults. (CVS 4324) (check-in: [2732af0e] user: drh branch: trunk, size: 13650)
04:00
[a28b43a5] part of check-in [e8060f85] Better asserts(). But now some of the tests are busted again. (CVS 4320) (check-in: [e8060f85] user: drh branch: trunk, size: 13573)
2007-08-16
10:09
[a14237d8] part of check-in [77b16713] More work on refactoring of malloc() interfaces. There are still many errors. (CVS 4233) (check-in: [77b16713] user: danielk1977 branch: trunk, size: 13298)
04:30
[e2bbd251] part of check-in [deb7ecd6] Half-way through a major refactoring of the memory allocation. I have not even attempted to compile so I am certain there are countless errors. (CVS 4231) (check-in: [deb7ecd6] user: drh branch: trunk, size: 13286)
2007-06-20
13:37
[8d345472] part of check-in [df9957b9] Fix comment typo in analyze.c. Ticket #2434. (CVS 4101) (check-in: [df9957b9] user: drh branch: trunk, size: 13272)
2007-05-12
12:08
[e8fcb1c3] part of check-in [c08658e1] Make the ANALYZE command robust in the face of malloc() failures. (CVS 3989) (check-in: [c08658e1] user: drh branch: trunk, size: 13272)
2007-03-29
05:51
[4bbf5ddf] part of check-in [ad4a6b1a] Change BtreeMoveto so that it can be biased to the right or to the center. Use a right bias when appending and a center bias when searching. This gives about a 15% reduction in calls to sqlite3VdbeRecordCompare. (CVS 3741) (check-in: [ad4a6b1a] user: drh branch: trunk, size: 13153)
2006-01-10
17:58
[7d2b7ab9] part of check-in [0f0213be] Store collation sequence names instead of pointers in sharable schema data structures. (CVS 2904) (check-in: [0f0213be] user: danielk1977 branch: trunk, size: 13149)
2006-01-09
06:29
[ed87abad] part of check-in [82b81f69] Rename DbSchema to "Schema" and SqliteTsd to "ThreadData". (CVS 2893) (check-in: [82b81f69] user: danielk1977 branch: trunk, size: 13107)
2006-01-08
18:10
[fd2fe03b] part of check-in [b2ac0be0] Get LIMIT and OFFSET working again for negative limits and offsets. Ticket #1586. (CVS 2889) (check-in: [b2ac0be0] user: drh branch: trunk, size: 13101)
2006-01-07
13:21
[82e334a1] part of check-in [23b587b0] In shared-cache mode, lock all required tables before beginning to execute the body of the statement program. (CVS 2881) (check-in: [23b587b0] user: danielk1977 branch: trunk, size: 13109)
2006-01-05
11:34
[d821684c] part of check-in [deeda0dc] Add the shared schema/pager modifications. Very few tests so far. (CVS 2859) (check-in: [deeda0dc] user: danielk1977 branch: trunk, size: 12648)
2005-11-14
22:29
[ea42005e] part of check-in [ce06c123] Create separate affinities for INTEGER and REAL. (CVS 2766) (check-in: [ce06c123] user: drh branch: trunk, size: 12332)
2005-11-01
15:48
[2afd437e] part of check-in [e0d6f61c] Omit the SQLITE_AFF_INTEGER type affinity. All numeric values are now of type real, though an integer representation is still sometimes used internally for efficiency. (CVS 2753) (check-in: [e0d6f61c] user: drh branch: trunk, size: 12332)
2005-09-20
17:42
[21a4cd12] part of check-in [2471957f] Code cleanup and simplification. Three new Mem opcodes added. The sqlite3VdbeJumpHere function added. (CVS 2730) (check-in: [2471957f] user: drh branch: trunk, size: 12288)
2005-09-10
22:40
[43a2d912] part of check-in [26565b89] The shell does not output the sqlite_stat1 table on .dump or .schema. The ANALYZE command now gathers statistics on tables that have only a single index because this sometimes helps when reordering tables in a join. (CVS 2686) (check-in: [26565b89] user: drh branch: trunk, size: 12415)
2005-09-06
10:26
[29c13440] part of check-in [bfdaef12] Fix ANALYZE so that it works even if the empty_result_callbacks pragma is enabled. Ticket #1409. (CVS 2659) (check-in: [bfdaef12] user: drh branch: trunk, size: 12446)
2005-07-23
22:59
[3ab32927] part of check-in [86ce56cc] A new optimizer that breaks a lot of tests. But none of them critically, I think. Nevertheless, there is a lot of work ahead to stabilize the code. (CVS 2564) (check-in: [86ce56cc] user: drh branch: trunk, size: 12435)
14:52
[a0d88c22] part of check-in [868279c7] Store the total number of rows as part of the ANALYZE statistics. (CVS 2563) (check-in: [868279c7] user: drh branch: trunk, size: 12511)
03:18
[443c3449] part of check-in [1996bacf] The results of ANALYZE are now loaded into internal data structures where they can be used. But they are not actually used yet. (CVS 2562) (check-in: [1996bacf] user: drh branch: trunk, size: 12414)
02:17
[b849c238] part of check-in [bd7583a5] Full-coverage testing and documentation for the ANALYZE command. The results of analysis are still not loaded or used, however. (CVS 2561) (check-in: [bd7583a5] user: drh branch: trunk, size: 10189)
00:41
[0eb48929] part of check-in [a4886b11] First code for the ANALYZE command. Mostly untested. The analysis is not loaded into the symbol tables and is not used by the optimizer. (CVS 2560) (check-in: [a4886b11] user: drh branch: trunk, size: 9994)
2005-07-08
12:13
Added: [2f770b39] part of check-in [05b6ac9a] Add infrastructure for the ANALYZE command. Does not yet actually do anything. (CVS 2537) (check-in: [05b6ac9a] user: drh branch: trunk, size: 1049)