/ File History
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

History of src/where.c

2019-10-22
12:02
Merge changes on trunk into the generated-columns branch. file: [6ff3ef07] check-in: [ba123b8c] user: drh branch: generated-columns, size: 203311
00:03
When flipping ("commuting") a comparison operator, set the new EP_Commuted bit rather than adding extra EP_Collate bits, to single later processing that the order of precedence for COLLATE operators is inverted. Fix for ticket [b47e3627ecaadbde] file: [148fa1ce] check-in: [90f7c477] user: drh branch: trunk, size: 203172
2019-10-19
15:01
Add testcase macros. file: [9ab20610] check-in: [fb9c9bb2] user: drh branch: generated-columns, size: 203468
13:29
Refactor names of column index transformation functions, for clarity. Get generated columns working with ALTER TABLE RENAME COLUMN. file: [7b2d928b] check-in: [27ab41c9] user: drh branch: generated-columns, size: 203404
2019-10-18
17:42
Get generated columns working for WITHOUT ROWID tables. file: [b7c662af] check-in: [9f409649] user: drh branch: generated-columns, size: 203394
2019-09-18
12:49
Fix another potential "jump depends on uninitialized value" warning. file: [9f3f23ef] check-in: [633b214e] user: drh branch: trunk, size: 203329
2019-09-03
14:27
When we play games with COLLATE in order to commute an operator in the WHERE clause processing, be sure not to use the commuted operator to qualify a partial index, as insufficient COLLATE information is preserved to verify that the expression will correctly qualify the index. Ticket [767a8cbc6d20bd68] file: [9685d598] check-in: [5351e920] user: drh branch: trunk, size: 203311
2019-08-29
21:16
Improve vdbe branch coverage of NULLS LAST code. file: [fb546afb] check-in: [e8e9f77d] user: dan branch: trunk, size: 203248
16:48
Add a missing VdbeCoverage() macro. file: [0a573a77] check-in: [33da6092] user: drh branch: trunk, size: 203245
2019-08-27
19:59
Add support for "ORDER BY ... NULLS FIRST" and "ORDER BY ... NULLS LAST". Use this to fix ticket [f8a7060e]. file: [6f8bd0b4] check-in: [94085fb3] user: dan branch: trunk, size: 203220
17:28
Add ALWAYS() to an always true conditional that results from the previous check-in. Add a test case for ticket [dbaf8a6820be1ece] to supplement those already checked into TH3. file: [b33215cc] check-in: [aff20980] user: drh branch: trunk, size: 202723
17:01
Omit the "x IN (y)" to "x==y" optimization of check-in [e68b427afbc82e20] (and ticket [e39d032577df6942]) as it causes difficult affinity problems as demonstrated by ticket [dbaf8a6820be1ece] and the original assertion fault is no longer a factor due to countless other changes of the previous 5 years. file: [6cc2708a] check-in: [7f5168a7] user: drh branch: trunk, size: 202715
2019-08-23
13:32
Invert the meaning of the regBignull flag so that it is 1 when doing the normal scan and 1 when scanning nulls. This enables the re-do jump at the bottom of the loop to be coded with a single OP_IfNotZero opcode, rather than a sequence of OP_If, OP_Integer, OP_Goto. file: [10e21ac3] check-in: [bf875e1a] user: drh branch: nulls-last, size: 203358
13:08
Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. file: [cba20474] check-in: [649b08ea] user: drh branch: nulls-last, size: 203621
2019-08-22
19:35
Merge fixes from trunk. Also fix a reference to the KeyInfo.aSortOrder field, which should now be KeyInfo.aSortFlags file: [e954bdbd] check-in: [63e625c8] user: drh branch: nulls-last, size: 203528
16:38
Fix the likely(), unlikely(), and likelihood() functions so that they have no affinity, just like any other function. Ticket [7e07a3dbf5a8cd26] file: [c35ad5b7] check-in: [44578865] user: drh branch: trunk, size: 202853
2019-08-21
19:58
Add missing VdbeCoverage() macros to new code. file: [b49039ad] check-in: [b1cbcdc6] user: dan branch: nulls-last, size: 203458
15:41
Update this branch with latest trunk changes. file: [efdaf72c] check-in: [6153bcf4] user: dan branch: nulls-last, size: 203598
14:54
Avoid assuming that "column IS ?", where column is declared UNIQUE, matches only a single row (as "?" might be NULL). Fix for [b8689402]. file: [16c649c1] check-in: [d02490a2] user: dan branch: trunk, size: 202783
2019-08-20
15:47
Do not pass ORDER BY clauses with non-standard NULL handling to virtual table implementations. file: [391e856e] check-in: [a9a82ee8] user: dan branch: nulls-last, size: 203285
2019-08-17
15:47
Merge trunk changes into this branch. file: [52c43320] check-in: [db1e6080] user: dan branch: nulls-last, size: 203217
2019-08-16
21:07
Add support for using indexes for some ORDER BY clauses that use non-default NULL handling. Still some problems on this branch. file: [c4ec1162] check-in: [81069d71] user: dan branch: nulls-last, size: 203179
2019-08-15
14:35
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] file: [2fac51d2] check-in: [98357d8c] user: drh branch: trunk, size: 202470
2019-08-12
16:36
Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index. file: [83fc2aca] check-in: [07babb0f] user: dan branch: nulls-last, size: 202603
2019-08-08
16:23
More legacy STAT3 code removed. file: [90cb93dc] check-in: [845d2f17] user: drh branch: omit-stat3, size: 202432
15:24
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. file: [bda7162b] check-in: [1e17ea2f] user: drh branch: omit-stat3, size: 202426
2019-08-06
14:37
Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. file: [b6055f47] check-in: [e8234f69] user: drh branch: pending, size: 202566
2019-08-03
16:37
Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca]. file: [dee31d68] check-in: [d465c3ee] user: dan branch: trunk, size: 202530
16:17
In the ".wheretrace 0x100" debugging mode, show the structure of the main parameters to sqlite3WhereBegin() calls. file: [57a9b7b3] check-in: [fd598e47] user: drh branch: trunk, size: 202394
2019-07-30
14:22
Improved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled, but avoids identifying a skip-scan as order-distinct (because it is not) and thus forces a separate b-tree to implement the DISTINCT clause of a query. This undoes check-in [a871d69c6de65038] and substitutes a new fix. file: [01b68cfc] check-in: [89bf0399] user: drh branch: trunk, size: 202068
01:17
Disable the skip-scan optimization for DISTINCT queries. Fix for ticket [ced41c7c7d6b4d36] file: [03125c70] check-in: [a871d69c] user: drh branch: trunk, size: 202073
2019-07-29
14:42
When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c]. file: [a3c9a0e1] check-in: [b4716931] user: dan branch: tkt-6749cb3c, size: 202002
2019-07-16
19:44
Add new assert() statements in an attempt to help static analyzers avoid false-positives. file: [2f508c9a] check-in: [9e664585] user: drh branch: trunk, size: 201890
2019-06-28
07:08
Use the OP_Sequence opcode for generating unique rowid values for an autoindex on a co-routine implementation of a subquery. file: [2f11eeb1] check-in: [eab42975] user: drh branch: trunk, size: 201866
2019-04-26
17:20
An experimental interface for retrieving the estimated cost and estimated number of output rows for a query. file: [3e9689df] check-in: [1b25fa10] user: drh branch: cost-est, size: 202051
2019-04-19
13:38
Streamline the processing of the AND operator. Slightly smaller and faster. file: [99c7b718] check-in: [7713996a] user: drh branch: trunk, size: 201935
2019-03-29
13:17
Fix a fairly obscure problem causing the planner to sometimes choose sub-optimal plans for a query with a single virtual table in the FROM clause, and at least one IN(...) constraint in the WHERE clause. file: [ff2955dc] check-in: [f5752517] user: dan branch: trunk, size: 201939
2019-01-28
18:58
Fix a performance regression caused by the previous commit. file: [8a207cb2] check-in: [c4db0ad1] user: drh branch: index-on-cast, size: 201893
18:08
Make indexes on CAST(...) expressions work. file: [c91b3dd6] check-in: [3ef711d9] user: dan branch: index-on-cast, size: 201421
2019-01-22
18:20
Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes read cursors to be closed after their usefulness ends during a two-pass UPDATE. file: [e575883d] check-in: [8790368b] user: mistachkin branch: branch-3.26, size: 201124
2019-01-17
19:33
Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes read cursors to be closed after their usefulness ends during a two-pass UPDATE. file: [c5d20169] check-in: [7def6c8e] user: drh branch: trunk, size: 201361
2019-01-15
14:31
Fix a problem triggered by DELETE statements with WHERE clauses that use the OR-optimization on some virtual tables. file: [dc293ea4] check-in: [ecf5caa7] user: dan branch: trunk, size: 200527
2019-01-10
13:56
Use the new SQLITE_IDXTYPE_IPK values (3) on Index.idxType to indicate the fake INTEGER PRIMARY KEY index used during query planning. file: [7a1db797] check-in: [e22d2f90] user: drh branch: trunk, size: 200448
2018-12-31
18:30
Merge enhancements and bug fixes from trunk. file: [981412c2] check-in: [9fb646f2] user: drh branch: reuse-subqueries, size: 200349
2018-12-29
02:26
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*. file: [ebdd5937] check-in: [4a0929ac] user: drh branch: trunk, size: 200300
2018-12-25
00:15
Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. file: [bf0715a8] check-in: [3c2ad0e9] user: drh branch: reuse-subqueries, size: 200339
2018-12-24
02:34
Experimental code that tries to put the computation of subqueries inside a subroutine, and reuse that subroutine if the same subquery is evaluated more than once. Current code does not work for CHECK constraints. file: [05877bee] check-in: [6c44838a] user: drh branch: reuse-subqueries, size: 200325
2018-12-14
20:20
Add the OP_ColumnsUsed opcode (when compiled with SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which columns of a btree cursor will be used. (Backport from 3.8.11) file: [8a445862] check-in: [b29e02f8] user: drh branch: branch-3.8.9, size: 270904
2018-11-20
16:02
Consolidate the two sqlite3SchemaToIndex() routines. file: [fded04f3] check-in: [dfab7170] user: dan branch: reuse-schema1, size: 200445
2018-11-19
20:41
Fix a problem with virtual tables in shared schemas. file: [9cf0501b] check-in: [84be9220] user: dan branch: reuse-schema1, size: 200447
2018-11-17
18:45
Merge latest trunk changes into this branch. file: [0248d446] check-in: [9fdd1868] user: dan branch: reuse-schema1, size: 200312
14:19
Remove a C++-style comment. file: [3818e8a7] check-in: [645232f2] user: drh branch: trunk, size: 200290
2018-11-16
15:08
Update the generate_series() table-valued function to make use of the new SQLITE_CONSTRAINT return from xBestIndex. file: [053e5004] check-in: [4372ad64] user: drh branch: trunk, size: 200366
13:56
Enhance the xBestIndex interface of virtual table so that if the xBestIndex method returns SQLITE_CONSTRAINT then that particular combination of constraints is considered unusable and does not participate further in query planning. file: [23f955de] check-in: [684013ce] user: drh branch: trunk, size: 200297
2018-11-15
21:20
Fix some problems with the feature on this branch. Many problems remain. file: [dc648e8b] check-in: [31b6aee7] user: dan branch: reuse-schema1, size: 200164
2018-11-09
14:17
Fix for ticket [787fa716be3a7f650cac] file: [f5da1079] check-in: [531eca61] user: drh branch: trunk, size: 200142
2018-10-05
20:09
When the left-hand side of a WHERE clause contraint is a UNIQUE column, and that term of the WHERE clause is not used for indexing, assume that the term reduces the number of output rows by half. This is one proposed fix for ticket [e8b674241947eb3ba4] file: [e34d423b] check-in: [5c243eec] user: drh branch: unique-constraint-weights, size: 200840
2018-10-04
18:17
The 0x8000 optimization flag associated with SQLITE_TESTCTRL_OPTIMIZATIONS causes a large penalty (200) to be added to all sorting costs, which encourages the query planner avoid using the sorter. This flag can be used in experiments to help come up with a more accurate estimate of the true cost of sorting. file: [824ca57f] check-in: [857a1b01] user: drh branch: query-planner-debug, size: 200243
2018-09-24
12:37
Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the code. file: [a54a3d63] check-in: [903e5018] user: drh branch: trunk, size: 200177
10:47
Increase the initial value of WhereLoopBuilder.iPlanLimit to 20K. Issue a warning if the iPlanLimit reaches zero. file: [49022d3c] check-in: [3dd35f51] user: drh branch: trunk, size: 200589
2018-09-22
15:05
Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR optimization discovered overnight by OSSFuzz. file: [9e2cccc1] check-in: [7b59930a] user: drh branch: trunk, size: 200514
2018-09-21
18:43
Put a limit counter on the query planner that restricts the number of index+constraint options that can be considered for each table in a join. This prevents certain pathological queries from taking up too much time in the query planner. file: [e5c4f5ab] check-in: [8690b5a0] user: drh branch: trunk, size: 200376
2018-09-19
14:54
Reduce the size of Expr from 80 to 72 bytes moving the pRight field inside the "x" union. This is an incremental check-in that still has issues. file: [33a546a9] check-in: [147c61a6] user: drh branch: expr-simplify, size: 200136
2018-09-18
21:35
In the Expr object, the Expr.eX field determines what value is stored in the Expr.x union. This mostly works, but there are issues identified by valgrind. file: [c90c392c] check-in: [8849a463] user: drh branch: expr-simplify, size: 199621
2018-09-10
14:43
New testcase() macros on virtual table xBestIndex logic. file: [20191268] check-in: [3bbd9c5f] user: drh branch: trunk, size: 199545
12:17
Fix a problem with processing a "vtab.col IS NULL" expression within the WHERE clause of a query when "vtab" is a virtual table on the rhs of a LEFT JOIN. file: [07157267] check-in: [83da4d41] user: dan branch: trunk, size: 199453
2018-09-08
20:29
Fix an unreachable branch in the new sqlite3WhereOrderByLimitOptLabel() function of the query planner. file: [ff7f4024] check-in: [5a954533] user: drh branch: trunk, size: 198985
20:09
Fix multiple issues with the ORDER BY LIMIT optimization. This is the proposed resolution to ticket [9936b2fa443fec03ff25]. file: [5192013a] check-in: [20672012] user: drh branch: trunk, size: 199001
2018-08-03
23:04
Completely remove the column cache logic, which has been a persistent source of bugs for many years. Due to recent enhancements to the performance of the OP_Column opcode, removing the column cache actually makes speed-check.sh run faster. Removing the column cache also saves about 1,800 bytes of code space. file: [15580996] check-in: [3f5f60cd] user: drh branch: omit-column-cache, size: 197820
2018-07-28
21:01
Add a small cost penalty to sorting to bias the query planner in favor of plans that do not require a final sorting pass. file: [52ab6d07] check-in: [85b9beb4] user: drh branch: trunk, size: 197916
2018-07-27
17:51
Only run the constant propagation optimization on joins since that is the only scenario where it is useful. This saves prepare time for the common case of a simple query. file: [fae13835] check-in: [598d6083] user: drh branch: propagate-const-opt, size: 197671
2018-07-20
19:24
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. file: [2d313b44] check-in: [489f3caf] user: drh branch: trunk, size: 197663
2018-07-12
19:14
Add a test-control to disable the skip-scan optimization. file: [cd6710e2] check-in: [650a3fe0] user: dan branch: trunk, size: 197557
2018-07-10
19:48
Identify Select objects within a single statement using small sequential integers rather than "0x%p". This is more readable and yields the same result on successive runs. file: [7afd00cf] check-in: [a7cdc5bc] user: drh branch: trunk, size: 197510
2018-07-04
14:28
Experimental planner change to avoid a skip-scan if a regular index scan on the same index columns can be done instead. file: [a38a485f] check-in: [32924446] user: dan branch: exp-avoid-expensive-skipscan, size: 198388
2018-06-11
17:35
Add the OP_SetTabCol and OP_VerifyTabCol opcodes, only when compiling with SQLITE_DEBUG, to do run-time verification of the column cache. file: [0bcbf9e1] check-in: [b37614a3] user: drh branch: trunk, size: 197514
2018-06-09
14:13
Improved comments an presentation for the recent IN operator decision improvement. file: [fe1a6f97] check-in: [31e480f6] user: drh branch: trunk, size: 196560
01:12
Compute the bitmask of indexed columns for each index once when the Index objecct is constructed, instead of recomputing it every time it is needed. file: [99159295] check-in: [d735872e] user: drh branch: trunk, size: 196464
00:09
Avoid invoking the whereLoopAddOr() routine in the query planner if there are no OR operators in the WHERE clause, thus speeding up query planning slightly. file: [b93db8c5] check-in: [292724ff] user: drh branch: trunk, size: 196898
2018-06-08
21:21
Only choose to scan an IN operator rather than use an index if we have real STAT1 data to suggest it is advantageous. file: [e4d48338] check-in: [30e87466] user: drh branch: in-scan-vs-index, size: 196874
18:22
Consider doing a partial table scan to fulfill an IN operator rather than using an index. Try to pick the plan with the lowest cost. file: [8e95858b] check-in: [1fa40a78] user: drh branch: in-scan-vs-index, size: 196712
2018-06-07
17:32
Remove the NextIfOpen and PrevIfOpen opcodes which are no longer needed when the IN-early-out optimization is working. file: [7dcb13bb] check-in: [439c8162] user: drh branch: multikey-opt-idea, size: 195335
14:59
Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. file: [6011e6a7] check-in: [522f1eac] user: drh branch: multikey-opt-idea, size: 195347
2018-06-05
20:45
Add the OP_IfNoHope and OP_SeekHit opcodes used to reduce the number of unnecessary sqlite3BtreeMovetoUnpacked() calls when checking for an early exit on IN-operator loops. Futher optimizations are likely possible here. file: [83b6cf94] check-in: [6bf251af] user: drh branch: multikey-opt-idea, size: 195289
15:16
Use an OP_NotFound opcode to cancel futile IN operators early. The current implementation is suboptimal because it always runs teh OP_NotFound. This still needs to be enhanced to only do the OP_NotFound if no results have been seen on the current loop. file: [a16f982d] check-in: [87a9fc50] user: drh branch: multikey-opt-idea, size: 195289
2018-05-30
00:54
Demonstration code on a possible technique for optimizing the use of IN operator on columns to the right of multicolumn indexes. If the OP_Noop generated where were really a new opcode that checked to see if there existed any entries in the index with a matching prefix, it might prevent unnecessary iterations of the IN operator. file: [a9a27099] check-in: [92f0fe15] user: drh branch: multikey-opt-idea, size: 195194
2018-05-14
22:46
Make more aggressive use of automatic indexes when processing materalized views and subqueries. file: [60ec752f] check-in: [172f5bd2] user: drh branch: trunk, size: 195036
18:09
The restriction on using automatic indexes for low cardinality loops only applies if the cardinality is restricted by a LIMIT clause. file: [95b25ef0] check-in: [991a76bf] user: drh branch: exp-indexed-clause, size: 194924
17:12
Experimental syntax enhancement for an "INDEXED" keyword following a FROM-clause subquery that indicates that an automatic index on that subquery is suggested. file: [ebc86f31] check-in: [32b3d110] user: drh branch: exp-indexed-clause, size: 194830
2018-05-07
11:37
Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. file: [d89b1aa5] check-in: [374d8e26] user: drh branch: trunk, size: 194807
2018-05-02
18:00
Fix test cases so that they work with the new EXPLAIN QUERY PLAN output format. Only some of the cases have been fixed. This is an incremental check-in. file: [8265aec8] check-in: [5f0e803e] user: drh branch: rework-EQP, size: 194832
16:13
Improved EQP output for recursive CTEs and multi-value VALUES clauses. file: [aa94ef44] check-in: [f2f52554] user: drh branch: rework-EQP, size: 194826
2018-04-24
17:34
Do not attempt to use terms from the WHERE clause to drive indexes on the right table of a LEFT JOIN. Fix for ticket [4ba5abf65c5b0f9a96a7a40cd18b] file: [7a1c5555] check-in: [aeb694e3] user: drh branch: trunk, size: 194770
2018-04-23
19:30
Disable the OR optimization based on expressions in the ON clause of a LEFT JOIN. This is a temporary measure until we can devise a better fix. file: [2e8d9899] check-in: [4df5ea93] user: drh branch: begin-concurrent-pnu-tempfix, size: 194380
2018-04-09
15:57
Enhance the query planner so that it detects when the xBestIndex method of a virtual table gives out-of-sequence argvIndex values and reports an error. Secondary fix for ticket [2b8aed9f7c9e6]. file: [d6e5f205] check-in: [9506ec14] user: drh branch: trunk, size: 194876
13:58
Improvements to ".wheretrace" output. file: [f24ffd41] check-in: [ea2e5b34] user: drh branch: trunk, size: 194526
2018-01-31
14:07
Fix a failing assert() in the new code on this branch. file: [7cae47e8] check-in: [74d857d1] user: dan branch: omit-left-join-fix, size: 194328
2018-01-29
17:08
Update the omit-left-join optimization so that it works in some cases when the RHS is subject to a UNIQUE but not NOT NULL constraint. file: [eb378826] check-in: [88411a40] user: dan branch: omit-left-join-fix, size: 194392
2018-01-27
05:40
Proposed fix for the query planner problem of ticket [ec32177c99ccac2b1]. file: [10c7e13c] check-in: [eef8cbef] user: drh branch: trunk, size: 194248
2018-01-16
13:37
Fix a problem causing an infinite loop or other malfunction in some UPDATE statements with an OR term in the WHERE clause. Ticket [47b2581aa9bfecec] file: [caf0b6c9] check-in: [feb2c2b6] user: dan branch: trunk, size: 194201
2017-12-29
15:04
Change the function name to sqlite_unsupported_offset(X). Only enable the function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC. The makefiles add that definition to shell builds. file: [36b92103] check-in: [7a7f826e] user: drh branch: location-function, size: 193351
14:33
Enhance location(X) so that it works with indexes and WITHOUT ROWID tables. The function might return an offset to the main table or to an index, depending on whether the column X would be loaded from the main table or from the index. file: [9c1fca74] check-in: [dd94d6a8] user: drh branch: location-function, size: 193292
2017-12-22
00:52
Modify the new sqlite3_vtab_collation() interface so that it takes a pointer to the sqlite3_index_info object passed into xBestIndex rather than an sqlite3 connection pointer, which the xBestIndex method might not have access to. file: [5876c910] check-in: [5c1fe666] user: drh branch: trunk, size: 193264
2017-12-19
18:56
Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL constraint. file: [0cdfda28] check-in: [ad38d2c4] user: dan branch: trunk, size: 192755
2017-12-16
19:16
Merge latest trunk changes into this branch. file: [1617e7e4] check-in: [d5b597b5] user: dan branch: schemalint, size: 192712
2017-12-08
19:37
The query planner tries to avoids using indexes that use unknown collating functions. file: [ee9dd4a4] check-in: [02013fc1] user: drh branch: trunk, size: 191514
2017-12-07
22:10
When doing a table scan using an index, do not error out if collating functions used by that index are unavailable, since they will not be used. file: [ea27cbc7] check-in: [bbd69fa6] user: drh branch: trunk, size: 191941
2017-11-29
16:16
Merge latest trunk changes into this branch. file: [a338038b] check-in: [373fa21b] user: dan branch: schemalint, size: 192675
2017-11-23
04:45
Fix a problem in the omit-table-from-left-join optimization from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz. file: [9752b68e] check-in: [b016c28f] user: drh branch: trunk, size: 191477
00:45
Completely disable the skip-ahead-distinct optimization for all but the inner-most loop of a DISTINCT join. Fix for ticket [ef9318757b152e3a26e9592] file: [1b85f067] check-in: [b7595cf2] user: drh branch: trunk, size: 191277
2017-11-21
23:47
An experimental optimization to DISTINCT that causes an immediate exit of the inner loop of a join following each output row if the inner loop does not contribute any columns to the result set. file: [868c5b47] check-in: [a33f88ac] user: drh branch: distinct-early-out, size: 192176
23:38
Fix the skip-ahead-distinct optimization on joins for cases there the table in the inner loop of the join does not contribute any columns to the result set. Proposed fix for ticket [ef9318757b152e3a2] file: [1c0ab207] check-in: [2dcef5a9] user: drh branch: trunk, size: 191590
19:22
Update the omit-table-from-left-join optimization so that it can omit tables from the middle of the join as well as the end. file: [9742731e] check-in: [618ca9fe] user: dan branch: left-join-optimization, size: 191204
2017-11-20
14:40
Fix a problem preventing the planner from identifying scans that visit at most one row in cases where that property is guaranteed by a unique, not-null, non-IPK column that is the leftmost in its table. file: [e729f477] check-in: [299d7ca5] user: dan branch: left-join-omit-fix, size: 189775
2017-11-07
18:20
Fix a problem causing an INDEXED BY specifying an unusable partial index to be mishandled. file: [031a80bc] check-in: [292a0408] user: dan branch: trunk, size: 189774
2017-10-31
03:40
Remove unnecessary NEVER() and ALWAYS() conditionals. file: [b7a075f5] check-in: [1c80c75d] user: drh branch: trunk, size: 189792
2017-10-27
23:28
I was a little concerned about this check-in. Though I could not generate a failure myself, I thought it was risky. I checked it in for further testing. Then, overnight, OSSFuzz found a failure case for me. So the change is now moved out into a deadend branch. Was: Use OP_SCopy rather than OP_Copy to transfer results from a co-routine to its consumer. This undoes an earlier fix for ticket [98825a79ce] by check-in [ec6a06246e] because that problem no longer occurs due to WHERE clause push-down. file: [ca5c29ba] check-in: [0926df09] user: drh branch: mistake, size: 189826
2017-10-16
11:50
Improved comments, including a typo fix, on the whereLoopCheaperProperSubset() function. file: [d8c6d690] check-in: [700a3c69] user: drh branch: trunk, size: 189825
2017-10-15
22:16
In the query planner, do not consider index X to be a proper subset of index Y if X is a covering index but Y is not. file: [248f0dc6] check-in: [ee31c043] user: drh branch: trunk, size: 189673
2017-10-12
14:13
Update this branch to match latest trunk. file: [dd3be478] check-in: [d325da6c] user: dan branch: schemalint, size: 190705
2017-10-11
20:26
Merge latest trunk changes with this branch. file: [80b3f578] check-in: [2719cf5c] user: dan branch: schemalint, size: 190733
2017-09-28
01:58
Add new routines to simplify dealing with collating sequences in expressions: sqlite3ExprNNCollSeq() and sqlite3ExprCollSeqMatch(). file: [049522ad] check-in: [490e488e] user: drh branch: trunk, size: 189507
01:09
Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY with the same COLLATE clause. file: [5b004ea3] check-in: [04130018] user: drh branch: trunk, size: 189778
00:01
In two places, change the magic number -1 to its proper symbol XN_ROWID. file: [da814d09] check-in: [80277d2f] user: drh branch: trunk, size: 189753
2017-09-15
14:36
Fix a harmless comment typo. No changes to code. file: [21eea981] check-in: [f7f0bf1d] user: drh branch: trunk, size: 189743
2017-09-11
19:47
Refactor names of constants and functions associated with the auxiliary operators for xBestIndex. file: [d97f97ca] check-in: [0fb992af] user: drh branch: vtab-extra-ops, size: 189746
18:37
Minor adjustments to indentation and spacing for clarity. No changes to code. file: [3db249df] check-in: [d3153abd] user: drh branch: vtab-extra-ops, size: 189807
2017-09-09
19:41
Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL constraints. file: [7cc9692d] check-in: [34c8e952] user: dan branch: vtab-extra-ops, size: 189812
2017-09-04
00:33
Proposed fix for ticket [b899b6042f97f5] file: [101f0a64] check-in: [c7f9f47b] user: drh branch: trunk, size: 189583
2017-08-25
13:34
Small performance optimization in sqlite3WhereBegin(). file: [0aaa1b08] check-in: [39f708d1] user: drh branch: trunk, size: 189538
2017-08-18
08:29
Only use indexes on expressions to optimize ORDER BY and GROUP BY if the collation sequence matches. Possible fix for [e20dd54a]. file: [ad558533] check-in: [37e19008] user: dan branch: trunk, size: 189461
2017-07-27
22:16
Enhance the like optimization so that it works with an ESCAPE clause. file: [3508f80b] check-in: [2495acf7] user: drh branch: branch-3.8.9, size: 270165
2017-07-18
17:13
Avoid creating an automatic index on the RHS of a LEFT JOIN to optimize an IS term. Fix for [ce68383b]. file: [cbe8ddff] check-in: [d2f0b2e8] user: dan branch: trunk, size: 189454
2017-07-08
01:01
Fix the covering index OR optimization (check-in [fcbd6abd]) so that it works with SQLITE_MAX_ATTACHED>30. Broken by a bad cherry-pick merge. file: [5e7cf96b] check-in: [d227de8a] user: drh branch: branch-3.8.9, size: 269140
2017-07-05
16:20
Make use of covering indexes in the OR optimization. file: [4ba13815] check-in: [fcbd6abd] user: drh branch: branch-3.8.9, size: 269129
2017-07-04
19:34
Add the count-of-view optimization when compiled using SQLITE_COUNTOFVIEW_OPTIMIZATION. file: [e7cc8094] check-in: [d1ba2002] user: drh branch: trunk, size: 189137
2017-06-28
18:25
Make the query planners use of partial indexes based on bound variables responsive to the SQLITE_DBCONFIG_ENABLE_QPSG setting. file: [715b8491] check-in: [a934dd14] user: drh branch: partial-index-variables, size: 189096
2017-06-24
18:10
Consider the values bound to SQL variables when determining whether or not a partial index may be used. file: [563cd034] check-in: [7b59c353] user: dan branch: partial-index-variables, size: 189012
16:03
Query planner tuning: When deciding between two plans with the same cost, bias the selection toward the one that does not use the sorter. file: [74b0a054] check-in: [f0ec36d4] user: drh branch: trunk, size: 188967
2017-06-22
16:51
When generating individual loops for each ORed term of an OR scan, move any constant WHERE expressions outside of the loop, as is done for top-level loops. file: [d4f329d9] check-in: [e4a022be] user: dan branch: or-optimization, size: 188887
2017-06-11
20:17
Fix an off-by-one error that messes up the display of loop codes in the ".wheretrace" debugging output for queries with more than 62 candidate loops when SQLITE_ENABLE_WHERETRACE is on. file: [aa213e1b] check-in: [0bbdaf28] user: drh branch: trunk, size: 187817
2017-05-24
04:32
Fix a problem in STAT4 equality estimation for multi-column indexes introduced by check-in [3e0590dee0e68cc1599]. file: [5b519760] check-in: [19dad0a7] user: drh branch: branch-3.8.9, size: 267202
04:18
Fix a problem in STAT4 equality estimation for multi-column indexes introduced by check-in [3e0590dee0e68cc1599]. file: [67f98714] check-in: [cfb0d9e0] user: drh branch: trunk, size: 187813
2017-05-22
00:45
When planning a query using sorting, resolve ties in the solver by selecting loop plans with the smaller unsorted cost. file: [ba36d011] check-in: [f261678c] user: drh branch: trunk, size: 187809
00:27
When planning a query using sorting, resolve ties in the solver by selecting loop plans with the smaller unsorted cost. file: [688071f7] check-in: [962531e7] user: drh branch: branch-3.8.9, size: 267198
2017-05-19
20:55
Improved comments on one routine in the query planner. Improved diagnostic output for ".wheretrace". No production code changes. file: [a354396e] check-in: [946b87a5] user: drh branch: trunk, size: 187385
2017-04-20
17:35
Merge latest trunk changes into this branch. file: [a12df4e9] check-in: [b1533bc4] user: dan branch: schemalint, size: 188543
2017-04-18
11:20
Improved optimizations of views as the right operand of a LEFT JOIN. file: [c6352f15] check-in: [41c27bc0] user: drh branch: trunk, size: 187317
2017-04-15
15:47
Merge latest trunk changes into this branch. file: [d22a2ae7] check-in: [2d0c458e] user: dan branch: schemalint, size: 188459
14:30
Add header comment for sqlite3_vtab_collation(). file: [4b0d7b66] check-in: [d238694c] user: dan branch: schemalint, size: 187252
14:16
Fix memory leaks in the code on this branch. Make use of the sqlite3_index_constraint.usage field. Do not try to handle ORDER BY terms with explicit COLLATE clauses - they don't get passed to the vtab layer anyway. file: [7b4d39ff] check-in: [0cd75a87] user: dan branch: schemalint, size: 186798
2017-04-14
22:41
Fix to the decision logic for when to use the skip-ahead-distinct optimization. file: [10ae856a] check-in: [e50fd489] user: drh branch: skip-ahead-distinct, size: 187233
19:41
Modify the code in ext/expert/ to use the vtab interface instead of sqlite3_whereinfo_hook(). Remove sqlite3_whereinfo_hook(). file: [64f2c18c] check-in: [3bb65850] user: dan branch: schemalint, size: 187129
19:03
Add the TK_IF_NULL_ROW opcode to deal with non-NULL result columns in the result set of a view or subquery on the RHS of a LEFT JOIN that gets flattened. file: [e02cbd8a] check-in: [3a5860d8] user: drh branch: left-join-view, size: 186110
00:45
Fix a couple of unreachable branches. file: [98388bf4] check-in: [1aa0ea8d] user: drh branch: skip-ahead-distinct, size: 187221
2017-04-13
21:29
Fix the skip-ahead-distinct optimization so that it works with indexes that have repeated columns with different collating sequences. file: [911bf344] check-in: [ce1e2b88] user: drh branch: skip-ahead-distinct, size: 187305
19:48
Simplification of the skip-ahead-distinct logic. There is still an issue with handling COLLATE. file: [2b88a9ab] check-in: [57c5173b] user: drh branch: skip-ahead-distinct, size: 188553
18:33
New test cases and minor fixes for the optimization on this branch. file: [b08b998b] check-in: [70ac9ea1] user: dan branch: skip-ahead-distinct, size: 188621
13:01
Only use the skip-ahead-distinct optimization if the index has been analyzed and we know that a skip-head is likely to skip over at least 11 rows. The magic number 11 was determined by experimentation. file: [56111492] check-in: [0cf16dec] user: drh branch: skip-ahead-distinct, size: 188117
01:19
Forward port the skip-ahead-distinct branch which was abandoned for some reason that I do not recall. This port should have been achived by a merge of trunk into the previous head of skip-ahead-distinct, but that did not work. So I had to manually "rebase" the changes. file: [33fd1fcd] check-in: [132339a1] user: drh branch: skip-ahead-distinct, size: 187873
2017-04-11
19:00
Update this branch with latest trunk changes. file: [f5acfb6f] check-in: [0f66a093] user: dan branch: schemalint, size: 191665
2017-04-08
19:00
Merge latest trunk with this branch. file: [613b1cac] check-in: [e051e8f2] user: dan branch: schemalint, size: 191638
2017-04-07
19:41
Proof of concept for the ability to use the expression columns in an index on expressions in place of equivalent expressions in the result set or in the WHERE clause. This check-in compiles but is mostly untested. file: [1d14e18f] check-in: [a52ef2ad] user: drh branch: covering-index-on-expr, size: 186026
2017-04-05
12:39
Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases where we know that the argument to be freed is never NULL. file: [49b48b72] check-in: [ad90e8bb] user: drh branch: trunk, size: 185999
2017-04-04
17:50
Add some support for OR terms to sqlite3_whereinfo_hook(). file: [be352441] check-in: [5cd07000] user: dan branch: schemalint, size: 191544
04:23
Add the sqlite3_whereinfo_hook() API - an experimental API replacing the DBCONFIG_WHEREINFO hack on this branch. file: [cbd1e856] check-in: [a54aef35] user: dan branch: schemalint, size: 188691
2017-04-03
14:07
Avoid an unnecessary call to sqlite3WhereGetMask() inside of whereShortCut(). file: [aed99e51] check-in: [5c11f430] user: drh branch: trunk, size: 185983
2017-03-31
11:20
Merge latest trunk into this branch. file: [30c790ab] check-in: [cb721d0b] user: dan branch: schemalint, size: 189272
2017-03-11
13:02
Make sure the translateColumnToCopy() routine in the query planner does not try to access an array that failed to be fully allocated due to a prior OOM. This fixes an issue discovered by OSSFuzz. file: [e815093e] check-in: [3299a261] user: drh branch: trunk, size: 185905
2017-02-17
21:23
Increase the estimated cost of sorting when sorting wide results sets, to account for the extra storage space and I/O required for the external sort. file: [a7a99b84] check-in: [38298ef9] user: drh branch: apple-increased-sorting-cost, size: 186244
15:26
Set the TF_StatsUsed flag on tables when the query planner outcome is affected by the sqlite_stat1 data. Also, change the column names of the "PRAGMA stats" command so that they are not keywords. file: [1a3a8adb] check-in: [fb2b8ae8] user: drh branch: auto-analyze, size: 185758
2017-02-16
21:29
Increase the estimated cost of sorting when sorting wide results sets, to account for the extra storage space and I/O required for the external sort. file: [69eb9080] check-in: [aa0703e5] user: drh branch: increased-sorting-cost, size: 185546
20:52
Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now used for more than just DISTINCT processing. file: [01baf58b] check-in: [9fc5cd50] user: drh branch: trunk, size: 185226
2017-02-11
14:59
Fix indexes on expressions so that they can be actually used with a COLLATE clause. file: [6397fab5] check-in: [e464b919] user: drh branch: trunk, size: 185252
13:51
Ensure that indexed expressions with collating sequences are handled correctly. Proposed fix for ticket [eb703ba7b50c1a5]. file: [b0d81c6f] check-in: [9689d04b] user: drh branch: trunk, size: 185208
2017-01-10
20:04
Changes to allow some multi-row UPDATE statements to avoid the two-pass approach. file: [bc71775e] check-in: [46db23cc] user: dan branch: onepass-update, size: 185166
2016-11-22
01:26
Remove unnecessary OP_Close opcodes for a size reduction and performance increase. file: [6bbf9284] check-in: [32be7aae] user: drh branch: trunk, size: 185131
2016-10-26
18:41
Small size reduction and performance enhancement in whereScanInit(). file: [952f76e7] check-in: [c23f5ef3] user: drh branch: trunk, size: 185918
17:57
Small size reduction and performance improvement in whereScanNext(). file: [694dd84a] check-in: [d861ee17] user: drh branch: trunk, size: 185970
15:46
If all branches of an OR optimize scan that is the rhs of a LEFT JOIN use the same index, set the index cursor to return NULL values if there are no matches for a row on the lhs. file: [125af074] check-in: [e7b9bc67] user: dan branch: leftjoin-or-fix, size: 185872
2016-10-12
18:55
Avoid reading the -1-th element of an array in the query planner. Fix to a bug introduced by check-in [8e2b25f9b8a7] from earlier today. Curiously, the problem only appeared on 32-bit systems. file: [5f846d94] check-in: [443913d5] user: drh branch: trunk, size: 185835
15:15
New testcase() macros to ensure coverage of the ORDER BY LIMIT optimization code in where.c. file: [7e454887] check-in: [61f05269] user: drh branch: trunk, size: 185789
14:48
Fix a problem affecting queries that match the pattern (... WHERE ipk IN (....) ORDER BY ? LIMIT ?). Fix for [96c1454c]. file: [1398bc49] check-in: [8e2b25f9] user: dan branch: trunk, size: 185697
2016-10-10
14:34
When handling ORDER BY expressions, do not assume all values of an indexed expressions are distinct. Fix for [4766f444]. file: [43b53ef3] check-in: [aebe429e] user: dan branch: trunk, size: 185576
2016-10-08
11:55
Add missing "static" to internal function whereRangeVectorLen(). file: [a2269d2d] check-in: [cbed3d75] user: dan branch: trunk, size: 185568
2016-10-03
14:44
Avoid unnecessary memset() calls in the query optimizer. file: [c264ec85] check-in: [5bb7cde0] user: drh branch: trunk, size: 185561
2016-09-23
18:06
Fix the ORDER BY LIMIT optimization backport so that it works when the ORDER BY uses the DESC direction. file: [8cb63bd4] check-in: [0c3cafb7] user: drh branch: branch-3.8.9, size: 266774
2016-09-22
18:53
Remove the internal sqlite3CodeOnce() interface, replacing it with a direct call to sqlite3VdbeAddOp0(v,OP_Once). Slightly smaller and faster. file: [5f91be9f] check-in: [c3774c6a] user: drh branch: trunk, size: 185391
2016-09-19
11:00
Fix a segfault introduced by the row-value enhancement that comes up on a skip-scan where the first term of the index is unconstrained and the second term is of the form "columm IN (SELECT...)". file: [e4140408] check-in: [2401ea5a] user: drh branch: trunk, size: 185385
2016-09-16
14:50
Add WHERETRACE macros showing every entry and exit from whereLoopAddBtreeIndex(). file: [d0ca1b5e] check-in: [e7653dec] user: drh branch: trunk, size: 185366
2016-09-14
01:43
Backport the ORDER BY LIMIT optimization to version 3.8.9. file: [3028fd1c] check-in: [db361482] user: drh branch: branch-3.8.9, size: 266810
2016-09-07
13:12
Merge fixes from trunk. file: [edbd73a8] check-in: [193f036c] user: drh branch: rowvalue, size: 185138
01:51
The ORDER BY LIMIT optimization is not valid unless the inner-most IN operator loop is actually used by the query plan. Fix for ticket [0c4df46116e90f92]. file: [4bbc3f1d] check-in: [820644b8] user: drh branch: trunk, size: 179708
2016-08-26
18:17
Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS() macros on unreachable branches. file: [48d705e5] check-in: [87d40195] user: drh branch: rowvalue, size: 184765
13:19
Allow ROWID values in indexed vector comparisons. file: [bad93f9b] check-in: [b0cc6be4] user: drh branch: rowvalue, size: 184724
03:42
Comment improvements. Put ALWAYS and NEVER macros on three unreachable branches. file: [2f60a506] check-in: [39761700] user: drh branch: rowvalue, size: 184718
2016-08-19
18:40
Show the WhereTerm.iField value on debugging output, when it is non-zero. file: [c7cdfd54] check-in: [931c9535] user: drh branch: rowvalue, size: 184174
2016-08-11
12:01
Fix some problems with handling "no such collation sequence" errors. file: [5bee250c] check-in: [8278be06] user: dan branch: rowvalue, size: 184045
2016-08-08
20:15
Fix some cases involving row values and virtual tables. file: [457a2c8c] check-in: [156a41f3] user: dan branch: rowvalue, size: 184033
16:52
Merge trunk changes with this branch. file: [f60310d9] check-in: [0e927a7e] user: dan branch: rowvalue, size: 183461
2016-08-04
09:09
Make sure the ORDER BY LIMIT optimization is not applied if the inner-most loop can only have a single iteration and is hence not really a loop. file: [5c9df42d] check-in: [13e3bd3d] user: drh branch: trunk, size: 179335
2016-08-03
18:00
Fix a problem with estimating the number of rows visited by a query that uses a multi-column IN(SELECT...) constraint. file: [0a0b8af3] check-in: [3c2f908f] user: dan branch: rowvalue, size: 183407
16:39
Fix another problem involving vector range constraints and mixed ASC/DESC indexes. file: [8bd54861] check-in: [1559f4c4] user: dan branch: rowvalue, size: 182904
16:14
Fix stat4-based cost estimates for vector range constraints. file: [21095414] check-in: [18af74ab] user: dan branch: rowvalue, size: 182898
2016-08-02
17:07
Fix a problem with vector range constraints and mixed ASC/DESC indexes. file: [25eae2e0] check-in: [e2ad30c8] user: dan branch: rowvalue, size: 182884
16:24
Merge latest trunk changes into this branch. file: [9dcbc1be] check-in: [d468101b] user: dan branch: rowvalue, size: 182721
2016-08-01
20:14
Fix a problem with vector range constraints involving the rowid column. And other issues. file: [a1c2fde6] check-in: [3ef75d45] user: dan branch: rowvalue, size: 182718
2016-07-30
18:54
Fix harmless compiler warning seen with MSVC. file: [bb1444f6] check-in: [390a38a1] user: mistachkin branch: trunk, size: 179281
17:59
Merge latest trunk with this branch. file: [61db3a40] check-in: [63ae02d0] user: dan branch: rowvalue, size: 182364
2016-07-29
01:32
Undo some unhelpful changes to skip-scan scoring that were added by the check-in [9e2b2681] that improved scoring of index scan. file: [fcaa38d1] check-in: [c7d51934] user: drh branch: trunk, size: 179278
2016-07-28
13:59
Merge latest trunk changes into this branch. file: [df58d6ad] check-in: [9685880f] user: dan branch: rowvalue, size: 182366
2016-07-27
19:33
Fix some problems with multi-column IN(SELECT...) processing. file: [0b370db8] check-in: [719a3b20] user: dan branch: rowvalue, size: 181430
19:30
Enhance the query planner cost estimation for index scans to take into account WHERE clause terms that can be computed using only the index and that do not require looking up rows in the original table. This fixes an obscure performance regression that arose when the ORDER BY LIMIT optimization was added by check-in [bf46179d44843]. file: [8ccc01f9] check-in: [9e2b2681] user: drh branch: trunk, size: 179280
19:20
Add test cases and fix a comment. file: [66a29031] check-in: [50f8ea37] user: drh branch: improved-index-scan, size: 179276
18:27
When estimating the cost of an index scan, factor in the cost savings of being able to use the index to evaluate some WHERE clause terms without having to do a table lookup. file: [7e4d676b] check-in: [a59b5622] user: drh branch: improved-index-scan, size: 179274
16:03
Initialize a variable in where.c to avoid a valgrind warning. file: [9981707a] check-in: [4d59df02] user: dan branch: trunk, size: 178344
2016-07-26
18:06
Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases. file: [e7054b2c] check-in: [061b8006] user: dan branch: rowvalue, size: 180619
2016-07-09
20:23
Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch. file: [898a4596] check-in: [b2204215] user: dan branch: rowvalue, size: 180561
2016-06-26
04:06
Prevent the WhereLoop.rSetup cost estimate from going negative on complex queries. file: [48eed8eb] check-in: [f8105085] user: drh branch: trunk, size: 178340
2016-06-23
12:35
Fix the build for -DSQLITE_OMIT_VIRTUALTABLE file: [0ce47934] check-in: [91113142] user: drh branch: trunk, size: 178293
2016-06-08
18:07
Prefer to use partial indexes for full table scans when that is possible. file: [74f07985] check-in: [fe187432] user: drh branch: trunk, size: 178217
2016-05-27
12:30
Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and show more details on WhereTerm traces. file: [b9f5b0dd] check-in: [71087c12] user: drh branch: trunk, size: 178182
2016-05-19
22:40
Appears to work now. Needs test cases, more comments, and code optimization. file: [0e54a03d] check-in: [990fe50c] user: drh branch: orderby-limit, size: 177646
22:13
In a query with both ORDER BY and LIMIT, if the inner loop satisfies the ORDER BY then try to cut short each invocation of the inner loop once the LIMIT has been satisfied. This check-in is a partial implementation only. file: [a7454e62] check-in: [852d1eda] user: drh branch: orderby-limit, size: 176988
18:56
Clean up the WHERE_* macros used for the wctrlFlags parameter on the sqlite3WhereBegin() interface, freeing up some bits to be used for other things. file: [72fd2e12] check-in: [d0130584] user: drh branch: trunk, size: 176552
2016-05-09
19:58
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. file: [ad8ad50c] check-in: [da94a6e0] user: drh branch: dev, size: 176573
2016-05-06
18:47
Corrections to comments on the whereScanInit() interface. file: [fd321cc2] check-in: [ab7ab415] user: drh branch: trunk, size: 176609
11:31
Do not scan indexes that have the integer primary key as their left-most column. This fixes the crash of ticket [16c9801ceba] but it seems like the wrong fix. More investigation needed. file: [a7ce00ff] check-in: [50312273] user: drh branch: ticket-16c9801ce, size: 176425
2016-05-02
10:25
Improvements to the way the LIKE optimization is implemented, resulting in slightly smaller and faster code that is easier to test. file: [019e5b10] check-in: [54c63b32] user: drh branch: trunk, size: 176418
2016-04-15
22:03
Add the SQLITE_SkipAhead optimization setting file: [de4e7665] check-in: [87703b76] user: drh branch: skip-ahead-distinct, size: 178537
16:27
Skip-ahead is now just an optimization. If it gets confused, it falls back to an incremental scan with redundancy elimination. file: [64689b97] check-in: [6fac0b92] user: drh branch: skip-ahead-distinct, size: 178485
15:54
Fixes to the skip-ahead distinct logic. More issues remain. file: [3521afa6] check-in: [45a70b2b] user: drh branch: skip-ahead-distinct, size: 178419
13:24
Fixed crash bugs. Still sometimes gets the wrong answers. file: [ded0cf90] check-in: [2afcb2c7] user: drh branch: skip-ahead-distinct, size: 177652
01:55
Progress toward getting DISTINCT to use a seek to advance to the next distinct row, when driven by an appropriate index. file: [19ad1e88] check-in: [9e14aa14] user: drh branch: skip-ahead-distinct, size: 177559
2016-04-14
13:35
Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. file: [bae50f2f] check-in: [53179614] user: drh branch: trunk, size: 176526
2016-04-09
14:36
Limit the number of digits shown in the "prereq" mask for ".wheretrace" debugging output. file: [24ab5614] check-in: [3686ed74] user: drh branch: trunk, size: 176478
2016-03-31
21:16
Enhance the query planner so that IS and IS NULL operators are able to drive an index on a LEFT OUTER JOIN. file: [f06ac362] check-in: [f1e6bb95] user: drh branch: branch-3.9, size: 171637
20:40
Enhance the query planner so that IS and IS NULL operators are able to drive an index on a LEFT OUTER JOIN. file: [99cc6270] check-in: [c648539b] user: drh branch: trunk, size: 176426
2016-03-16
18:26
Fix the query planner so that it is able to use the integer primary key from an index as part of a multi-column constraint. file: [fe7925fa] check-in: [96ea9909] user: drh branch: trunk, size: 176154
2016-03-15
09:42
Update this branch with latest trunk changes. file: [b8566be7] check-in: [249cd361] user: dan branch: schemalint, size: 179464
2016-03-09
12:35
In the query planner, make sure OOM errors are reported up into whereLoopAddVirtual() so that it shuts down appropriately. file: [5533002d] check-in: [a13c59d0] user: drh branch: trunk, size: 176097
08:08
Merge latest trunk changes with this branch. file: [2cbcacd9] check-in: [59caca43] user: dan branch: schemalint, size: 179458
08:07
Fix a problem in the schemalint code that comes up when a sub-query uses one or more of the same tables as its parent. file: [59f267a5] check-in: [fc18cc92] user: dan branch: schemalint, size: 175189
2016-03-08
23:44
Change an unreachable branch in the virtual table query planner into an assert(). file: [f2859a4f] check-in: [73b97b9e] user: drh branch: trunk, size: 176091
23:18
Improved comments on virtual table query planning. Added many new WHERETRACE() macros. file: [a3f6db08] check-in: [4c89c253] user: drh branch: trunk, size: 176149
02:59
Simplified error detection in the xBestIndex processing. file: [dff52f7f] check-in: [82ca2131] user: drh branch: trunk, size: 175517
01:32
Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)". file: [e4d2d0ea] check-in: [91bd619d] user: drh branch: trunk, size: 175346
01:11
Add a NEVER() to the code generator. Change the parameter name "mExtra" to "mPrereq" in the query planner, to more closely reflect its meaning. file: [3787158e] check-in: [721ae51e] user: drh branch: trunk, size: 175366
2016-03-05
21:32
Fix a problem in the previous commit affecting queries with three or more tables joined together to the right of a LEFT or CROSS JOIN operator. file: [ccc62c39] check-in: [d8d89d69] user: dan branch: trunk, size: 175335
17:29
Change the way SQLite invokes the xBestIndex method of virtual tables so that N-way joins involving virtual tables work as expected. file: [bada38bf] check-in: [ffc65968] user: dan branch: xbestindex-fix, size: 175328
2016-03-04
18:45
Merge changes from trunk. file: [2b61974a] check-in: [5294c977] user: drh branch: analyze-worst-case, size: 172210
2016-03-02
03:28
Allow the left-hand side of IN operators on virtual tables to have the aConstraintUsage[].omit flag clear. file: [56948ada] check-in: [1622623c] user: drh branch: vtab-IN-opt, size: 172185
2016-03-01
22:41
Improved debugging output with wheretrace. Fix some typos in test script comments. file: [6282e53f] check-in: [13a37fd4] user: drh branch: trunk, size: 172525
2016-02-29
21:27
The ANALYZE command automatically appends "noskipscan" to sqlite_stat1 entries that have large worst-case repeat estimates but small average repeat estimates. file: [2786a5f3] check-in: [6326ba58] user: drh branch: analyze-worst-case, size: 172507
2016-02-25
23:21
Fix an incorrect cost computation for sorting (introduced just a few check-ins ago). Should be NlogN, not NloglogN. file: [32051597] check-in: [2459d323] user: drh branch: trunk, size: 172482
18:22
Improvement on the previous check-in: disallow automatic indexes for any loop that is expected to run less than twice. file: [b21a2b3c] check-in: [aab53a21] user: drh branch: planner-improvements, size: 172505
18:03
Do not use an automatic index on an outer loop that only runs once. file: [07bf0330] check-in: [5957e793] user: drh branch: planner-improvements, size: 172507
16:04
Take the LIMIT clause into account when estimating the cost of sorting. file: [ba8f2cd9] check-in: [d491745c] user: drh branch: planner-improvements, size: 172246
2016-02-22
19:51
Add test script shell6.test, containing tests for schemalint. file: [0ecce6da] check-in: [0b734065] user: dan branch: schemalint, size: 175232
2016-02-13
23:43
Enhance ability to debug out-of-memory errors. file: [5b67fb80] check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 171575
2016-02-12
00:13
Remove an unused parameter from whereSortingCost(). file: [98408458] check-in: [b5d77199] user: drh branch: trunk, size: 171540
2016-02-11
21:55
Remove the unexplained extra 3.0 cost factor for the B-tree sorting that is done to implement DISTINCT in the absence of an index to help. file: [f9683f8b] check-in: [52571991] user: drh branch: trunk, size: 171569
21:01
Experimental integration of schemalint functionality with the shell tool. Does not work yet. file: [89d58453] check-in: [ed49f297] user: dan branch: schemalint, size: 175119
2016-02-09
15:10
Merge latest trunk changes with this branch. file: [438b89ca] check-in: [1a4182ee] user: dan branch: schemalint, size: 176903
2016-02-05
13:38
Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majority cases where db is guaranteed to be not NULL. file: [d89fd5cf] check-in: [0a802e96] user: drh branch: oom-handling, size: 171822
01:55
Improvements to the way that OOM errors are processed. file: [8bdb43e0] check-in: [c3ef0347] user: drh branch: oom-handling, size: 171816
2016-02-04
02:34
Add and use the sqlite3VdbeZeroRegister() interface for coding the common operation of writing zero into a register. file: [623e4551] check-in: [1c8d3001] user: drh branch: zero-register, size: 171808
2016-01-26
15:23
Change the automatic index mechanism so that it avoids creating transient indexes on columns that are known to have low cardinality. file: [3e70fe90] check-in: [12ef3a8f] user: drh branch: autoindex-planning, size: 172010
2016-01-22
14:46
Merge latest trunk changes into this branch. file: [4610f0b9] check-in: [9341491c] user: dan branch: schemalint, size: 176898
14:44
Fix handling of transitive constraints in schemalint.tcl. file: [1e987b91] check-in: [44edc1aa] user: dan branch: schemalint, size: 176819
2016-01-21
15:55
Improved comments on the FORDELETE hint. No logic changes. file: [af9bf5dc] check-in: [a3cec529] user: drh branch: trunk, size: 171817
2016-01-11
22:58
Performance optimization in the sqlite3VdbeChangeP4() routine of the code generator. file: [bb69654f] check-in: [28bd8d5f] user: drh branch: trunk, size: 171874
2015-12-30
16:51
Changes to the way that the default BINARY collating sequence is recorded result in a slightly smaller and slightly faster executable. More work could be done to make this cleaner. file: [c6d3d2f6] check-in: [2081d757] user: drh branch: trunk, size: 171928
2015-12-12
17:31
Add further tests for the changes on this branch. Also fix a memory-leak that could follow a malloc failure. file: [b7462d37] check-in: [21526012] user: dan branch: onepass-delete-or, size: 174382
2015-12-09
10:06
Add simple tests and bugfixes for DELETE statements that qualify for the OR-optimization. file: [b3b70c8e] check-in: [10ca7357] user: dan branch: onepass-delete-or, size: 173735
2015-12-08
19:50
Experimental optimization for DELETE statements with WHERE clauses that qualify for the OR-optimization. file: [93f5c7ec] check-in: [d52376df] user: dan branch: onepass-delete-or, size: 173763
2015-12-01
21:23
Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. file: [b18edbb9] check-in: [9e1d6d4c] user: drh branch: trunk, size: 171896
2015-11-30
18:17
Fix the schemalint.tcl script to handle identifiers that require quoting. file: [be09f4a0] check-in: [451e0faf] user: dan branch: schemalint, size: 176791
2015-11-26
19:33
Add the "colUsed" field to the sqlite3_index_info structure passed to virtual table xBestIndex methods. To indicate the subset of the virtual table columns that may be required by the current scan. file: [9c04982b] check-in: [116b2064] user: dan branch: vtab-colused, size: 171850
2015-11-23
21:09
Add experimental support for LIKE, GLOB and REGEXP to the virtual table interface. file: [6687fb26] check-in: [277a5b40] user: dan branch: vtab-like-operator, size: 171796
2015-11-20
20:55
Add support for ORDER BY clauses to schemalint.tcl. file: [58049022] check-in: [93bdf70e] user: dan branch: schemalint, size: 176691
2015-11-11
18:08
Add a hack to debug out a description of the WHERE clause of a SELECT (or other) statement. Use this in script tool/schemalint.tcl to automatically recommend indexes that might speed up specific queries. file: [61764263] check-in: [c6fa01c2] user: dan branch: schemalint, size: 175780
2015-10-26
20:11
Merge the BTREE_FORDELETE enhancement with this branch. file: [6aceb72c] check-in: [20da0849] user: dan branch: cursor-hints, size: 171738
18:51
Merge in all trunk changes prior to the BTREE_FORDELETE enhancement. file: [51cca249] check-in: [53d5a4ad] user: drh branch: cursor-hints, size: 171482
17:50
Provide the BTREE_FORDELETE flag to sqlite3BtreeCursor() if the cursor will be used only for deletions and seeking. file: [0a3badc4] check-in: [871b1c78] user: drh branch: trunk, size: 171571
14:54
Fix a C99-ism and a harmless compiler warning. file: [7b9e8d72] check-in: [138783b5] user: drh branch: trunk, size: 171365
2015-10-24
20:31
When creating an automatic-index on a sub-query, add a unique integer to the end of each index key to ensure the entire key is unique. Fix for [8a2adec1]. file: [e3724b7b] check-in: [bfea226d] user: dan branch: trunk, size: 171365
2015-10-22
20:54
Modifications to pass a flag to internal routine sqlite3BtreeCursor() when a cursor that is used solely for deleting b-tree entries, or for obtaining the components of keys to delete from other b-trees, is opened. file: [0bb01a05] check-in: [cdc92919] user: dan branch: btree-fordelete-flag, size: 170749
2015-10-14
20:09
Merge in all the 3.9.0 updates from trunk. file: [05a178b7] check-in: [29444149] user: drh branch: cursor-hints, size: 170660
2015-09-29
17:20
Use symbolic names XN_ROWID and XN_EXPR in place of the (-1) and (-2) magic numbers in Index.aiColumn[]. Add asserts to help verify that Index.aiColumn[] is always used correctly. Fix one place in FK processing where Index.aiColumn[] was not being used correctly. file: [4c464667] check-in: [7d272aa6] user: drh branch: trunk, size: 170543
11:59
Merge latest trunk change into this branch. file: [b7f928b6] check-in: [b519c0d6] user: dan branch: vtab-onepass, size: 170443
11:57
Change the name of the new sqlite3_index_info.flags field to "idxFlags". Add documentation for the same to sqlite.h.in. file: [6491ebe8] check-in: [f61203bc] user: dan branch: vtab-onepass, size: 170146
2015-09-28
23:45
Avoid unnecessary cursors and seeking when running a DELETE against a WITHOUT ROWID table. file: [e779853a] check-in: [70ec88b2] user: drh branch: delete-without-rowid-opt, size: 170509
17:05
Extra information provided by .wheretrace on input flags to the query planner and on the result of sqlite3WhereOkOnePass(). file: [25d75272] check-in: [c5566bb3] user: drh branch: trunk, size: 170050
15:20
Changes to allow DELETE operations on virtual tables to use the onepass strategy under some circumstances. file: [d07fb770] check-in: [e73f919f] user: dan branch: vtab-onepass, size: 170137
14:40
Fix a database corruption bug caused by the ONEPASS optimization added in check-in [8b93cc5937000535]. Bug detected (prior to release) by sqllogictest. Test cases to follow. file: [f2c4905e] check-in: [9d057f52] user: drh branch: trunk, size: 169753
2015-09-25
01:09
Fix a problem computing affinities for indexes during skip-scan code generation when SQLITE_ENABLE_STAT4 is on. Bug introduced by check-in [1ee089a72d789002]. file: [a7582b75] check-in: [1350dd42] user: drh branch: trunk, size: 169677
2015-09-24
18:47
Enhance the query planner so that it is able to use indexed expressions to help fulfill an ORDER BY clause. file: [278073aa] check-in: [668fc1eb] user: drh branch: trunk, size: 169666
17:38
Fix over-length source code lines in where.c. No logic changes. file: [6f7156dc] check-in: [1c8c5380] user: drh branch: trunk, size: 169220
15:06
Merge trunk changes into the cursor-hints branch. file: [edcaa18b] check-in: [fbe63762] user: drh branch: cursor-hints, size: 169344
12:19
Make sure joins work correctly when both sides of the join are connected using indexed expressions. file: [d5eed258] check-in: [c2fcb032] user: drh branch: trunk, size: 169227
11:26
Correctly handle the case of a WHERE-clause term with indexed expressions on both sides of the == sign. file: [64a80b1c] check-in: [d9b716a6] user: drh branch: trunk, size: 169222
2015-09-15
17:31
Merge enhancements from trunk. file: [c03895cd] check-in: [66fe0683] user: drh branch: cursor-hints, size: 169362
2015-09-14
14:45
Use symbolic names ONEPASS_OFF, ONEPASS_SINGLE, and ONEPASS_MULTI for the various modes of the one-pass optimization. file: [882fb44b] check-in: [16e56bda] user: drh branch: trunk, size: 169245
2015-09-12
19:26
Experimental change to use a single-pass approach for DELETE statements on non-virtual tables that do not fire triggers or require foriegn-key processing. file: [98cbedea] check-in: [eaeb2b80] user: dan branch: onepass-delete, size: 168953
2015-09-09
17:23
Fix harmless compiler warning. file: [1227687e] check-in: [280fd3a4] user: mistachkin branch: trunk, size: 168615
2015-09-05
19:21
Fix an unreachable conditional in the WHERE clause analysis logic. file: [ed1cd1cb] check-in: [24924a58] user: drh branch: trunk, size: 168611
2015-09-03
14:39
Merge enhancements from trunk. file: [6055bee2] check-in: [25ee3000] user: drh branch: cursor-hints, size: 168263
14:18
Merge enhancements from trunk. file: [e6efbb9e] check-in: [1ab10cbf] user: drh branch: index-expr, size: 168588
13:46
Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). file: [f0e08e4f] check-in: [847387ec] user: drh branch: trunk, size: 168146
2015-09-02
18:19
Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). file: [8f3a40cc] check-in: [be78f413] user: drh branch: trunk, size: 168155
2015-09-01
18:31
Merge enhancements from trunk. file: [5efdfbfa] check-in: [29570a60] user: drh branch: cursor-hints, size: 168305
00:42
Remove unreachable branches. file: [567b96aa] check-in: [fd4da231] user: drh branch: index-expr, size: 168630
2015-08-31
19:38
Always assume that indexed expressions can generate a NULL. Get indexed expressions working for the case of two or more expressions in the same index. file: [04e0f87e] check-in: [cc60321a] user: drh branch: index-expr, size: 168642
15:58
Improved analysis and usage of indexed expressions in the query planner. file: [385f927f] check-in: [f8893696] user: drh branch: index-expr, size: 168633
2015-08-27
23:42
Fix the OR-optimization so that it always ignores subplans that do not use an index. file: [acec45dc] check-in: [cf452028] user: drh branch: index-expr, size: 168951
23:18
Fix the OR-optimization so that it always ignores subplans that do not use an index. file: [91e73ffc] check-in: [66f92a16] user: drh branch: trunk, size: 168188
20:33
Fix EXPLAIN QUERY PLAN output for indexed-expressions. Fix another obscure fault in the WHERE term scanner. file: [b22b4166] check-in: [73d361ce] user: drh branch: index-expr, size: 168902
19:56
Fix problems in the indexed-expression handling in the optimizer. file: [fcdded4b] check-in: [03375017] user: drh branch: index-expr, size: 168925
18:24
Activate the ability to use expressions in indexes in a query. There are some test failures, but mostly this seems to work. file: [29851b4a] check-in: [42f93f58] user: drh branch: index-expr, size: 168830
16:07
Merge changes from trunk. file: [7b62bfb9] check-in: [c80e9e8e] user: drh branch: index-expr, size: 168566
15:58
Adjustments to the WHERE term scanning, to better handle scanning terms of an index. file: [0709bbc3] check-in: [5611130a] user: drh branch: index-expr, size: 168697
2015-08-26
21:08
Reduce the size of the WhereScan object by 24 bytes while also clarifying its operation. file: [caabc9ec] check-in: [cbc3c9a8] user: drh branch: trunk, size: 168139
2015-08-25
19:42
Move sqlite3IndexColumnAffinity() inside of SQLITE_ENABLE_STAT3_OR_STAT4. file: [fb8546b8] check-in: [b3732a4e] user: drh branch: trunk, size: 168270
19:20
Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the affinity of an index column. file: [30091fb3] check-in: [1ee089a7] user: drh branch: trunk, size: 167955
2015-08-20
23:45
Merge recent enhancements from trunk, including table-valued expressions. file: [746317b8] check-in: [b9927c87] user: drh branch: cursor-hints, size: 168112
2015-08-19
17:11
A list of arguments following a table name translates into equality constraints against hidden columns in that table. file: [66518a14] check-in: [40e12cfe] user: drh branch: table-valued-functions, size: 167995
15:20
Minor refactor of the SrcList object so that it is able to hold the argument list to a table-valued-function in the FROM clause. file: [a572b239] check-in: [b9193761] user: drh branch: table-valued-functions, size: 167926
2015-08-14
18:50
Fix the cursor hint mechanism so that it does the right thing for indexed lookups. file: [ef95e56b] check-in: [581e3d49] user: drh branch: cursor-hints, size: 167985
2015-08-07
20:57
Enhance the query planner so that it is able to use partial indexes that use AND-connected terms in the WHERE clause. file: [c745d3aa] check-in: [06576590] user: drh branch: trunk, size: 167868
2015-06-12
12:54
Add the OP_ColumnsUsed opcode (when compiled with SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which columns of a btree cursor will be used. file: [909eba3b] check-in: [711a176c] user: drh branch: trunk, size: 167735
2015-06-10
20:00
Merge enhancements from trunk. file: [aa26f4b0] check-in: [0e23a079] user: drh branch: view-optimization, size: 167592
17:20
Resolve FROM-clause subqueries after query planning instead of before. Greatly reduce the estimated cost of automatic indexes for VIEWs and ephemeral tables since performance problems there cannot be mitigated via a CREATE INDEX. file: [6a42bd33] check-in: [a1eaf171] user: drh branch: view-optimization, size: 165675
2015-06-09
10:58
Remove some repeated lines of source code. Probably introduced by careless cut'n'pasting. file: [95c0fbff] check-in: [a34cd71c] user: dan branch: vtab-left-join, size: 166996
2015-06-08
22:59
Code refactoring to try to shift FROM-clause subquery manifesting until after the query planner runs. Except this does not currently work because the query planner needs an estimated of the number of rows in the manifested table. Work in progress. file: [fbd93e76] check-in: [cabf2187] user: drh branch: view-optimization, size: 165589
18:48
If a query contains "FROM t1 LEFT JOIN t2, t3, t4", ensure that tables t3 and t4 are not scanned before t2. The trunk already does this. file: [d98dd946] check-in: [0d9edfab] user: dan branch: vtab-left-join, size: 167045
18:05
Avoid passing constraints that are unusable due to LEFT or CROSS joins to virtual table xBestIndex() methods. file: [38b2c4be] check-in: [80ee56dd] user: dan branch: vtab-left-join, size: 166968
14:23
Split more subfunctions of where.c out into a new whereexpr.c source file, for improved maintainability. file: [a328fcc3] check-in: [46ef95c1] user: drh branch: view-optimization, size: 165079
2015-06-06
20:12
Split out the bulk of the actual VDBE code generation logic from where.c into a new file, leaving behind the analysis logic. This makes the original where.c smaller and hopefully easier to edit. file: [c9d804dc] check-in: [faa0e420] user: drh branch: view-optimization, size: 209992
18:30
Code simplifications in select.c and where.c. file: [5cc416ad] check-in: [4f20ac90] user: drh branch: view-optimization, size: 269275
2015-06-05
15:59
Add a new opcode to the VDBE that gives the b-tree a hint about the set of columns in a table or index that are actually used by the query. file: [f957a398] check-in: [f167bba4] user: drh branch: column-usage-hint, size: 270109
2015-06-04
12:08
Change the name of SrcList.a[].zIndex to the more descriptive SrcList.a[0].zIndexedBy. file: [2db8137f] check-in: [6a9cf063] user: drh branch: trunk, size: 269370
2015-06-02
15:32
Rename SQLITE_AFF_NONE to SQLITE_AFF_BLOB. file: [dcdfee81] check-in: [bce3f041] user: drh branch: blob-affinity-rename, size: 269366
2015-05-29
14:36
Add some extra source-code comments and a test case. file: [f6f41c2f] check-in: [6d410442] user: drh branch: coroutine-autoindex, size: 269353
13:55
An attempt to allow automatic index creation on subqueries accessed via co-routine. file: [5eb9ab47] check-in: [521345ad] user: drh branch: coroutine-autoindex, size: 269106
2015-05-20
19:34
Fix a problem causing collation sequence names to be dequoted multiple times under some circumstances. Cherrypick of [eddc05e7bb31]. file: [96ff2c97] check-in: [fc1a4f29] user: dan branch: branch-3.8.6, size: 245252
2015-05-18
12:18
Use an ALWAY() on conditionals in the transitive constraint logic that are always true as far as we know. file: [e71eae3b] check-in: [204e567f] user: drh branch: transitive-constraints, size: 267863
11:34
Refinements to the determination of when an A==B term is an equivalence. Add test cases. file: [68369923] check-in: [6bfaf525] user: drh branch: transitive-constraints, size: 267744
2015-05-16
20:51
Further restrictions on the use of the transitive property in WHERE clauses. file: [ca8d3b5b] check-in: [8c886c43] user: drh branch: transitive-constraints, size: 267558
19:17
Fix the transitive constraint processing to only allow transitivity if the operands of the == or IS operator have compatible affinities. file: [58c0161b] check-in: [a46a247f] user: drh branch: transitive-constraints, size: 266903
18:31
Fix a typo in a comment. No changes to code. file: [430ae75d] check-in: [ee4b7425] user: drh branch: trunk, size: 266154
2015-05-15
20:14
Minor coding style change, adjust new local variable casing for consistency. file: [8b319f2a] check-in: [1a4628c6] user: mistachkin branch: trunk, size: 266157
19:59
Do not assume that "col IS ?" matches at most a single row of a UNIQUE column unless the column is also NOT NULL. file: [78dd9fc7] check-in: [e038ce89] user: dan branch: trunk, size: 266157
2015-05-14
13:41
More test cases. Remove some invalid testcase() macros. Rearrange some code for improved testability. file: [08fadd0d] check-in: [b3676377] user: drh branch: index-is-operator, size: 266087
13:18
Add testcase() macros. Get transitive WHERE clause constraints on IS operators working again. file: [cabecc4a] check-in: [d195d4a6] user: drh branch: index-is-operator, size: 266181
08:58
Merge latest trunk changes with this branch. file: [f6c34b6a] check-in: [299ed55c] user: dan branch: ota-update, size: 265766
01:05
A new implementation of indexing with the IS operator that works correctly when the IS operator is in the WHERE clause and the operands are from opposite sides of a LEFT JOIN. file: [64afb483] check-in: [4541688b] user: drh branch: index-is-operator, size: 266040
2015-05-13
19:33
Simplified implementation of indexing with the IS operator. file: [fa61aca1] check-in: [95b1f9bf] user: drh branch: index-is-operator, size: 265788
17:54
Add testcase() macros and comments and a few test-cases. file: [98964edb] check-in: [24263d08] user: drh branch: index-is-operator, size: 265992
15:24
An early attempt to get indexes to work with the IS operator. This code passes tests, but much more testing is needed to verify that it works on all corner cases. file: [48e3c1f0] check-in: [6f7f1673] user: drh branch: index-is-operator, size: 265472
2015-05-02
11:45
Cleanup of the sqlite3StrAccumInit() function. No functionality changes. file: [85fff9c4] check-in: [7952c322] user: drh branch: trunk, size: 265384
2015-04-25
12:20
Fix an obscure memory leak that could follow an OOM in where.c. file: [52c524b8] check-in: [08ec9f2f] user: dan branch: trunk, size: 265397
2015-04-23
19:32
Merge latest trunk changes into this branch. file: [80998bcd] check-in: [1506e99e] user: dan branch: ota-update, size: 265600
2015-04-22
14:41
Prototype for an sqlite3_db_log() interface. file: [ba0839e7] check-in: [658e20f5] user: drh branch: sqlite3_db_log, size: 265233
2015-04-21
02:12
Make sure the whereSplit() routine in the query planner is not confused by the likely() operator. file: [32fe265e] check-in: [588db14f] user: drh branch: trunk, size: 265218
2015-04-19
23:48
Fix another harmless compiler warning. file: [723b4f61] check-in: [5ae853aa] user: mistachkin branch: vsix2015, size: 265181
2015-04-15
14:26
Merge all recent trunk enhancements and fixes into the ota-update branch. file: [7e5d9a56] check-in: [9bd3e445] user: drh branch: ota-update, size: 265575
07:34
Remove an incorrect ALWAYS() from the automatic index generator. file: [8ba8ff31] check-in: [eeb4bd06] user: drh branch: trunk, size: 265193
05:31
Correctly deal with an unknown collating sequence on an indexed DISTINCT query. file: [8a05434f] check-in: [a0b6e2fe] user: drh branch: trunk, size: 265201
2015-04-12
01:22
Avoid problems when a query has a GROUP BY and an ORDER BY but no FROM clause. file: [9952e474] check-in: [e527d96a] user: drh branch: trunk, size: 265209
2015-04-11
11:44
Do not assume an index contains unique entries unless it is declared UNIQUE and NOT NULL is specified for all columns. Fix for [7b4fee9f6c]. file: [bd435b75] check-in: [e3b1f625] user: dan branch: trunk, size: 265198
2015-03-25
15:23
Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns. file: [bc7276b6] check-in: [4e8796af] user: dan branch: ota-update, size: 265580
2015-03-24
18:21
Merge the latest trunk changes into this branch. file: [d336e918] check-in: [9d9b6c88] user: dan branch: ota-update, size: 265390
2015-03-20
14:57
Provide the BTREE_SEEK_EQ hint to the b-tree layer. file: [85d832ef] check-in: [e750830f] user: drh branch: seek-eq, size: 265198
08:43
Fix a problem causing collation sequence names to be dequoted multiple times under some circumstances. file: [6dc10d18] check-in: [eddc05e7] user: dan branch: trunk, size: 264932
2015-03-18
20:03
Allow whereShortCut() to use the PRIMARY KEY index of a WITHOUT ROWID table to optimize a vector of "IS" operators in a WHERE clause. file: [67c11509] check-in: [52e73eec] user: dan branch: ota-update, size: 257754
2015-03-16
20:40
Make SQLite slightly more likely to use an auto-index within a sub-query. file: [42ce3fd5] check-in: [ab832336] user: dan branch: trunk, size: 264949
17:48
When the WHERE clause contains two OR-connected terms with identical operands but different operators, try to combine them into a single term. Example: (X=A OR X>A) becomes (X>=A). file: [5ca2899f] check-in: [8bdda827] user: drh branch: trunk, size: 264949
13:12
Improved comments. No code changes. file: [235b1f50] check-in: [23f71a26] user: drh branch: combine-disjuncts, size: 260926
12:13
When a WHERE clause contains disjuncts with the same operands, try to combine them into a single operator. Example: (x=A OR x>A) becomes (x>=A). file: [b879a02e] check-in: [7a309768] user: drh branch: combine-disjuncts, size: 260779
2015-03-14
18:59
When estimating the number of rows visited by a range scan for which the keys consist of more than one field, consider prefixes of stat4 samples as well as the full samples. file: [5a4e4ab3] check-in: [e1caf93c] user: dan branch: stat4-change, size: 261585
2015-03-09
13:01
Fix the LIKE optimization so that it works even if there are additional range contraints on the column that is subject to the LIKE or GLOB. file: [eb141b07] check-in: [984c3fd5] user: drh branch: trunk, size: 257562
12:11
Always use LIKE optimization range constraints in pairs. file: [21c96bc0] check-in: [0e02dc94] user: drh branch: like-opt-fix, size: 257323
2015-03-07
20:32
Fix another problem with the LIKE optimization. file: [65813699] check-in: [465bfc72] user: drh branch: like-opt-fix, size: 256480
03:02
Remove some code that is commented out. file: [84104123] check-in: [55ff4291] user: drh branch: like-opt-fix, size: 256230
02:51
Fix problems with reverse order sorting and indexes in the LIKE optimization. file: [efa0cef9] check-in: [564b8fe7] user: drh branch: like-opt-fix, size: 256342
00:57
Refactor some jump opcodes in the VDBE. Add JumpZeroIncr and DecrJumpZero. Fix the LIKE optimization to work with DESC sort order. file: [7c646a15] check-in: [26cb5145] user: drh branch: like-opt-fix, size: 256067
2015-03-06
20:49
Test cases added. Comments fixed. Proposed solution for ticket [05f43be8fdda9fbd9]. file: [8cd4fc29] check-in: [6b993bd5] user: drh branch: like-opt-fix, size: 255673
19:47
Fix the LIKE optimization even when comparing mixed-case BLOBs. file: [cace7eef] check-in: [a58aafdb] user: drh branch: like-opt-fix, size: 255099
16:45
The LIKE optimization must be applied twice, once for strings and a second time for BLOBs. Ticket [05f43be8fdda9f]. This check-in is a proof-of-concept of how that might be done. file: [b7e82341] check-in: [5757e803] user: drh branch: like-opt-fix, size: 253753
2015-03-02
17:25
Ensure that automatic indexes are *not* considered when doing the the subqueries of the OR-optimization. file: [c1b37069] check-in: [17890292] user: drh branch: trunk, size: 252160
2015-02-25
00:24
Remove an always-false conditional from constructAutomaticIndex(). Put an assert() in its place to prove that the conditional is always false. file: [a50d5082] check-in: [3af300bf] user: drh branch: trunk, size: 252072
2015-02-24
20:10
Prevent partial indexes on the table on the left hand side of a LEFT JOIN from being incorrectly qualified by a constraint in the ON clause of the join. This relaxes the rule introduced by the previous commit (as the partial indexes on the table on the rhs of the LEFT JOIN may now be qualified by terms within the ON clause). file: [294423cf] check-in: [1d6fb43a] user: dan branch: trunk, size: 251874
16:48
This additional fix prevents a partial index from being qualified for use if the constraint that qualifies the partial index is part of the ON clause of a LEFT JOIN. file: [88509f19] check-in: [1a1516e4] user: drh branch: tkt-2326c258, size: 251765
16:05
Make sure partial automatic indexes are not based on terms in the ON clause of a LEFT JOIN. Fix for ticket [2326c258d02ead3]. UPDATE: This fix does not work where the partial index is a named index. file: [59ab7da7] check-in: [c0f4e308] user: drh branch: tkt-2326c258, size: 251696
2014-12-12
00:20
Fix a bug in the threadtest4.c program. Remove the keyinfo cache as it provides minimal performance improvements, and then only at SQL preparation time, not at runtime, and it has problems with data races in shared-cache mode. We might later add the keyinfo cache back but only enable it when shared-cache mode is off. file: [d46de821] check-in: [b7489f94] user: drh branch: threadtest4, size: 251644
2014-12-05
21:18
Avoid a potential NULL pointer deference in the sqlite3_stmt_scanstatus() logic. file: [e914fdb9] check-in: [42d44adc] user: drh branch: trunk, size: 251700
19:50
Make sure the WhereTerm objects are fully zeroed when they are allocated. file: [8877b55e] check-in: [fdb66733] user: drh branch: trunk, size: 251682
2014-12-04
20:24
Performance enhancement for single-table queries with many OR-connected WHERE clause terms and multiple indexes with the same left-most columns. file: [d67fe69d] check-in: [1461d543] user: drh branch: trunk, size: 251603
2014-11-22
19:52
Fix an error in the comments from the previous check-in. file: [a0b16f9d] check-in: [9660ce54] user: drh branch: trunk, size: 251670
18:50
Deploy heuristics (well-commented) to better estimate how much unindexed terms in the WHERE clause filter the number of output rows from a single table. file: [33285024] check-in: [22165994] user: drh branch: trunk, size: 251667
16:14
Unintentional edits mistakenly checked in. Was: Remove an obsolete and incorrect comment from the whereLoopOutputAdjust() routine in the query planner. No changes to working code. file: [46dd9b76] check-in: [e1f893c6] user: drh branch: mistake, size: 250186
12:22
Remove a redundant test case (probably a copy/paste error). Add an assert() to where.c to ensure that automatic indexes do not have there output row counts adjusted downward by supplementary constraints. file: [13a99204] check-in: [eea47933] user: drh branch: trunk, size: 250324
2014-11-18
21:54
Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. file: [e275cb74] check-in: [4461bf04] user: drh branch: trunk, size: 250272
2014-11-15
19:08
Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. file: [cb89128d] check-in: [00fe0950] user: drh branch: noskipscan-token, size: 250216
2014-11-14
19:34
Consider using an automatic-index for a scan even if there exists a possible skip-scan that uses one or more "=" operators. file: [4d72a350] check-in: [93642a65] user: dan branch: experimental-autoindex-fix, size: 250244
2014-11-06
03:55
Change the SQLITE_SCANSTAT_EST parameter so that it returns a double for the estimated number of output rows per loop, rather than a 64-bit integer. Revise the output format for the ".scanstats on" in the shell to make use of this new capability. file: [3862a117] check-in: [f9684000] user: drh branch: scanstatus, size: 250188
2014-11-05
19:26
Change the query planner to do a better job of estimating the number rows selected by a BETWEEN operator using STAT4 when both upper and lower bounds are contained within the same sample. file: [2c2081c5] check-in: [2d36be5d] user: drh branch: trunk, size: 250270
13:13
Enhance whereLoopCheaperProperSubset(X,Y) so that it does not report true if X uses skip-scan less than Y, since in that case X might deserve to be cheaper even if it is a proper subset. file: [24096104] check-in: [c106b755] user: drh branch: trunk, size: 249504
2014-11-03
15:33
Add further tests. Fixes so that compilation without ENABLE_STMT_SCANSTATUS works. file: [d5fa1081] check-in: [a2303c71] user: dan branch: scanstatus, size: 249416
11:25
Remove unused variable from struct WhereInfo. Add some explanatory comments to new code. file: [53dae5ed] check-in: [f5313e0c] user: dan branch: scanstatus, size: 249406
2014-11-01
21:00
Minor performance enhancements to SQLITE_ENABLE_STMT_SCANSTATUS code. file: [ad4a3bca] check-in: [f13d6ba8] user: dan branch: scanstatus, size: 248618
20:38
If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand. file: [fb404e3d] check-in: [9ea37422] user: dan branch: scanstatus, size: 248569
18:08
Minor fixes and documentation improvements for sqlite3_stmt_scanstatus(). file: [636ca646] check-in: [8d8cc960] user: dan branch: scanstatus, size: 249143
2014-10-31
20:11
Add the experimental sqlite3_stmt_scanstatus() API. file: [344beac0] check-in: [6a9bab34] user: dan branch: scanstatus, size: 248662
2014-10-28
15:58
Trivial simplification to the automatic index logic. file: [5665df88] check-in: [23073a05] user: drh branch: trunk, size: 247514
2014-10-25
13:42
Increase the resolution of the second parameter to the likelihood() SQL function (the probability value) so that it can handle probabilities as small as 0.00000001. Formerly, it ran out of precision at 0.001. file: [4ce8c482] check-in: [0f08924f] user: drh branch: trunk, size: 247591
12:28
Do not use virtual (and hence redundant) WHERE-clause terms to restrict the content of a automatic partial index. Show when an automatic partial index is used in the EXPLAIN QUERY PLAN output. file: [3312adfd] check-in: [b9ad601e] user: drh branch: trunk, size: 247590
2014-10-24
19:28
Enhance the automatic index logic so that it creates a partial index when doing so gives the same answer for less work. UPDATE: This change introduced a bug described by ticket [2326c258d02ead33]. file: [cc0733c5] check-in: [d95d0313] user: drh branch: trunk, size: 247412
15:26
Honor a high likelihood() on range constraints. file: [f5c13d9c] check-in: [401235ed] user: drh branch: trunk, size: 246671
14:32
Get the likelihood() functions working on operators like BETWEEN that create virtual terms in the WHERE-clause analysis. file: [746d4f22] check-in: [03d0498d] user: drh branch: trunk, size: 246553
2014-10-23
17:26
Add debugging code to count the number of iterations of each loop made as part of statement execution. file: [c9613a13] check-in: [c6a5b67a] user: dan branch: debug-loopcounters, size: 246992
2014-10-22
19:57
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. file: [2cd9e0af] check-in: [ca3b00c4] user: drh branch: trunk, size: 246397
15:27
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. file: [5099c42e] check-in: [3c933bf9] user: drh branch: trunk, size: 246500
2014-10-21
18:16
Further tuning of the cost estimates for skip-scan loops, especially for cases when skip-scan loops are in competition with regular loops. file: [994b38c8] check-in: [a27861c2] user: drh branch: trunk, size: 246526
16:01
Add WHERETRACE debugging output to the whereLoopAdjustCost() routine. file: [45cb63cb] check-in: [ec1e942f] user: drh branch: trunk, size: 246666
01:05
If a skip-scan is a proper subset of some other scan, then adjust the cost of the skip-scan upward so that it is more costly than the other scan. Such a cost imbalance can arise under STAT4 because of difficulties in getting an accurate estimate for skip-scans. file: [2d1ff51e] check-in: [f4b22a26] user: drh branch: trunk, size: 246372
2014-10-11
02:12
Make sure that a GROUP BY that also implements an ORDER BY scans the table in the correct order. Fix for ticket [ba7cbfaedc7e6]. file: [2947912f] check-in: [7a32fdfd] user: drh branch: trunk, size: 247233
01:22
Remove an unnecessary conditional from the EXPLAIN QUERY PLAN logic. file: [45202a9a] check-in: [c5dc83eb] user: drh branch: trunk, size: 247183
2014-10-10
20:52
Account for the ASC/DESC properties of ORDER BY expressions when using the same index for GROUP BY and ORDER BY. Candidate fix for [ba7cbfaedc]. file: [7137da02] check-in: [2a957396] user: dan branch: experimental, size: 247482
19:15
Restrict the scope of the explainIndexRange() function in where.c. file: [75af78b4] check-in: [c3012452] user: drh branch: trunk, size: 247271
17:20
Add the estimated number of output rows to the EXPLAIN QUERY PLAN output if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS. This feature is off by default for the time being. file: [b5112525] check-in: [daa8314f] user: drh branch: trunk, size: 247264
15:47
Simplify the code used to generate the text for EXPLAIN QUERY PLAN. file: [23b9e5dd] check-in: [beea1efc] user: drh branch: trunk, size: 247044
15:01
Fix a potential problem in the whereRangeScanEst() routine when STAT4 is active. The problem was introduced by recent enhancements. file: [d1e315e3] check-in: [68e1b4de] user: drh branch: trunk, size: 247368
2014-10-08
19:33
Remove an always-true branch in whereRangeScanEst(). Replace it with an assert(). file: [6fe21e0f] check-in: [42e48fd3] user: drh branch: trunk, size: 247406
02:53
Fix the STAT4 range scan estimates for DESC indexes. file: [982f1ce2] check-in: [e3fe8400] user: drh branch: trunk, size: 247359
00:08
More intuitive labels on ".wheretrace" output. file: [74e1f7e1] check-in: [adcb3fed] user: drh branch: trunk, size: 247139
2014-09-30
17:31
Enable the query planner to deal with WHERE clauses that have OR terms nested within AND terms that are nested within OR terms. Also remove an unused function declaration. file: [2f42fe0d] check-in: [b6b28918] user: drh branch: trunk, size: 247143
17:03
Further enhancements to the "wheretrace" debugging output. file: [a459332d] check-in: [670993eb] user: drh branch: trunk, size: 247118
14:14
Enhanced debug output for OR-logic in the query loop optimizer. file: [1d22623f] check-in: [2e375eae] user: drh branch: trunk, size: 246755
13:46
Show tree diagrams of data structures in the debugging output when the 0x100 bit is set on sqlite3WhereTrace or sqlite3SelectTrace. file: [5924c549] check-in: [92e0b4bd] user: drh branch: trunk, size: 246547
12:33
Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(), and sqlite3TreeViewSelect(). file: [5a2c700f] check-in: [4ff51325] user: drh branch: trunk, size: 245521
2014-09-23
01:40
Adjust skip-scan cost estimates slightly so that a full table scan is preferred over a skip-scan to a column with only two distinct values. file: [a14d3d80] check-in: [ae9a42b2] user: drh branch: trunk, size: 247403
2014-09-22
14:30
Tune the query planner to be more aggressive about using automatic indexes on views and subqueries for which there is not opportunity to declare a persistent schema index. file: [3f859ecf] check-in: [41de1643] user: drh branch: trunk, size: 247233
2014-09-19
02:01
Make sure that the sorting-index pre-filter recognizes that a rowid reference might be sortable. This fixes a performance regression. file: [0888567c] check-in: [72727b68] user: drh branch: Cplusplus-comment, size: 246775
2014-09-16
14:37
Reduce the number of arguments to RecordCompare functions from 4 to 3, resulting in a small performance increase. file: [dc276288] check-in: [8239c35a] user: drh branch: micro-optimizations, size: 246736
2014-09-06
16:39
Fix typos in comments. No code changes. file: [839b5e1d] check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 246748
02:00
Fix a couple of typos in comments. No changes to code. file: [27af9678] check-in: [a758465e] user: mistachkin branch: trunk, size: 246750
01:35
Query planner heuristic update: When doing a full table scan on a table that has an equality constraint on an unindexed column, do not allow the estimated number of output rows to be greater than half the total number of rows in the table. file: [738213f2] check-in: [73954f93] user: drh branch: trunk, size: 246748
2014-08-28
19:38
Improved WHERETRACE messages for the estimated output row reductions from range scans. file: [d9eae96b] check-in: [fdd478bb] user: drh branch: trunk, size: 246099
17:20
Add a testcase() macro to help verfity the row estimation logic. file: [8214c301] check-in: [6ba60952] user: drh branch: stat4-experimental, size: 245928
16:01
Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan. file: [70dc8408] check-in: [052d89b5] user: dan branch: stat4-experimental, size: 245856
13:42
Fix a formatting error ("%d" needed in place of "%g") on a WHERETRACE macro inside of the query planner. This fix applies to debugging logic only. file: [2fd5cfaf] check-in: [c931ca2b] user: drh branch: trunk, size: 245803
2014-08-27
17:37
When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5]. file: [b80cb726] check-in: [fcebca16] user: dan branch: trunk, size: 245803
2014-08-25
18:29
In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned. file: [4e2770a1] check-in: [e06dc6f0] user: dan branch: trunk, size: 245724
2014-08-20
23:38
Enhancements to skip-scan such that it is operable when a middle column of an index is skipped while the left-most column is constrained in the WHERE clause. file: [4c499d18] check-in: [bc985caa] user: drh branch: trunk, size: 245742
2014-08-08
17:25
Fix a buffer overrun in the previous commit. file: [ab20f9c2] check-in: [43c59c85] user: dan branch: query-planner-fix, size: 245269
16:52
Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the problem addressed by [2af630c572]. file: [012ef65a] check-in: [299b9570] user: dan branch: query-planner-fix, size: 245062
2014-08-07
20:37
Clarify the computation of compatible isOrdered by in the plan solver of the query planner. file: [4cd4b362] check-in: [b5e8fd57] user: drh branch: query-planner-fix, size: 243143
20:25
Remove the extraneous debugging printf() from the previous check-in. file: [5e4fe929] check-in: [8f04d2c0] user: drh branch: query-planner-fix, size: 242936
16:50
Oops! This check-in was on trunk. But it contains a debugging printf(). Original comment: When the estimated cost to do a sort overwhelms the estimated cost to do individual table lookups, make sure that the table lookup costs are still taken into consideration when selecting the lookup algorithm. file: [5a099c6d] check-in: [ec5d84ba] user: drh branch: query-planner-fix, size: 243016
2014-08-04
15:12
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. file: [93e9bec7] check-in: [2f724cba] user: drh branch: deadend, size: 241638
2014-08-01
14:46
Begin making changes to the IN operator in an attempt to make it run faster and to make the code easier to understand. file: [ce1b9a3a] check-in: [ee0fd6aa] user: drh branch: IN-operator-improvements, size: 241638
2014-07-31
22:59
Refactoring: Change "pIndex->onError!=OE_None" to use a macro: "IsUniqueIndex(pIndex)". Easier to understand that way. file: [a7d0434d] check-in: [e75b26ee] user: drh branch: trunk, size: 241623
2014-07-24
22:41
Fix a bug in the whereRangeSkipScanEst() procedure (added by check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility of a ROWID column when computing the affinity of a table column. file: [4dfcd803] check-in: [6aea2258] user: drh branch: trunk, size: 241633
2014-07-23
23:57
Add experimental "costmult" logic. Only enabled when compiled with -DSQLITE_ENABLE_COSTMULT. file: [9454af8e] check-in: [729ece40] user: drh branch: trunk, size: 241585
2014-07-22
20:02
Add the OP_ReopenIdx opcode that works like OP_OpenRead except that it becomes a no-op if the cursor is already open on the same index. Update the OR-optimization logic to make use of OP_ReopenIdx in order to avoid unnecessary cursor open requests sent to the B-Tree layer. file: [0ffd586e] check-in: [77f412ca] user: drh branch: trunk, size: 241116
19:14
The optimization of check-in [b67a6e33f2] does not work (it generates incorrect VDBE code) if an OR term is AND-ed with a constant expression. So back that optimization out and add a test case to make sure it does not get added back in. file: [4e7e6bc6] check-in: [eed754fe] user: drh branch: trunk, size: 240899
14:42
Expire prepared statements after running ANALYZE. file: [52edd7f5] check-in: [b083a961] user: drh branch: trunk, size: 241667
12:05
Enhance the comment on whereLoopAddBtree(). No changes to code. file: [00c4b52d] check-in: [b22dd165] user: drh branch: trunk, size: 241712
00:40
For the OR-optimization, avoid generating OP_OpenRead opcodes that reopen exactly the same index. file: [4f8dce8f] check-in: [b67a6e33] user: drh branch: trunk, size: 241239
2014-07-15
11:59
Add simple tests for new sqlite3BtreeCursorHint() functionality. file: [907fd82f] check-in: [1efa6ed5] user: dan branch: cursor-hints, size: 221604
2014-07-14
19:04
In the expression passed to sqlite3BtreeCursorHint() for the inner loops of joins, replace any TK_COLUMN references to columns in the outer loops with TK_REGISTER expressions (Expr.iTable indicates the specific register containing the value). There are no automated tests for this yet. file: [dcea6104] check-in: [f9dddd00] user: dan branch: cursor-hints, size: 221619
2014-07-01
11:54
Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys. file: [3a451b00] check-in: [21981e35] user: dan branch: trunk, size: 240471
2014-06-30
19:07
Attempt to use STAT4 information to estimate the selectivity of WHERE clause terms when using the skip-scan optimization. file: [6ff6f7e3] check-in: [d09ca6d5] user: drh branch: trunk, size: 240498
18:02
Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table. file: [2bc0226f] check-in: [053a210e] user: dan branch: stat4-without-rowid, size: 236088
15:23
Fix where.c so that the primary key values appended to every index entry on a WITHOUT ROWID table may be used when useful. file: [da15506c] check-in: [6624a61d] user: dan branch: stat4-without-rowid, size: 236091
2014-06-28
15:26
Fix a problem with using stat4 samples of type text when estimating the rows visited by a range-query/skip-scan loop. file: [84659c30] check-in: [dfb09db6] user: dan branch: stat4-skipscan, size: 240597
14:28
Change the VDBE to export the sqlite3MemCompare() routine and thus free where.c from the dependency on vdbeInt.h. file: [1f448161] check-in: [d186d1ac] user: drh branch: stat4-skipscan, size: 240607
2014-06-27
20:14
Fix a couple of problems in estimating the number of rows visited by a range query that uses a skip-scan. file: [fea270ae] check-in: [219736f5] user: dan branch: stat4-skipscan, size: 240628
2014-06-26
21:32
Fix compilation issue when STAT4 is not enabled. file: [0396f040] check-in: [74a5454a] user: mistachkin branch: stat4-skipscan, size: 239985
20:21
Attempt to use sqlite_stat4 data to estimate the number of rows visited by a range query that uses a skip-scan. This code is largely untested. file: [643abd2d] check-in: [01dc8102] user: dan branch: stat4-skipscan, size: 239907
2014-06-18
15:11
Prevent an automatic index from taking the place of a declared index. file: [7b9e13cf] check-in: [0a52bddd] user: drh branch: trunk, size: 236187
2014-06-17
20:16
Prevent an automatic index from taking the place of a declared index. file: [0035f45d] check-in: [4ece839d] user: drh branch: autoindex-improvements, size: 236186
17:00
Fix a missing space in a "wheretrace" comment. No changes to production code. file: [7f59d378] check-in: [b500f2a0] user: drh branch: trunk, size: 235795
15:13
Small tweaks to the query planner to get it to try harder to use an index for sorting and to avoid using automatic indexes on constant terms. file: [9ec7ce02] check-in: [2d9de154] user: drh branch: branch-3.8.3, size: 219338
12:33
A different approach to the autoindex problem that deletes query-planner code rather than adding it. file: [cd3110c7] check-in: [f270fb6e] user: drh branch: autoindex-improvements, size: 235794
09:52
Simplification to the logic that prevents automatic indexes from being formed on constant expressions. file: [3214e390] check-in: [36d67e1d] user: drh branch: autoindex-improvements, size: 236172
09:00
Allow an automatic index on a WHERE constraint where the RHS is does not reference another table as long as the RHS is not a constant. file: [d6a284ab] check-in: [58acc2a8] user: drh branch: autoindex-improvements, size: 236221
02:46
Do not attempt to create an automatic index on a constant constraint, as doing so is pointless. file: [46e94a51] check-in: [d6883e96] user: drh branch: autoindex-improvements, size: 236150
2014-06-16
21:30
In the "wheretrace" logic (disabled for normal builds) expand the print width of the flags field to be wide enough for all 17 bits. file: [5ee08882] check-in: [3181d206] user: drh branch: trunk, size: 236106
2014-06-12
15:46
Simplify the estLog() routine. file: [77894326] check-in: [6c68d758] user: drh branch: trunk, size: 236106
2014-06-06
20:20
Make sure the estLog() routine in the query planner handles negative values correctly (always returning 1). Prior to this change, estLog(-1) would return a large number which could throw off the cost computations in the query planner in obscure circumstances. file: [1c0a0b1f] check-in: [75437bee] user: drh branch: trunk, size: 236131
17:09
Fix an obsolete comment on the whereRangeScanEst() routine. No changes to code. file: [b6dc8189] check-in: [b16bf851] user: drh branch: trunk, size: 236121
2014-06-02
21:00
Remove the WHERE_LIKELIHOOD bit, as it does not seem to effect any result. file: [a7d59dd5] check-in: [1cbe7a08] user: drh branch: trunk, size: 236119
11:26
Fix the query planner so that it once again knows that queries without a FROM clause will never return more than one row and hence do not require sorting. file: [308ed08c] check-in: [9f18b303] user: drh branch: trunk, size: 236212
2014-05-27
18:18
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. file: [b3be5eb4] check-in: [d16e575d] user: drh branch: trunk, size: 236198
17:57
Avoid unnecessary cursor opens and seeks when running the OR-optimization on a WITHOUT ROWID table. file: [a2dba34b] check-in: [9c785c58] user: drh branch: trunk, size: 236182
16:41
Improved comments on the OR-optimization logic in the query planner. file: [c0d3d347] check-in: [77fef5a3] user: drh branch: trunk, size: 235754
2014-05-26
22:01
Minor enhancements to comments and clarification of the code. file: [b5719b11] check-in: [cbec30d0] user: drh branch: without-rowid-or-opt, size: 234993
20:25
Add a missing VdbeCoverage() macro on an OP_Found opcode added in the previous check-in. file: [d46d73c7] check-in: [b4980a07] user: drh branch: without-rowid-or-opt, size: 234883
20:06
Enable the OR optimization for WITHOUT ROWID tables. Use a temp table instead of the RowSet object to track the rows that have already been included in the result set. file: [a911a484] check-in: [2c7e277b] user: dan branch: without-rowid-or-opt, size: 234850
2014-05-23
17:17
Changes to the output of EXPLAIN QUERY PLAN to make it clearer when a query uses the PRIMARY KEY index of a WITHOUT ROWID table. file: [9d351a5e] check-in: [9268df30] user: dan branch: trunk, size: 232722
2014-05-19
15:16
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. file: [5733d54d] check-in: [17349a49] user: drh branch: safer-malloc, size: 232477
2014-05-07
20:33
Remove a superfluous variable initialization. file: [fd4b525c] check-in: [68766f83] user: drh branch: trunk, size: 232447
2014-05-06
15:28
Experimental changes that reduce the size of Expr objects from 72 to 64 bytes each on x64 and from 48 to 44 bytes each on x32. file: [b8df0204] check-in: [8ad0a123] user: drh branch: smaller-expr, size: 233373
2014-05-02
00:09
Add a comment explaining why WhereLoop cost adjustments are omitted for skip-scan loops. file: [91dfd382] check-in: [3bc43594] user: drh branch: trunk, size: 232452
2014-05-01
20:24
Add #ifdefs for test coverage. Add a testcase(). file: [9e67d6c4] check-in: [be2702ce] user: drh branch: trunk, size: 231761
2014-04-30
18:11
Fix a problem in calculating the costs of "OR" scans. file: [3eaf3d24] check-in: [9bbca48b] user: dan branch: trunk, size: 231728
15:00
Add text to the header comment of whereLoopAddBtree() describing how the costs of various b-tree loops are estimated. file: [4aeb1caa] check-in: [05e6e16c] user: dan branch: experimental-costs, size: 230997
14:47
Fix a couple of out-of-date comments in where.c. file: [e91b9290] check-in: [eefeda32] user: dan branch: experimental-costs, size: 229932
2014-04-29
16:46
Merge trunk changes into this branch. file: [9651faf0] check-in: [d74299f0] user: dan branch: experimental-costs, size: 229371
16:10
Ignore likelihood() values on indexed IPK lookups. file: [397bd5d4] check-in: [5bb7757a] user: dan branch: experimental-costs, size: 229629
2014-04-28
20:11
Do not reduce the number of rows scanned at all for "IS NOT NULL" constraints. Fix a bug in calculating the number of rows visited by scans of partial indicies. file: [da9c2c1d] check-in: [a8ae93f0] user: dan branch: experimental-costs, size: 229618
19:34
The trunk assumes that an open range constraint on an indexed term (col>?) term matches 1/4 of the indexed rows, and that a closed constraint (col BETWEEN ? AND ?) matches 1/64. Change this branch to do the same. file: [0a518940] check-in: [4047ac75] user: dan branch: experimental-costs, size: 229583
09:35
Modify internal function whereLoopAdjustCost() so that it does not prefer a skip-scan over a regular index scan even if the regular scan uses a subset of the WHERE terms used by the skip-scan. file: [263f8940] check-in: [88a5758d] user: dan branch: experimental-costs, size: 229207
08:49
Fix an error in estimating of the number of rows visited by a range scan. file: [d4efd09b] check-in: [d491de62] user: dan branch: experimental-costs, size: 229097
2014-04-26
20:21
Fix an sqlite3_stmt_status() problem caused by recent changs on this branch. file: [488cc018] check-in: [dee20409] user: dan branch: experimental-costs, size: 229000
2014-04-25
20:22
If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop. file: [2b3f4780] check-in: [c51efaa5] user: dan branch: experimental-costs, size: 228921
15:01
Store values loaded from the stat1 table as logarithmic values in memory. file: [15a5c94c] check-in: [1bd74c49] user: dan branch: experimental-costs, size: 228111
14:42
Make sure ORDER BY clauses on joins that involve virtual tables and that have a DISTINCT clause work correctly. This is a candidate fix for ticket [388d01d4bb8f9]. Test cases for that ticket will be checked in separately. file: [6ae02f1e] check-in: [17113812] user: drh branch: trunk, size: 228169
2014-04-24
20:04
Changes to the way the planner calculates the costs of various table and index scans. Some test cases still failing. file: [c12bc20c] check-in: [c5a6ec0a] user: dan branch: experimental-costs, size: 228072
2014-04-21
13:21
Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0]. file: [3b127bdc] check-in: [de9a490f] user: dan branch: trunk, size: 228427
2014-04-18
22:20
Clean up the proper-subset cost adjustment logic to make it more compact and easier to read and so that full branch test coverage is more easily obtained. file: [114b480d] check-in: [9a5d38c7] user: drh branch: trunk, size: 226950
2014-04-13
19:28
Remove the unused second argument from sqlite3ExprCachePop(). Add an ALWAYS() on an always-true conditional in sqlite3VdbeResolveLabel(). file: [7614c438] check-in: [ab23abf3] user: drh branch: trunk, size: 226344
2014-04-04
18:20
Merge changes to the query planner that strive to ensure that any index usage that is a proper subset of some other index usage always has a slightly higher cost. file: [70eb10da] check-in: [683dd379] user: drh branch: trunk, size: 226347
2014-04-03
16:29
Use OP_Copy instead of OP_SCopy when moving results out of a subquery, to prevent the subquery results from changing out from under the outer query. Fix for ticket [98825a79ce1456]. Problem introduced by check-in [1e64dd782a126f48d78]. file: [ebad891b] check-in: [d5513dfa] user: drh branch: trunk, size: 223450
16:16
Use OP_Copy instead of OP_SCopy when moving results out of a subquery, to prevent the subquery results from changing out from under the outer query. Fix for ticket [98825a79ce1456]. Problem introduced by check-in [1e64dd782a126f48d78]. file: [7e56746c] check-in: [ec6a0624] user: drh branch: branch-3.8.4, size: 221227
2014-03-31
20:05
Remove an unnecessary conditional. file: [7b5010f5] check-in: [7473c4df] user: drh branch: query-plan-experiments, size: 226348
19:49
Also make sure an index that is a proper subset of some other index has a higher cost than that other index. Add test cases. file: [182f16d9] check-in: [b7830d23] user: drh branch: query-plan-experiments, size: 226319
18:24
Make sure that an index that covers a proper superset of the WHERE clause terms of some other index has a lower cost than the other index. file: [50ac3154] check-in: [ea8b0910] user: drh branch: query-plan-experiments, size: 226114
2014-03-29
21:16
Experiments in picking better query plans, especially when the usage of one index is a subset of another. file: [26c6f626] check-in: [8f869ca7] user: drh branch: query-plan-experiments, size: 224832
2014-03-28
12:56
Fix a harmless compiler warning. file: [7d539ced] check-in: [a4e47150] user: drh branch: trunk, size: 223451
2014-03-27
18:36
Minor cleanup of the code in the query planner that computes the costs estimates for the various plans. There are no changes to the costs at this time. But the code is slightly more readable now and that might facilitate future enhancements. file: [7c53de68] check-in: [9b4d7226] user: drh branch: trunk, size: 223447
2014-03-22
00:27
Fix the ORDER BY optimization logic so that it will do a block-sort on a partial DESC ORDER BY. This enhancement uncovered a memory leak in pushUntoSorter() which is also fixed. file: [da8ec216] check-in: [c36f7461] user: drh branch: trunk, size: 222114
2014-03-21
18:45
Merge the OFFSET-on-query-without-FROM fix from trunk. file: [f394453e] check-in: [71e9ae72] user: drh branch: orderby-planning, size: 222122
18:16
Fix the OFFSET clause so that it works correctly on queries that lack a FROM clause. Ticket [07d6a0453d4ed8]. file: [eed0b83b] check-in: [179ef816] user: drh branch: trunk, size: 221395
2014-03-20
20:56
Merge trunk fixes for "x IN (?)" handling. file: [d6d99a4d] check-in: [eca35871] user: drh branch: orderby-planning, size: 222068
13:26
Convert expressions of the form "X IN (?)" with exactly one value on the RHS of the IN into equality tests: "X=?". Add test cases to verify that statements work correctly on this corner case. Fix for ticket [e39d032577df6942]. file: [a2f20bdc] check-in: [e68b427a] user: drh branch: trunk, size: 221341
12:36
One possible fix for the [e39d032577d] problem it to replace the failing assert() with a testcase() as shown here. file: [09246177] check-in: [eae6dfbe] user: drh branch: tkt-e39d0325, size: 221286
12:17
Fix an unnecessarily obtuse use of a bitmask flag. file: [e433accd] check-in: [ca314081] user: drh branch: trunk, size: 221207
2014-03-19
23:24
Fix query planner weights associated with choosing block-sorting. Fix block sorting of tables with collating functions. Fix various test cases. All "veryquick" tests are now passing, though more tests need to be added. file: [7c74debe] check-in: [01afbf97] user: drh branch: orderby-planning, size: 221955
14:30
Make sure the where.c query planner never reports that the number of ORDER BY terms that are satisfied by indices is negative. file: [1757f31c] check-in: [b186d8d1] user: drh branch: orderby-planning, size: 221639
14:10
First attempt at getting block-sort to work. This is an incremental check-in. There are many problems still to be worked out. file: [d4739c39] check-in: [59742dd4] user: drh branch: orderby-planning, size: 221590
2014-03-18
20:33
Make the partial-ORDER-BY information in the query planner available to the SELECT code generator. Still doesn't make a difference in the generated code. file: [3f5de18e] check-in: [e258df23] user: drh branch: orderby-planning, size: 221570
18:59
Adjust the query planner to keep track of the number of ORDER BY terms satisfied. Still doesn't do anything with this information. Some tests fail after this check-in, but all failures are believed to be benign. The failures will be addressed at a later stage. file: [81eea5ce] check-in: [59d49b7f] user: drh branch: orderby-planning, size: 221376
15:30
Experiments with the optimization of ORDER BY and GROUP BY clauses. file: [222e6ed5] check-in: [b1509025] user: drh branch: orderby-planning, size: 220994
2014-03-10
20:12
Adjustments to the cost computation for the skip-scan query plan, to take into account the fact that a seek has to occur on each skip. file: [bb50b5ae] check-in: [0769eebd] user: drh branch: trunk, size: 221228
2014-03-06
12:36
Remove a branch that is never taken from where.c. file: [95d30485] check-in: [4a499722] user: dan branch: trunk, size: 221139
2014-03-03
14:45
Merge latest trunk changes. file: [2269342f] check-in: [e00ed717] user: dan branch: experimental, size: 221118
14:20
Fix a segfault that can occur following an OOM error. file: [e4b57d81] check-in: [7fdd378d] user: dan branch: trunk, size: 221106
2014-03-01
19:44
Remove the vdbeRecordCompareLargeHeader function. Fix some other details. file: [36ef94b6] check-in: [3861e853] user: dan branch: experimental, size: 221097
2014-02-26
19:05
Only run the OP_OpenRead opcodes for a correlated subquery once, on the initial iteration. Keep the cursor open for subsequent runs. This was suppose to be a performance enhancement, but it is difficult to come up with a query where is makes a significant difference. Hence, the change is getting parked in a branch. file: [655b8fc1] check-in: [3ad687b7] user: drh branch: open-only-once, size: 221297
02:26
Improved handling of constants and especially constant functions in the ORDER BY clause of a query. Do not optimize out "ORDER BY random()". Fix for ticket [65bdeb9739605cc2296]. file: [6042e1a3] check-in: [dca1945a] user: drh branch: trunk, size: 221085
2014-02-25
21:55
Do not allow temporary registers to be in use across an OP_Yield within a co-routine. Fix for ticket [8c63ff0eca81a9132d8]. file: [0b5a4d45] check-in: [97a8c973] user: drh branch: trunk, size: 221489
2014-02-18
03:07
Add VdbeCoverage() and VdbeCoverageIf() macros for improved VDBE coverage testing. file: [d622974f] check-in: [b92d31a9] user: drh branch: trunk, size: 221519
2014-02-17
22:40
Add logic to do test coverage measurements on the VDBE code. file: [7825dce3] check-in: [ce184c7b] user: drh branch: insert-optimization, size: 220476
2014-02-14
23:49
Seek past NULLs in a top-constrained search. Avoid checking for NULLs in the body of the search. file: [7d9c9887] check-in: [e07a32f3] user: drh branch: trunk, size: 219787
20:59
Reduce the number of cases where it is necessary to check for NULL after the loop terminating condition. file: [bf849f08] check-in: [3c1ae447] user: drh branch: trunk, size: 220065
15:13
Add OP_IdxGT and OP_IdxLE as distinct opcodes. Formerly these operations where done using OP_IdxGE and OP_IdxLT with the P5 flag set. But VDBE code is easier to read with distinct opcode names. Also change OP_SeekGe to OP_SeekGE, and so forth, so that the capitalization is consistent. The whole point of this change is to improve the readability of VDBE listings. file: [43eb827f] check-in: [b6bea903] user: drh branch: trunk, size: 220150
2014-02-11
03:50
Make sure that virtual WHERE-clause terms do not get transformed into real terms when processing set of OR-connected terms. Fix for ticket [4c86b126f22ad]. file: [540f5238] check-in: [de635e09] user: drh branch: branch-3.8.3, size: 219267
01:50
Make sure that virtual WHERE-clause terms do not get transformed into real terms when processing set of OR-connected terms. Fix for ticket [4c86b126f22ad]. file: [b0436385] check-in: [c950d6c4] user: drh branch: trunk, size: 220057
2014-02-08
23:20
Do away with the "multi-register pseudo-table" abstration. Instead, just use an OP_SCopy to load results directory from the result registers of the co-routine. file: [90fef20d] check-in: [1e64dd78] user: drh branch: trunk, size: 219929
13:12
Tweaks to the generated VDBE code to make it a little easier to follow. file: [30fd77c3] check-in: [129217ee] user: drh branch: trunk, size: 219192
01:40
Change the OP_Trace opcode to OP_Init and give it the ability to jump to the initialization code at the bottom of the program, thus avoiding the need for an extra OP_Goto. file: [924f24a0] check-in: [192dea97] user: drh branch: trunk, size: 219199
2014-02-07
19:18
Change the OP_InitCoroutine instruction to jump over the co-routine implementation. file: [8c2aada8] check-in: [a522f364] user: drh branch: coroutine-refactor, size: 219263
18:27
Get rid of the OP_Undef and OP_IsUndef opcodes in favor of higher-level OP_InitCoroutine and OP_EndCoroutine. file: [07179d15] check-in: [1ec0e9dd] user: drh branch: coroutine-refactor, size: 219260
2014-02-06
03:31
Use OpenHash instead of OpenEphemeral for the RHS of IN operators if the result is not needed for sorting. file: [08730727] check-in: [715fac77] user: drh branch: subquery-codegen-refactor, size: 219522
2014-02-03
14:04
Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. file: [bacb79fb] check-in: [6c643e45] user: drh branch: trunk, size: 219301
2014-01-28
00:49
Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. file: [549067bd] check-in: [a2c347fa] user: drh branch: branch-3.8.2, size: 218779
2014-01-22
10:22
Fix a typo in a comment. No changes to code or tests. file: [67ae3b5e] check-in: [cceacc0e] user: dan branch: cte-via-queue, size: 219139
00:23
Remove an unnecessary parameter from selectInnerLoop(). Clean up comments. file: [943bb821] check-in: [5e6c4a55] user: drh branch: cte-via-queue, size: 219141
2014-01-21
22:25
Change the recursive common table expression algorithm to use a queue instead of a pair of tables. Runs about 25% faster on the sudoku solver query. The OP_SwapCursors opcode is no longer required. The current implementation uses just a fifo, but the plan is to change it into a queue that will support ORDER BY and LIMIT in a recursive query. file: [d908f4e9] check-in: [b2671e11] user: drh branch: cte-via-queue, size: 218993
2014-01-20
19:55
In where.c, do not allocate space in sqlite3_index_info structures for the internal WHERE clause "terms" generated to record column equivalencies. Fix for ticket [1a1a194d1e5f8]. file: [56f85486] check-in: [7d9e2218] user: dan branch: trunk, size: 218907
2014-01-17
15:15
Add support for common table expressions (WITH clauses). file: [5e11de48] check-in: [0171e3bb] user: dan branch: trunk, size: 218791
2014-01-16
18:34
Allow only a single recursive reference in a recursive CTE. Also require that this reference is not part of a sub-query. file: [369b0259] check-in: [a296b733] user: dan branch: common-table-expr, size: 218767
15:31
Always use available indices to optimize LIKE operators even if the pattern of the LIKE operator has a COLLATE modifier. This fixes an ineffiency that was introduced into 3.7.15 by check-in [8542e6180d4] on 2012-12-08. file: [81cec50f] check-in: [16bd5478] user: drh branch: trunk, size: 218766
2014-01-15
19:42
Fixes so that SQLITE_OMIT_CTE builds work. file: [27eb508c] check-in: [3908e2ea] user: dan branch: common-table-expr, size: 218963
18:21
Disable automatic indices on recursive CTE references. file: [9448a176] check-in: [28aa6db8] user: dan branch: common-table-expr, size: 218932
2014-01-14
20:14
Add code to handle recursive CTEs. file: [830b42f4] check-in: [a5c2a54a] user: dan branch: common-table-expr, size: 218907
2014-01-04
19:27
Avoid redundant register loads during index key generation when doing a DELETE or INTEGRITY_CHECK on a table with multiple indices. file: [18f07fd0] check-in: [8f6e6149] user: drh branch: trunk, size: 218742
14:16
Have the planner detect cases where a MATCH constraint is applied to a virtual table, and ignore any plans that do not allow the virtual table implementation to implement the MATCH filtering. file: [14403429] check-in: [19f3208b] user: dan branch: avoid-unusable-match, size: 219083
2014-01-02
21:05
Try to factor constant subcomponents of the WHERE clause out of the loop. file: [8e3cb203] check-in: [9d05777f] user: drh branch: trunk, size: 218736
2013-12-23
15:35
Make sure the WhereLoop.aLTerm[] array is large enough when processing the skip-scan optimization. Fix for ticket [520070ec7fbaac]. file: [3b589eee] check-in: [ac5852d6] user: drh branch: branch-3.8.2, size: 218617
2013-12-22
20:44
Make sure the WhereLoop.aLTerm[] array is large enough when processing the skip-scan optimization. Fix for ticket [520070ec7fbaac]. file: [60bc8c5b] check-in: [46d04059] user: drh branch: trunk, size: 218615
2013-12-09
19:03
Performance optimizations for sqlite3VXPrintf(). file: [b8f3aab1] check-in: [9227ad48] user: drh branch: trunk, size: 218549
2013-12-07
23:35
Do not allow cursor hints to use expressions containing subqueries. This change fixes the problem seen in the previous check-in. file: [34cf7697] check-in: [bfefc575] user: drh branch: cursor-hints, size: 219940
20:39
If the SQLITE_ENABLE_CURSOR_HINTS macro is defined, then invoke the sqlite3BtreeCursorHint() interface to provide hints to the storage engine about rows that need not be returned. Hints can be disabled using SQLITE_TESTCTRL_OPTIMIZATIONS with SQLITE_CursorHints (0x2000). Cursor hints are not used by the built-in storage engine of SQLite but might be useful to applications that provide their own storage engine. The current code is work-in-progrss and contains bugs. file: [c3bdcd38] check-in: [3a9bec52] user: drh branch: cursor-hints, size: 219878
2013-12-03
19:49
Remove a branch in STAT4 logic that is no longer reachable after the previous change. file: [e6a4e713] check-in: [eca7d3f1] user: drh branch: trunk, size: 218551
2013-11-27
04:22
Lower the threshold for using skip-scan from 50 to 18, based on experiments that show that 18 is the approximate break-even point for a variety of schemas. file: [e0a9909a] check-in: [83c0bb99] user: drh branch: trunk, size: 218603
2013-11-21
03:12
Performance optimization to the OP_Next and OP_Prev opcodes. file: [e558bfa6] check-in: [ecaac28a] user: drh branch: trunk, size: 218471
2013-11-19
12:33
Change Noop-comments in where.c into Module-comments, so that they are omitting without SQLITE_ENABLE_MODULE_COMMENTS. file: [aa72ba87] check-in: [3e577f40] user: drh branch: trunk, size: 218459
2013-11-18
19:32
Add comments identifing where the skip-scan option is decided in the query planner, to aid in tuning that decision. No changes to code. file: [c0a9bab3] check-in: [e9df04ce] user: drh branch: trunk, size: 218449
2013-11-16
14:03
Avoid unnecessary OP_IfNull checks when doing a range query where there is a constraint on the lower bound of the range. file: [de64e326] check-in: [de08a7e7] user: drh branch: trunk, size: 218199
2013-11-15
18:15
Changes to make the new constant expression factoring logic more general and more testable. file: [c7d50e26] check-in: [d10fb49a] user: drh branch: expr-codegen-enhancement, size: 218144
12:41
Simplify the range scan code generate while also avoiding an unnecessary OP_Affinity opcode. file: [6e7e932e] check-in: [372686bf] user: drh branch: expr-codegen-enhancement, size: 218195
01:10
Rework the logic that factors constant expressions out of inner loops, making it both simpler and faster. file: [9bff77c9] check-in: [8dc5c76c] user: drh branch: expr-codegen-enhancement, size: 218482
2013-11-14
19:34
Remove an unused local variable. file: [9d0b21b6] check-in: [10d59226] user: drh branch: trunk, size: 218526
2013-11-13
19:01
Import the "PRAGMA vdbe_eqp" enhancement and the enhanced EXPLAIN formatting the shell from trunk. Fix a bug in skip-scan and add a test case to prevent a regression. file: [2eb88f96] check-in: [f668616a] user: drh branch: skip-scan, size: 218575
17:58
Add the "PRAGMA vdbe_eqp" command, only available with SQLITE_DEBUG. Simplify some of the other debugging logic. file: [537f4d7e] check-in: [8ce33f4c] user: drh branch: trunk, size: 216205
17:24
Add VDBE comments to the beginning and end of skip-scan loops. file: [1d19a1d4] check-in: [0c85d93b] user: drh branch: skip-scan, size: 218516
16:58
Improve the way that skip-scan loops are constructued. Add test cases. Improved the scoring of skip-scan loops. file: [f50428d2] check-in: [5e75ab93] user: drh branch: skip-scan, size: 218378
12:27
Add the ability to use an index even if the left-most columns of the index are unconstrainted, provided that the left-most columns have few distinct values. file: [15170b15] check-in: [27dd5993] user: drh branch: skip-scan, size: 218367
08:55
Avoid an unnecessary OP_IfNull while doing an indexed search. file: [346944c2] check-in: [51960009] user: drh branch: trunk, size: 216174
2013-11-12
20:18
Minor enhancements to the auxiliary information added to EXPLAIN output with SQLITE_EXPLAIN_ENABLE_COMMENTS. file: [48404454] check-in: [0d1328e3] user: drh branch: trunk, size: 216030
18:37
Break out the structure and macro definitions of where.c into a separate header file whereInt.h for easier editing and debugging. file: [7ce9564f] check-in: [c4446712] user: drh branch: trunk, size: 215947
12:17
Fix for [4065ac8595]: Do not order CROSS or LEFT joins, even if the right-hand-side is a virtual table. file: [a80cab07] check-in: [e2684ece] user: dan branch: trunk, size: 236483
2013-11-11
19:01
Add a way for virtual tables to return the expected number of rows for a scan (not just the overall cost) to SQLite. Have the rtree module make use of this. file: [85766647] check-in: [5a3cfd74] user: dan branch: trunk, size: 236507
16:55
Remove unreachable code, replacing it in most cases with assert() or NEVER() macros. file: [2c2a5931] check-in: [924d63b2] user: drh branch: trunk, size: 236467
2013-11-08
17:13
Fix harmless compiler warnings. file: [748cabee] check-in: [0077c077] user: drh branch: trunk, size: 236319
15:19
Performance improvements: Avoid unnecessary seeks when doing a single-row UPDATE on a WITHOUT ROWID table. file: [1b5780b6] check-in: [6f187a0f] user: drh branch: trunk, size: 236317
2013-11-07
21:25
Enable the WHERE_ONEPASS_DESIRED optimization for UPDATE operations on WITHOUT ROWID tables. file: [30462cf0] check-in: [21530798] user: drh branch: trunk, size: 234206
2013-11-06
19:59
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. file: [1a99f127] check-in: [defd5205] user: drh branch: omit-rowid, size: 234177
12:56
Improved ORDER BY optimization for WITHOUT ROWID tables. file: [ce164481] check-in: [8f1709ff] user: drh branch: omit-rowid, size: 234326
12:05
Disable the OR optimization for WITHOUT ROWID tables, since it relies on the use of rowids. file: [1df23d22] check-in: [6055dad2] user: drh branch: omit-rowid, size: 234161
2013-10-31
17:38
Fix issues with quering from an auxiliary index that must refer back to the PRIMARY KEY index of a WITHOUT ROWID table. file: [4e472e13] check-in: [cff1f55c] user: drh branch: omit-rowid, size: 234112
2013-10-28
22:39
Merge recent fixes from trunk. file: [3dc37f79] check-in: [9f8191d1] user: drh branch: omit-rowid, size: 233923
22:33
Formatting improvements to the WHERE-clause constraint display in the wheretrace debugging logic. file: [f18400f1] check-in: [3a9e3ed9] user: drh branch: trunk, size: 233473
20:15
Do not use transitive WHERE-clause constraints on LEFT JOINs. Fix for ticket [c620261b5b5dc]. file: [626e04be] check-in: [9aac4e58] user: drh branch: trunk, size: 233594
19:59
More wheretrace debugging support: Show a listing of all WHERE clause terms (on wheretrace bit 0x100) and include important flags such as TERM_VIRTUAL, WO_EQUIV, and EP_FromJoin. file: [0490bd61] check-in: [92ccd705] user: drh branch: trunk, size: 233499
19:03
Bug fix and enhancements to the improved wheretrace logic that shows the constraint expressions. file: [65ff0a32] check-in: [10f125f5] user: drh branch: trunk, size: 232443
14:34
Improved "wheretrace" capabilities: Show the constraint expression if the wheretrace flag has the 0x100 bit set and if compiled with SQLITE_ENABLE_TREE_EXPLAIN. file: [8eaf13f3] check-in: [710a18ac] user: drh branch: trunk, size: 232205
2013-10-25
14:46
Basic DELETE operations now working on WITHOUT ROWID tables. file: [512ddbf2] check-in: [9eafafa3] user: drh branch: omit-rowid, size: 231949
2013-10-24
14:16
Delete PRIMARY KEY index entries last. Only construct the unique prefix of an index key when deleting entries from an index. file: [04217a95] check-in: [0e56ba69] user: drh branch: omit-rowid, size: 231952
00:18
Correctly handle queries that use secondary indices of WITHOUT ROWID tables. file: [b5f5244d] check-in: [d8bc8595] user: drh branch: omit-rowid, size: 231952
2013-10-23
23:37
Change the sqlite3OpenTable() utility to open the PRIMARY KEY index when reading a WITHOUT ROWID table. file: [3dcdb091] check-in: [247f3899] user: drh branch: omit-rowid, size: 231406
22:23
Construct secondary indices on WITHOUT ROWID tables. file: [13add0a8] check-in: [2c028ddc] user: drh branch: omit-rowid, size: 231388
01:57
Some simple inserts and queries working on WITHOUT ROWID tables. file: [f9e76627] check-in: [3f8016de] user: drh branch: omit-rowid, size: 231396
2013-10-22
18:01
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. file: [32b6e99b] check-in: [a106ce86] user: drh branch: omit-rowid, size: 231152
14:28
Add a procedure to handle the messy details of allocating an Index object from the heap. file: [a5253015] check-in: [45efc94f] user: drh branch: omit-rowid, size: 231163
2013-10-11
15:05
Fix various harmless compiler warnings. Change the "warnings.sh" script to work with STAT4 instead of STAT3. file: [dd2d0d69] check-in: [7df06684] user: drh branch: trunk, size: 231499
2013-10-08
20:42
Rollback some of the previous changes in the branch such that the estimated row sizes are now only used as a tie-breaker for index scans. file: [8dd4cb20] check-in: [65553ff3] user: drh branch: row-size-est, size: 231473
18:40
Further refinement of the idea of multiplying run-time cost estimates by the estimated row size. file: [2a04ab58] check-in: [18bd6ba9] user: drh branch: row-size-est, size: 231814
2013-10-07
17:32
Multiply all cursor step cost estimates by the estimated size of the row in bytes, in order to get the query planner ot make use of estimated row sizes. This check-in uses magic numbers in a few places (for example, estimates of the size of output rows) and needs lots of refinement. Consider this a proof-of-concept only. file: [ad5e680c] check-in: [cb34cfe5] user: drh branch: row-size-est, size: 231369
16:53
Try to remember statistics from ANALYZE using LogEst instead of u64. file: [7916e32a] check-in: [8e78557a] user: drh branch: log-stats, size: 231370
2013-10-05
19:18
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. file: [72c6c205] check-in: [8b4aa0c7] user: drh branch: row-size-est, size: 231167
18:16
Begin an experimental refactoring to estimate the average number of bytes in table and index rows and to use that information in query planner. Begin by renaming WhereCost to LogEst and making that type and its conversion routines available outside of where.c. file: [7b98d09e] check-in: [66c4a251] user: drh branch: row-size-est, size: 231210
2013-10-04
02:36
Progress toward using the iScanRatio information on indices. Many tests are still failing. file: [903e295f] check-in: [6c352edb] user: drh branch: index-scan-rate, size: 234264
2013-09-30
19:33
Fix a minor typo in a comment in where.c. file: [d8c2c5ff] check-in: [9c9fa151] user: drh branch: trunk, size: 234627
2013-09-12
17:29
Merge in the Expr.flags expansion to 32-bits. Use an extra bit to help optimize the sqlite3ExprSkipCollate() routine. file: [d2f58a44] check-in: [4c84d1b4] user: drh branch: unlikely-func, size: 234628
2013-09-11
17:39
Improvements to likelihood processing so that commuting an unindexed term in the WHERE clause does not change the query plan. file: [47a9d554] check-in: [6e6bded0] user: drh branch: unlikely-func, size: 234627
14:34
Additional unlikely() test cases. Logic tweaks to support test coverage. file: [74beca71] check-in: [5d00cce7] user: drh branch: unlikely-func, size: 234683
03:53
Tweaks to the index selection logic. file: [6b9e2bc4] check-in: [52d52688] user: drh branch: unlikely-func, size: 234675
2013-09-10
01:53
Merge trunk fixes into the unlikely-func branch. file: [05cf3150] check-in: [a51d7515] user: drh branch: unlikely-func, size: 234588
2013-09-09
19:37
Make sure that the transitive constraint optimization does not cause WHERE clause terms to be disabled prematurely. We are unable to find a test case that fails because of this, but it seems prudent to make this preventative change nevertheless. file: [b5d59b89] check-in: [d6e361d7] user: drh branch: trunk, size: 232424
2013-09-07
00:29
Continuing refinements of the logic to take WHERE clause terms not used for indexing into account when computing the number of output rows from each table. file: [613cfc35] check-in: [b65dc534] user: drh branch: unlikely-func, size: 234487
2013-09-06
17:45
Enhance the plan solver to take into account the number of output rows when computing the set of paths to retain for the next cycle. file: [ce16c689] check-in: [1a46a724] user: drh branch: unlikely-func, size: 234283
15:23
Initial implementation of the unlikely() SQL function used as a hint to the query planner. file: [c9f8ae51] check-in: [036fc37a] user: drh branch: unlikely-func, size: 233765
00:40
Make sure the destination WhereLoop is left in a sane state when an OOM fault occurs inside of whereLoopXfer(). file: [06c249a5] check-in: [a99a53b8] user: drh branch: trunk, size: 232323
2013-09-04
18:14
Rearrange the order of conditions in an "if" statement to facilitate testing. file: [613993bd] check-in: [8462fb43] user: drh branch: trunk, size: 232274
04:04
Fix out-of-order variable declaration. Fix harmless compiler warning. file: [95a351c9] check-in: [8df95bb0] user: mistachkin branch: trunk, size: 232273
2013-09-03
19:26
Harden the STAT4 logic in where.c against OOM faults. file: [1fe091c6] check-in: [91d2cfbc] user: drh branch: trunk, size: 232273
14:33
Make sure the omit-noop-left-join optimization is not applied if columns of the LEFT JOIN are used in the ORDER BY clause. Ticket [be84e357c035]. Increase version number to 3.8.0.2. file: [51f55344] check-in: [cce54186] user: drh branch: branch-3.8.0, size: 231445
14:03
Make sure the omit-noop-left-join optimization is not applied if columns of the LEFT JOIN are used in the ORDER BY clause. Ticket [be84e357c035] file: [99477e9d] check-in: [0303d6bc] user: drh branch: trunk, size: 232173
2013-09-02
20:22
Simplify branch coverage testing by interchanging the order of two tests in the whereLoopInsert() function. file: [573a815c] check-in: [f7079b53] user: drh branch: trunk, size: 232163
07:16
Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument. file: [a37169b4] check-in: [c21f58d8] user: dan branch: trunk, size: 232163
2013-08-30
17:50
Fix comment typos in the where.c module. No code changes. file: [83f6106e] check-in: [1e0b77cf] user: drh branch: trunk, size: 232074
17:35
If the cost of two whereLoop objects is the same in every way except that one has fewer expected output rows than the other, then choose the one with fewer output rows. file: [97fc542b] check-in: [79e458ef] user: drh branch: trunk, size: 232070
2013-08-29
14:56
Restore fix [f15591f802], which was accidentally clobbered by the stat4 merge. file: [cad6497f] check-in: [d4b6ad33] user: dan branch: trunk, size: 231932
13:21
In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions into simpler forms for processing, be sure to transfer the LEFT JOIN markings. Fix for ticket [bc878246eafe0f52c]. Cherrypick of [caab361ebe]. file: [a9ec7cab] check-in: [cb667449] user: drh branch: branch-3.8.0, size: 231435
13:15
Cherrypick of [c1152bdcbb] and fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. file: [53ac2441] check-in: [c3f75941] user: drh branch: branch-3.8.0, size: 231276
10:46
Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. file: [dab4d4b8] check-in: [c1152bdc] user: dan branch: trunk, size: 231915
2013-08-28
18:18
Add the win32-longpath VFS allowing windows filenames up to 32K characters in length. Remove unused code when -DSQLITE_MAX_MMAP_SIZE=0. Fix some compiler warnings on windows. file: [e0b70ec7] check-in: [12d0a885] user: drh branch: trunk, size: 231799
16:27
In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions into simpler forms for processing, be sure to transfer the LEFT JOIN markings. Fix for ticket [bc878246eafe0f52c]. file: [6a82cd9e] check-in: [caab361e] user: drh branch: trunk, size: 231794
01:54
Fix several harmless compiler warnings. Fix a couple compiler issues with the shell. file: [ee148dd5] check-in: [8917e9f9] user: mistachkin branch: mmapDisabled, size: 231165
2013-08-27
23:15
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. file: [289bfa23] check-in: [67a9a392] user: drh branch: trunk, size: 231635
2013-08-26
23:18
Merge the STAT4 capability into trunk. file: [18cd1516] check-in: [a32af0ab] user: drh branch: trunk, size: 231935
2013-08-23
17:33
Adjust #ifdefs to get SQLITE_OMIT_AUTOMATIC_INDEX and SQLITE_OMIT_PAGER_PRAGMAS to build. file: [6e718c39] check-in: [ed310201] user: drh branch: trunk, size: 231160
2013-08-22
02:56
Defer the creation of automatic indices until the index is actually used. file: [8596edcf] check-in: [0775501a] user: drh branch: trunk, size: 231083
2013-08-20
17:14
Fix an invalid assert() in where.c. Also a crash that can occur in the EXPLAIN QUERY PLAN code under obscure circumstances. file: [0ced8882] check-in: [ef192abb] user: dan branch: trunk, size: 230874
17:00
Ignore IS NOT NULL and NOT NULL constraints on NOT NULL columns. file: [1a020a02] check-in: [e476408e] user: drh branch: trunk, size: 230813
2013-08-19
19:29
Initialize a variable in fts3_write.c on the grounds that the argument required to show that it does not require initialization with is complicated. Add an assert() to where.c to silence a clang scan-build warning. file: [03a50ecb] check-in: [d6c4d48a] user: dan branch: trunk, size: 230813
14:19
Fix a potential reference off the end of an array in the query planner. file: [be91b3d1] check-in: [f15591f8] user: drh branch: trunk, size: 230793
11:15
Fixes for harmless compiler warnings. file: [67a823e7] check-in: [a0d9ca4f] user: drh branch: trunk, size: 230772
2013-08-16
14:49
Fix valueFromExpr() so that it returns SQLITE_NOMEM following an OOM when changing text encodings. Also fix some asserts to accommodate OOM errors. file: [9be69c42] check-in: [dc1ccd09] user: drh branch: sqlite_stat4, size: 231534
2013-08-12
20:14
If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4. file: [d97b5cb2] check-in: [cca8bf43] user: dan branch: sqlite_stat4, size: 231423
09:29
Fix minor problems caused by adding the rowid to the records in stat4. file: [c1090a27] check-in: [088d1ff9] user: dan branch: sqlite_stat4, size: 230917
2013-08-10
19:08
Add the rowid field to the end of sample records stored in the sqlite_stat4 table. file: [adf47614] check-in: [3a5e8ab7] user: dan branch: sqlite_stat4, size: 230890
2013-08-08
19:38
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. file: [0e058c33] check-in: [9228aaf5] user: dan branch: sqlite_stat4, size: 230770
16:17
Use a binary search instead of a linear scan when comparing a sample key against data from the sqlite_stat4 table. file: [2323663d] check-in: [e50dc305] user: dan branch: sqlite_stat4, size: 229238
12:21
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. file: [a1429454] check-in: [9fec3e38] user: dan branch: sqlite_stat4, size: 228176
11:48
Fix a bug in using stat4 data to estimate the number of rows selected by a range constraint. file: [5ea698bd] check-in: [f783938e] user: dan branch: sqlite_stat4, size: 228099
2013-08-07
19:46
Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq. file: [c973297f] check-in: [7b70b419] user: dan branch: sqlite_stat4, size: 228464
18:42
Merge latest trunk changes with this branch. file: [0051a364] check-in: [08f74c45] user: dan branch: sqlite_stat4, size: 228354
15:52
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. file: [4e188dc4] check-in: [353950a5] user: dan branch: sqlite_stat4, size: 228356
01:18
Fix typos and add clarification to comments in where.c. No code changes. file: [ea01a52e] check-in: [f8d8790e] user: drh branch: trunk, size: 230738
2013-08-06
20:15
Fixes for builds without SQLITE_ENABLE_STAT4. file: [14252578] check-in: [84999e27] user: dan branch: sqlite_stat4, size: 228582
20:01
When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan. file: [37c3dc9e] check-in: [2973f5ca] user: dan branch: sqlite_stat4, size: 228539
2013-08-03
20:24
Begin adding experimental sqlite_stat4 table. This commit is buggy. file: [072abd85] check-in: [2beea303] user: dan branch: sqlite_stat4, size: 228227
2013-08-02
23:40
Updates to requirements marks. No code changes. file: [67245bb7] check-in: [21302076] user: drh branch: trunk, size: 230740
16:41
Add support for partial indices. file: [30a9f5e4] check-in: [478113f1] user: drh branch: trunk, size: 231742
2013-08-01
17:21
An improved method for avoiding the use of the STAT3 samples to compute the estimated number of outputs when the left-most index is equality constrained. This check-in undoes the previous fix and applies a new one. file: [38264830] check-in: [127a5b77] user: drh branch: trunk, size: 231087
16:52
Avoid using left-most column STAT3 samples if the left-most column has an equality constrain and there are inequality constraints on the second column. file: [fe1d056f] check-in: [31b4e63b] user: drh branch: trunk, size: 231070
15:09
More test cases and corresponding bug fixes. file: [5642a0f1] check-in: [0c8cfdfa] user: drh branch: partial-indices, size: 231709
12:21
Refactor internal function name sqlite3VdbeGetValue() to sqlite3VdbeGetBoundValue(). file: [bad23a54] check-in: [81834c30] user: drh branch: partial-indices, size: 231683
01:14
Add the logic to keep partial indices up to date through DML statements and when new partial indices are created. This new logic is untested except to verify that it does not interfere with full indices. file: [14d48fe7] check-in: [fb9044d1] user: drh branch: partial-indices, size: 231673
2013-07-31
23:22
Add logic to the query planner to only use partial indices if the WHERE clause constrains the search to rows covered by the partial index. This is just infrastructure. The key routine, sqlite3ExprImpliesExpr(), is currently a no-op so that partial indices will never be used. file: [afa33842] check-in: [8ca3eac1] user: drh branch: partial-indices, size: 231670
2013-07-30
15:10
Reduce the size of the stack required by the codeOneLoopStart() function in where.c. file: [a55e2747] check-in: [eb6d4278] user: drh branch: trunk, size: 231054
2013-07-18
14:50
Fix a 8-byte alignment problem in the query planner that might cause problems on sparc when compiled with -m32. file: [1a26c37b] check-in: [5dcffa67] user: drh branch: trunk, size: 230928
2013-07-16
21:31
Enhance the query planner so that it looks at multiple solutions to OR expressions in the WHERE clause. file: [927acb79] check-in: [5e19d054] user: drh branch: trunk, size: 230875
2013-07-09
03:04
Make sure the schema is verified prior to processing a "WHERE 0" on the first term of a compound SELECT statement. Fix for ticket [490a4b723562429] file: [f5201334] check-in: [52a49cbc] user: drh branch: trunk, size: 229011
2013-07-08
21:12
Fix an adverse interaction between the IS NOT NULL optimization (available only with SQLITE_ENABLE_STAT3) and the transitive constraint processing. Fix for ticket [d805526eae253] file: [cd7ef913] check-in: [3b30b75b] user: drh branch: trunk, size: 229011
2013-07-05
11:10
Add missing "static" qualifier to functions in where.c. file: [7867ef5b] check-in: [5c906e91] user: dan branch: trunk, size: 228659
2013-07-02
15:25
Remove a surplus local variable file: [987eaefc] check-in: [91bc840e] user: drh branch: trunk, size: 228645
10:06
Fix a minor typo in a comment in where.c. file: [8fc6dc55] check-in: [4a9d51e7] user: dan branch: trunk, size: 228667
2013-07-01
17:27
Add a missing test that prevented double LEFT JOINs with transitive constraints from working correctly. Fix for ticket [868145d012]. file: [b546b95b] check-in: [72919ec3] user: drh branch: trunk, size: 228669
11:05
Further minor comment corrections and enhancements in where.c. file: [3ea606b1] check-in: [0d68d4d0] user: drh branch: trunk, size: 228631
10:38
Make a trivial comment fix in where.c. file: [789d3193] check-in: [0ffaab3b] user: drh branch: trunk, size: 228051
2013-06-28
23:55
Issue the new SQLITE_WARNING_AUTOINDEX warning on the SQLite log whenever an automatic index is created. file: [2c447e37] check-in: [338826ef] user: drh branch: trunk, size: 228078
21:12
Add the SQLITE_DEFAULT_AUTOMATIC_INDEX compile-time option, which if set to zero turns automatic indices off by default. Increase the estimated cost of an automatic index. Additional minor refactoring of the automatic index code. file: [b0cdc92a] check-in: [459b3179] user: drh branch: trunk, size: 227807
17:29
Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS option for sqlite3_file_control() that will disable the use of SQLITE_STAT3 information in the query planner. file: [e110b9ef] check-in: [60c19b86] user: drh branch: trunk, size: 227607
13:43
Fix an issue with the OmitNoopJoin optimization and add test cases that are specifically for that optimization. file: [69c39db2] check-in: [5480d124] user: drh branch: trunk, size: 227467
2013-06-22
15:44
Add the ability to disable the omit-join-table optimization for testing purposes. file: [9bcfcb4e] check-in: [d929df9b] user: drh branch: omit-join-table-opt, size: 227157
2013-06-21
02:15
Only eliminate inner loops of a JOIN if they are the RHS of a LEFT JOIN and if they give no more than a single result. This appears to give correct answers in all cases. file: [0ca9544c] check-in: [d7a25cc7] user: drh branch: omit-join-table-opt, size: 227101
02:05
Attempt to disable inner loops of a join that do not generate output. This does not work, since the inner loops might run zero times and thus inhibit all output. Needs to be enhanced to work only for LEFT JOINs or when we know that the inner loop will always run at least once. file: [fc5293b5] check-in: [ca839723] user: drh branch: omit-join-table-opt, size: 227041
00:35
Modify the query planner interface so that it always passes in the result set. This is the first step toward adding an optimization that will omit tables from a join that do not contribute to the result. file: [c950b131] check-in: [2c2577e6] user: drh branch: omit-join-table-opt, size: 226336
2013-06-20
17:32
Add a NEVER() macro and an explanation comment around an unreachable branch in the STAT3 logic. file: [8d6c07d9] check-in: [604c3c5d] user: drh branch: nextgen-query-plan-exp, size: 226199
2013-06-19
18:01
Add in the cost of doing a table lookup on OR searches. Make test case changes to deal with difference in STAT3 behavior. file: [ac9f8c4e] check-in: [d97898e8] user: drh branch: nextgen-query-plan-exp, size: 226032
13:59
Additional compiler warning fixes. file: [88884f3a] check-in: [8d2ae8e2] user: drh branch: nextgen-query-plan-exp, size: 225952
13:32
Fix a harmless uninitialized variable warning. file: [0d12d709] check-in: [9d3ef3bd] user: drh branch: nextgen-query-plan-exp, size: 225996
12:34
Simplify and add invariants to the WhereLoop merging logic inside of whereLoopInsert(). file: [e5ecc3d1] check-in: [8f27f35f] user: drh branch: nextgen-query-plan-exp, size: 225996
03:27
Fix compiler warnings. Fix a harmless off-by-one error in the solver. file: [5cc059bd] check-in: [10021941] user: drh branch: nextgen-query-plan-exp, size: 225863
2013-06-18
20:06
Adjustments to testcase() macros for improved testability. file: [85b7b80a] check-in: [4fbb0c4d] user: drh branch: nextgen-query-plan-exp, size: 225525
01:52
Remove some redundant and unreachable code. file: [86cc9705] check-in: [4c6d58d7] user: drh branch: nextgen-query-plan-exp, size: 225543
2013-06-17
21:37
Add more testcase() macros. Fix a memory leak following OOM in the virtual table analysis logic. file: [b911a484] check-in: [b61402af] user: drh branch: nextgen-query-plan-exp, size: 225636
18:20
Simplifications to the NGQP. Add the queryplantest makefile target. Add testcase() macros in the NGQP. file: [74627cb9] check-in: [eaf1f1b4] user: drh branch: nextgen-query-plan-exp, size: 223866
14:18
Use automatic indices on subqueries of the FROM clause when appropriate. file: [74ecd744] check-in: [e8f12428] user: drh branch: nextgen-query-plan-exp, size: 224590
2013-06-15
15:11
Fix compiler warnings. file: [df0d274f] check-in: [3e8ac469] user: drh branch: nextgen-query-plan-exp, size: 224624
2013-06-14
13:27
Comment tweaks in where.c. No changes to code. file: [cd2ee239] check-in: [cecc5fdd] user: drh branch: nextgen-query-plan-exp, size: 224872
02:51
Add a new ORDER BY optimization that bypasses ORDER BY terms that are constrained by == and IS NULL terms of the WHERE clause. file: [7d406cca] check-in: [b920bb70] user: drh branch: nextgen-query-plan-exp, size: 224984
2013-06-13
17:58
An index might be useful for ORDER BY if any indexed column is in the ORDER BY clause, not just the first indexed column. file: [ba5f6766] check-in: [ade473b5] user: drh branch: nextgen-query-plan-exp, size: 223776
17:28
Make sure that disabling the covering index scan optimization does not prevent a covering index from being used to satisfy an ORDER BY clause. file: [700085a8] check-in: [e8b7ea82] user: drh branch: nextgen-query-plan-exp, size: 223761
15:50
Restore the ability to do a BETWEEN query on the rowid. Also fix a nearby comment. file: [82b519b7] check-in: [459a7b90] user: drh branch: nextgen-query-plan-exp, size: 223716
15:16
Make the MIN() and MAX() macros available in sqliteInt.h. Add TUNING comments to the NGQP and adjust costs slightly. file: [2e8e0a18] check-in: [3a72af2a] user: drh branch: nextgen-query-plan-exp, size: 223719
14:51
Fix an off-by-one error in the WhereCost to integer conversion. file: [c6944d98] check-in: [b5ca80d9] user: drh branch: nextgen-query-plan-exp, size: 221352
2013-06-12
20:18
Activate the one-pass optimization. Update comments, especially the descriptions of the various objects. file: [42098511] check-in: [e120c558] user: drh branch: nextgen-query-plan-exp, size: 221353
17:55
Bug fixes in the handling of virtual tables. file: [568aef75] check-in: [25c0f729] user: drh branch: nextgen-query-plan-exp, size: 220042
17:17
Merge all changes from trunk. file: [97f5d9c3] check-in: [f2e15b19] user: drh branch: nextgen-query-plan-exp, size: 219994
17:08
"make test" now passing. file: [58522e12] check-in: [addd7f46] user: drh branch: nextgen-query-plan-exp, size: 220118
14:52
Add the "queryplanner" test permutation. Continuing refinements to NGQP. file: [67d70ce7] check-in: [25e2cde1] user: drh branch: nextgen-query-plan-exp, size: 219900
03:48
Continue refining the NGQP file: [3f38f769] check-in: [40567fdd] user: drh branch: nextgen-query-plan-exp, size: 219922
2013-06-11
18:59
Improved processing of DISTINCT. file: [2afa8f1a] check-in: [ba897100] user: drh branch: nextgen-query-plan-exp, size: 219963
13:30
Fix the Parse.nQueryLoop state variable to work with NGQP. file: [57235724] check-in: [f1cac24f] user: drh branch: nextgen-query-plan-exp, size: 218756
02:32
Fixes to EXPLAIN QUERY PLAN output. Change weights back to something closer to what they are in legacy. More test case fixes. file: [1241512f] check-in: [36373b85] user: drh branch: nextgen-query-plan-logcost, size: 218663
01:50
Handle virtual tables correctly when using logarithmic costs. Fixes to test cases. file: [72f9aa6c] check-in: [e612664a] user: drh branch: nextgen-query-plan-logcost, size: 218645
2013-06-10
23:30
Fix test cases for the new EXPLAIN QUERY PLAN format. Add the wherecosttest tool. Other fixes to logarithm cost. file: [672b76db] check-in: [aa580e36] user: drh branch: nextgen-query-plan-logcost, size: 217892
20:46
Fix some minor issues with logarithmic cost in NGQP. file: [402d3f74] check-in: [69cf8772] user: drh branch: nextgen-query-plan-logcost, size: 217789
19:12
First attempt to store costs and row counts as a logarithm. file: [ae52899c] check-in: [9e810967] user: drh branch: nextgen-query-plan-logcost, size: 217247
14:56
Simplification and performance tweak to the high-speed NGQP bypass. file: [2e75418e] check-in: [0f8a38ee] user: drh branch: nextgen-query-plan-exp, size: 216117
12:34
Performance improvements for whereScan methods. file: [eddcadac] check-in: [aae14350] user: drh branch: nextgen-query-plan-exp, size: 216215
12:15
Minor problems in the high-speed NGQP fixed. file: [9fff9a5f] check-in: [20eeccf1] user: drh branch: nextgen-query-plan-fast, size: 216329
2013-06-09
17:21
High-speed version of NGQP. Still has some minor problems. file: [2dae18fe] check-in: [db2415fa] user: drh branch: nextgen-query-plan-fast, size: 215856
2013-06-07
02:04
Must faster computation of estimated logarithm. file: [70e1ebd1] check-in: [dfbca3ac] user: drh branch: nextgen-query-plan-exp, size: 213546
00:29
Further prepare-time performance improvements. file: [bbd8aad0] check-in: [02741d17] user: drh branch: nextgen-query-plan-exp, size: 213448
2013-06-06
23:44
Performance improvements. file: [fb4bee9b] check-in: [9f8e84ab] user: drh branch: nextgen-query-plan-exp, size: 213746
23:02
Improved management of the space to hold WhereLoop.aLTerm[]. file: [e029cd3f] check-in: [d4141ecb] user: drh branch: nextgen-query-plan-exp, size: 213849
19:25
Remove some commented-out code that was mistakenly left in the previous check-in. file: [0b652e42] check-in: [b4a5dbad] user: drh branch: nextgen-query-plan-exp, size: 211587
19:16
Clean up and reorganize the elements of the various objects in the analysis tree for the NGQP. file: [e3b7d7ef] check-in: [bfc76ae1] user: drh branch: nextgen-query-plan-exp, size: 211743
2013-06-05
23:39
Move the definitions of the WhereLevel and WhereInfo objects out of sqliteInt.h and into where.c. This will facilitate future refactoring of the internal query planner data structures. file: [83c6fce3] check-in: [1574653b] user: drh branch: nextgen-query-plan-exp, size: 211975
17:53
Performance improvement for the OR-clause analysis in the NGQP. file: [35e510bf] check-in: [9b1c4954] user: drh branch: nextgen-query-plan-exp, size: 206968
16:19
Minor performance tuning of the NGQP. file: [7d8a020b] check-in: [cbef38c2] user: drh branch: nextgen-query-plan-exp, size: 206895
12:47
Performance tweak to whereLoopInsert(). file: [3b175d73] check-in: [1c4a7880] user: drh branch: nextgen-query-plan-exp, size: 206741
2013-06-04
23:40
Update some variable names and comments in the ORDER BY optimizer. Fix a bug in the ORDER BY optimizer dealing with IS NULL constraints. Updates to test cases. file: [0b8fd61d] check-in: [cf96eb59] user: drh branch: nextgen-query-plan-exp, size: 206670
18:27
Restore the PRAGMA reverse_unordered_selects behavior. file: [cc1e1a72] check-in: [f49cd6c4] user: drh branch: nextgen-query-plan-exp, size: 206007
18:03
Get the index-only optimization working for OR queries. file: [e46c09e1] check-in: [774d5ff8] user: drh branch: nextgen-query-plan-exp, size: 205922
13:37
Better determination of when an index is UNIQUE. file: [07d74148] check-in: [63fd025a] user: drh branch: nextgen-query-plan-exp, size: 205919
12:58
Fix a display issue with EXPLAIN QUERY PLAN. file: [89e9e018] check-in: [ff2fa407] user: drh branch: nextgen-query-plan-exp, size: 205921
12:42
Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain and so that it can support optimizing out GROUP BY and DISTINCT clauses. file: [cca3284b] check-in: [e605c468] user: drh branch: nextgen-query-plan-exp, size: 205838
2013-06-03
20:46
Pull in recent trunk changes. Fix the ORDER BY optimizer so that it is better able to deal with COLLATE clauses. Clean up ambiguities in the descidx1.test script. file: [0082ef59] check-in: [6bc71dfc] user: drh branch: nextgen-query-plan-exp, size: 202530
19:17
Do not use an index fullscan for an UPDATE or DELETE or if disabled by sqlite3_test_control() or sqlite3_config(). file: [6226d991] check-in: [fabb2185] user: drh branch: nextgen-query-plan-exp, size: 202506
17:35
Update the NGQP to make use of STAT3 information if it is available. file: [a60b2729] check-in: [ff134e6e] user: drh branch: nextgen-query-plan-exp, size: 202317
16:56
Honor the orderByConsumed boolean returned from virtual table query planner. file: [82c6fd16] check-in: [aaf7f589] user: drh branch: nextgen-query-plan-exp, size: 201428
16:03
Fix to the logic that disables constraints on virtual tables. file: [b8a41bcd] check-in: [62d38240] user: drh branch: nextgen-query-plan-exp, size: 201360
15:34
Fix an issue that was causing ORDER BY DESC to come out in ascending order. file: [078c3aea] check-in: [02984012] user: drh branch: nextgen-query-plan-exp, size: 201356
15:07
Set the WHERE_UNIQUE flag on loops that can only run once. file: [7e34bb26] check-in: [510f4d8e] user: drh branch: nextgen-query-plan-exp, size: 201305
2013-05-31
20:43
The NGQP might not find a solution if INDEXED BY constraints on the query are set wrong. If that is the case, print a "no query solution" error and abort before trying to use the non-existant solution. file: [7c931bf9] check-in: [42511a7e] user: drh branch: nextgen-query-plan-exp, size: 201129
20:28
Do not search using ON clause constraints of LEFT JOINs to the right of the table. file: [3e4ca21a] check-in: [723f901a] user: drh branch: nextgen-query-plan-exp, size: 201100
20:00
Make sure a unique cursor number is allocated for automatic indices. file: [3d93b77c] check-in: [433d1aec] user: drh branch: nextgen-query-plan-exp, size: 200986
19:14
Do not attempt to generate code in the NGQP if there have been prior errors, since with prior errors some of the expressions might not be fully named resolved. file: [0c1d6feb] check-in: [665e4291] user: drh branch: nextgen-query-plan-exp, size: 200950
18:20
Fix a problem with code generation on LEFT JOIN of tables without an index. file: [a8bb7f25] check-in: [0b1bee92] user: drh branch: nextgen-query-plan-exp, size: 200830
18:13
Another virtual table fix in NGQP. file: [e6d80ad3] check-in: [2f2ce416] user: drh branch: nextgen-query-plan-exp, size: 200818
17:55
Fix problems in the virtual table logic for NGQP. file: [103ccfa8] check-in: [23af28e2] user: drh branch: nextgen-query-plan-exp, size: 200818
15:50
Remove the definitions of objects that are no longer used: WhereCost, WherePlan, and WhereBestIdx. file: [586b6c36] check-in: [816f8add] user: drh branch: nextgen-query-plan-exp, size: 200804
15:18
Allow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace". Remove the use of sqlite_query_plan from where2.test. Fix a bug in the code generator for OR clause optimizations. file: [e120e28c] check-in: [707f0323] user: drh branch: nextgen-query-plan-exp, size: 202431
13:36
Futher enhancements to the ORDER BY optimizer. file: [8e992281] check-in: [d8efa5f8] user: drh branch: nextgen-query-plan-exp, size: 201721
12:43
Improved detection of unnecessary ORDER BY clauses. file: [0e1c4180] check-in: [58805eb3] user: drh branch: nextgen-query-plan-exp, size: 201549
11:57
Fix the constructAutomaticIndex() routine so that it works with NGQP. file: [530dd22d] check-in: [5e1e6139] user: drh branch: nextgen-query-plan-exp, size: 200934
2013-05-30
23:21
Improvements to the ORDER BY suppressor in the NGQP. file: [38beadcf] check-in: [24a2e9dd] user: drh branch: nextgen-query-plan-exp, size: 200527
22:27
Incremental check-in with various NGQP fixes. Many tests still fail. file: [28e0cefe] check-in: [a51d8c92] user: drh branch: nextgen-query-plan-exp, size: 200379
19:29
Futher simplifications to the NGQP. Fix some test cases to use EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan global variable. file: [3e9b7b33] check-in: [ae985db4] user: drh branch: nextgen-query-plan-exp, size: 199903
17:43
Cut over the NGQP query planner. Remove lots of legacy code. This check-in compiles but does not work. The test suite gets incorrect answers and crashes. file: [296baae1] check-in: [001539df] user: drh branch: nextgen-query-plan-exp, size: 202872
2013-05-27
17:59
Update the NGQP to record which loops need be run in reverse order to satisfy ORDER BY clauses. file: [3f4f25df] check-in: [211f7a53] user: drh branch: nextgen-query-plan-exp, size: 267404
2013-05-24
14:52
Record in the WhereLoop object the set of virtual table constraints that need not be separately checked. file: [2fd11c00] check-in: [b49fa745] user: drh branch: nextgen-query-plan-exp, size: 267296
2013-05-22
20:49
Use the NGQP plan for EXPLAIN QUERY PLAN output. This change causes 207 errors in veryquick.test, many of which are benign. file: [627bf1af] check-in: [f783e8e6] user: drh branch: nextgen-query-plan-exp, size: 267069
17:01
Allow the rowid at the end of an index to be used in a constraint on that index. file: [3ca12d20] check-in: [9bf0524d] user: drh branch: nextgen-query-plan-exp, size: 266744
02:06
Improvements to ORDER BY handling in the NGQP. Fix an "exit" mistakenly left in a test script during the previous check-in. file: [b695db3f] check-in: [12c709b4] user: drh branch: nextgen-query-plan-exp, size: 266575
2013-05-21
19:23
Enhanced "wheretrace" output in the NGQP solver routine. file: [759c34be] check-in: [04dfb85a] user: drh branch: nextgen-query-plan-exp, size: 266227
15:52
Work toward improving the NGQP's ability to optimize out ORDER BY clauses. file: [a01d93b3] check-in: [67367f1e] user: drh branch: nextgen-query-plan-exp, size: 263827
2013-05-14
15:31
First attempt to get ORDER BY optimization working in NGQP. file: [51d935c6] check-in: [9fe20292] user: drh branch: nextgen-query-plan-exp, size: 261462
2013-05-11
00:06
Minor fixes to the OR-clause processing in the NGQP. file: [049e7011] check-in: [d6946f33] user: drh branch: nextgen-query-plan-exp, size: 257576
2013-05-10
20:26
Now generating OR-clause plans. file: [374f50ce] check-in: [e17003fc] user: drh branch: nextgen-query-plan-exp, size: 257454
15:16
Update the NGQP so that it can produce plans that include automatic indices. file: [f96b2602] check-in: [586b55d8] user: drh branch: nextgen-query-plan-exp, size: 254772
03:30
Factor out common operations into whereLoopAddAll(). Add stubs for missing features. file: [31160bac] check-in: [0278e420] user: drh branch: nextgen-query-plan-exp, size: 252659
02:11
Merge in the latest trunk changes. file: [4816e3ec] check-in: [5ed31c82] user: drh branch: nextgen-query-plan-exp, size: 253149
02:00
Free up bits of wsFlags for reuse. Install the ORDER BY optimization infrastructure for the NGQP. file: [2be67c1a] check-in: [82d50e19] user: drh branch: nextgen-query-plan-exp, size: 252910
2013-05-09
14:20
Do not move WHERE clause terms inside OR expressions that are contained within an ON clause of a LEFT JOIN. Fix for ticket [f2369304e47167e3e]. file: [5c4cbc1e] check-in: [1128575d] user: drh branch: trunk, size: 222053
2013-05-08
20:05
Fix memory leaks in the NGQP logic for virtual tables. file: [e2e0ff81] check-in: [3c2e83a4] user: drh branch: nextgen-query-plan-exp, size: 250191
14:14
NGQP working with virtual tables, though many legacy tests fail and there are yet some memory leaks. file: [409691be] check-in: [bd9327a9] user: drh branch: nextgen-query-plan-exp, size: 250147
04:22
More bug fixes to the WhereLoop generator and the solver in NGQP. Now finds the best plan for TPC-H Q8. This seems to prove the concept, but there is still much work to be done. file: [c02037ef] check-in: [8e5aad37] user: drh branch: nextgen-query-plan-exp, size: 243041
03:22
Bug fixes in the solver. file: [22da73b7] check-in: [b36034bb] user: drh branch: nextgen-query-plan-exp, size: 243065
03:05
Add the NGQP solver. file: [cac7c10d] check-in: [5d37587c] user: drh branch: nextgen-query-plan-exp, size: 242610
2013-05-07
23:06
Continued progress on generating good WhereLoop objects for the new query planner. file: [e957c2c6] check-in: [15cc8a16] user: drh branch: nextgen-query-plan-exp, size: 238345
19:44
Inserting a few WhereLoop objects without leaking memory. Costs are not correct. Inequality and IN constraints are not implemented. file: [e987a4ff] check-in: [e8881a8b] user: drh branch: nextgen-query-plan-exp, size: 236032
2013-05-04
20:25
In where.c, make findTerm() a wrapper around methods to a new WhereScan object which is capable of finding all suitable matching terms, not just the first. This check-in includes some prototype functions for building WhereLoop objects. file: [173347e4] check-in: [dd92b8fa] user: drh branch: nextgen-query-plan-exp, size: 235527
2013-05-02
00:15
Begin inserting some experimental code for the next generation query planner. file: [fc62bea6] check-in: [ccaf4c3f] user: drh branch: nextgen-query-plan-exp, size: 228869
2013-05-01
17:58
Do not use a transitive constraint to an IN operator where the RHS is a constant if there exists a direct == operator to another table in an outer loop. file: [12d4200e] check-in: [faedaeac] user: drh branch: trunk, size: 221814
17:22
Avoid redundant constraint checking due to transitive constraints. file: [e36bbfbf] check-in: [329478cb] user: drh branch: trunk, size: 221783
2013-04-22
19:56
Do not allow a virtual table to cancel the ORDER BY clause unless all outer loops are guaranteed to return no more than one row result. Candidate fix for ticket [ba82a4a41eac1]. file: [d54e6308] check-in: [49cfa14f] user: drh branch: trunk, size: 221734
02:39
Use transitivity to move constraints into the outer loops of a join whenever possible, thereby reducing the amount of work that needs to occur in inner loops. file: [c7c74fe8] check-in: [5f4907e1] user: drh branch: trunk, size: 221429
2013-04-18
02:55
Do not suppress the ORDER BY clause on a virtual table query if an IN constraint is used. Fix for ticket [f69b96e3076e]. Testing done on TH3 using cov1/where37.test. file: [e63f84e5] check-in: [61b2a7be] user: drh branch: trunk, size: 220273
2013-03-27
17:20
In order to optimize out the ORDER BY clause, outer loops must generate values for ORDER BY terms that are unique or else the inner loops must generate no more than a single row. Fix for ticket [a179fe7465]. file: [4ad2329c] check-in: [2936f746] user: drh branch: trunk, size: 220298
16:42
Restore additional ORDER BY optimizations that where broken by the recent ORDER BY fix. file: [8179f4c8] check-in: [c77ee6e2] user: drh branch: orderby-fix, size: 219897
16:05
Improved optimization of ORDER BY. file: [fc912c1d] check-in: [97e5c70f] user: drh branch: orderby-fix, size: 219787
15:04
A fix and test-case for the ORDER BY problem identified by ticket [a179fe7465]. This change causes sorting to occur in some cases where it is not strictly necessary. Further work is needed to avoid those extra sorts. file: [97986838] check-in: [488089e6] user: drh branch: orderby-fix, size: 219708
2013-03-21
21:20
Many spelling fixes in comments. No changes to code. file: [9a16c0b8] check-in: [6f6e2d50] user: mistachkin branch: trunk, size: 218932
2013-03-12
23:58
Add a single new test case to the ORDER BY with IN logic verify that if the RHS of the IN is a descending index that it still works. Add testcase() macros to the ORDER BY with IN logic to help verify that corner cases are tested. file: [bdbbfa7e] check-in: [7e7356f1] user: drh branch: desc-orderby-fix-1, size: 218934
20:38
Fix the ORDER BY optimization with IN constraints when the RHS of the IN constraint is a descending index. file: [6fdacd2c] check-in: [62316eba] user: drh branch: desc-orderby-fix-1, size: 218729
18:49
Revise the patch to make it easier to understand. file: [494da8b3] check-in: [3ce7eb02] user: drh branch: desc-orderby-fix-1, size: 218681
18:40
Revised fix for the DESC ORDER BY and IN constraint bug, ticket [4dd95f6943fbd18]. The previous check-in was incorrect. file: [6c2940f1] check-in: [8b2eb7a4] user: drh branch: desc-orderby-fix-1, size: 218705
18:34
A proposed fix for the DESC ORDER BY bug of ticket [4dd95f6943fbd18]. Seems to work, but lots more testing is needed prior to moving to trunk. file: [3db35b62] check-in: [614a038a] user: drh branch: desc-orderby-fix-1, size: 218802
2013-03-06
01:55
Fix a bug (ticket [fc7bd6358f59]) that caused incorrect query results in three way queries that involved comparing INTEGER and TEXT columns for equality. file: [8b7690ca] check-in: [7097241c] user: drh branch: trunk, size: 218467
2013-02-08
23:18
Fix a potential NULL-pointer dereference following an OOM error in the query planner logic for virtual tables with OR-connected terms. file: [43e05406] check-in: [71b6c260] user: drh branch: IN-with-ORDERBY, size: 218348
20:39
Make sure the virtual tables that take advantage of IN operators sort the RHS of the IN operator in the correct order according to the ORDER BY clause. file: [df3f8f61] check-in: [b016b754] user: drh branch: IN-with-ORDERBY, size: 218278
18:48
Loop through the elements on the RHS of an IN operator in reverse order when the ORDER BY clauses specifies DESC. file: [36370580] check-in: [f78395c8] user: drh branch: IN-with-ORDERBY, size: 217856
16:04
Allow the "a=?1 OR a=?2" to "a IN (?1,?2)" transformation to work on virtual tables again. This was formerly restricted because virtual tables could not optimize IN terms. (See check-in [fad88e71cf195e].) But IN terms are now used by virtual tables (as of check-in [3d65c70343]) so the restriction can now be removed. file: [e09d21a4] check-in: [a917c1f0] user: drh branch: IN-with-ORDERBY, size: 217977
2013-02-07
21:15
Allow an index to be used for sorting even if prior terms of the index are constrained by IN operators. file: [74f8a582] check-in: [98bf668a] user: drh branch: IN-with-ORDERBY, size: 218542
09:33
Fix harmless compiler warnings. file: [427c6ec0] check-in: [4a7b4ee0] user: drh branch: trunk, size: 218475
2013-01-17
16:43
Add the ability to disable transitive constraints using the sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface. file: [374a6c81] check-in: [593d67c8] user: drh branch: transitive-constraints, size: 218486
16:18
Avoid unnecessary collating sequence and affinity restrictions on the use of transitivity. Add test cases to show that the restrictions are not needed. file: [79c25769] check-in: [56549f45] user: drh branch: transitive-constraints, size: 218414
15:05
Make more aggressive use of transitivity in optimizing queries. Add a test case. file: [701c32fe] check-in: [d9676284] user: drh branch: transitive-constraints, size: 219137
00:08
Improved comments explaining the operation of the findTerm() utility routine in where.c. Increase the maximum number of levels of transitivity from 4 to 11. file: [24d74ec5] check-in: [fe152f8b] user: drh branch: transitive-constraints, size: 219093
2013-01-16
17:08
Enhance the query planner to exploit transitivity of join constraints in a multi-way join. file: [eb1e1dfc] check-in: [13171eb5] user: drh branch: transitive-constraints, size: 217563
00:46
Improvements to query planning for joins: Avoid unnecessary calls to "optimal scan" checks in cases where table reordering is not possible. Make sure optimal scan checks are carried out for CROSS JOINs and LEFT JOINs. file: [d48a57d8] check-in: [d5ebb787] user: drh branch: trunk, size: 215390
2013-01-15
18:49
Fix a missing word in a comment. Enhance the "wheretrace" debugging output to show the estimated cost of each table option while planning the join order. file: [b2a827f2] check-in: [ac4e119a] user: drh branch: trunk, size: 213903
16:15
Clarification to a comment in where.c. No code changes. file: [9df0419e] check-in: [04507c17] user: drh branch: trunk, size: 213866
2013-01-09
11:44
Fix an over-aggressive optimization of ORDER BY on a three-way join where the second table is UNIQUE and the ORDER BY occurs on the third table. Ticket [c997b11c4d53a2ee]. file: [613a89f1] check-in: [3d0609c9] user: drh branch: branch-3.7.15, size: 212380
11:31
Fix an over-aggressive optimization of ORDER BY on a three-way join where the second table is UNIQUE and the ORDER BY occurs on the third table. Ticket [c997b11c4d53a2]. file: [4c7fec9c] check-in: [5774f217] user: drh branch: trunk, size: 214002
2012-12-19
17:10
Backport to the 3.7.15 branch the fix to the segfault problem of ticket [a7b7803e8d1e869] which involved the use of "AS" named result columns as logical terms of the WHERE clause. Also, change the version number to 3.7.15.1. file: [74d72b16] check-in: [bae528f4] user: drh branch: branch-3.7.15, size: 212376
15:53
Proposed fix for ticket [a7b7803e8d1e8699cd8a]. file: [b971ee2d] check-in: [3d0e00c7] user: drh branch: tkt-a7b7803e, size: 213998
2012-12-14
17:48
Remove an unreachable branch. Improvements to comments. file: [7bdfde43] check-in: [d2fb7619] user: drh branch: vtab-IN-opt, size: 213943
15:54
Merge in all the trunk changes that have occurred since this branch was opened. file: [6bcd38a2] check-in: [6d507e4d] user: drh branch: vtab-IN-opt, size: 213744
15:36
Fix the virtual table IN optimizer so that it work even if the virtual table implementation leaves the sqlite3_index_info.aConstraintUsage[].omit flag clear for an equality constraint that it intends to use. file: [87c95ca9] check-in: [d6e045f8] user: drh branch: vtab-IN-opt, size: 212030
2012-12-08
22:14
Factor some work out of the index loop of the bestBtreeIndex() routine for a small performance increase. file: [53b991af] check-in: [92c9ab56] user: drh branch: trunk, size: 212321
21:36
Adjustments to the collating-sequence refactoring to facilitate full-coverage testing and to fix some minor issues found by TH3. file: [b613cf5b] check-in: [cdbfa664] user: drh branch: ticket-71e333e7, size: 212189
14:16
Make sure WHERE clause constraints A=B and B=A work the same even with COLLATE clauses. file: [f4b0ec5a] check-in: [b3f53668] user: drh branch: ticket-71e333e7, size: 212198
03:34
Veryquick passes all tests now. file: [fdf9eb05] check-in: [7b96115e] user: drh branch: ticket-71e333e7, size: 212174
2012-12-07
20:31
Many more tests are passing. Only about 100 failures remain in veryquick. file: [bc400d45] check-in: [f9fa7581] user: drh branch: ticket-71e333e7, size: 212086
18:38
Some errors in veryquick resolved. Many more to go. file: [5ad63b25] check-in: [972443b4] user: drh branch: ticket-71e333e7, size: 211983
14:02
Veryquick now runs to completion without segfaulting or asserting. But there are still lots of errors. file: [e415f983] check-in: [7fafab12] user: drh branch: ticket-71e333e7, size: 211981
2012-12-06
21:16
Remove the Expr.pColl field and compute the collating sequence as it is needed. This fixes the test script "shared9.test", though there is still a memory leak. And there are other problems. Consider this a work-in-progress. file: [1c7ff5ad] check-in: [fd011cb2] user: drh branch: ticket-71e333e7, size: 211966
20:19
Cherrypick [557c69055a3] and [0064bab7714] (OP_Once-related fixes for triggers). file: [13e6e3e1] check-in: [0d7b5d45] user: dan branch: branch-3.7.9, size: 201260
2012-12-03
17:04
Make sure that the optimization that set the maximum column that will be used on a particular query does not mistakenly change an opcode other than OP_OpenRead or OP_OpenWrite. In particular, make sure it does not overwrite the P4 field of an OP_SorterOpen. file: [b5325975] check-in: [b0c1ba65] user: drh branch: trunk, size: 211687
2012-11-09
18:22
Disable the table selection rule that tried to prevent full table scans from migrating to the outer loop unless they were optimal. The new scaling of outer-loop costs by cost of inner loops obviates the need for that step. And, in fact, that step causes problems with the new inner-loop cost accounting. file: [832e33fe] check-in: [51bfd63b] user: drh branch: inner-loop-cost, size: 211637
17:59
Try to take into account the cost of inner loops when selecting which table of a join to use for the outer loop. file: [b97f14d4] check-in: [94255634] user: drh branch: inner-loop-cost, size: 212098
2012-10-30
15:31
Make sure that the optimizer never tries to create an automatic index on a coroutine subquery. file: [6a753aa0] check-in: [f83aa0de] user: drh branch: subquery-as-coroutine, size: 211161
00:29
Add an optimization that attempts to run a subquery as a coroutine rather than manifesting it into a temporary table. file: [73eb4c41] check-in: [7af3acbb] user: drh branch: subquery-as-coroutine, size: 211081
2012-10-26
18:40
Make sure the automatic index optimization is checked even if the covering index scan optimization was previously selected. file: [bcd54574] check-in: [ac1d5d8a] user: drh branch: trunk, size: 210660
2012-10-16
23:17
Enable optimization of IN operators on constraints to virtual tables. file: [62f667db] check-in: [aa650746] user: drh branch: vtab-IN-opt, size: 210941
2012-10-09
21:07
Merge the fix for ticket [d02e1406a58ea02] into trunk. file: [3e6c1f9e] check-in: [dd34bec3] user: drh branch: trunk, size: 210607
09:26
Bring some comments up to date in the query planner, and especially the ORDER BY optimizer. Also add testcase() macros. file: [410017c6] check-in: [bb5c0f1c] user: drh branch: trunk, size: 210596
01:39
Remove an unused variable. Fix code that occurs before a variable declaration. file: [7d24dda2] check-in: [01dc032b] user: drh branch: trunk, size: 210409
01:23
Replace an always-false conditional with an assert(). file: [50d1d0d3] check-in: [981b9943] user: drh branch: trunk, size: 210523
2012-10-08
21:51
Merge ORDER BY optimization refactoring and repair into trunk. file: [56916abb] check-in: [c027a9af] user: drh branch: trunk, size: 210541
21:01
All test cases (veryquick.tcl and min.rc) pass. A few branch operations in ORDER BY optimization logic are untested by min.rc. file: [b74866c4] check-in: [8314fd60] user: drh branch: qp-enhancements, size: 210647
20:27
Further tweaks to the ORDER BY optimizer, to fix a bug and to get the optimizer to recognize some additional cases. file: [6bc65388] check-in: [bcb4f262] user: drh branch: qp-enhancements, size: 210636
19:41
Bug fixes in the ORDER BY optimizer. file: [d4a39bc7] check-in: [301bbee4] user: drh branch: qp-enhancements, size: 210590
18:23
Continued refactoring of the ORDER BY optimization logic. This check-in is close to working, but it still has issues. A few test cases fail. file: [968bea25] check-in: [adbdc663] user: drh branch: qp-enhancements, size: 209946
2012-10-05
14:43
Consolidate all occurrences of the "no such collation sequence" error message into a single spot. file: [bf45ec77] check-in: [8ea67522] user: drh branch: trunk, size: 210628
2012-10-04
16:00
Candidate fix for ticket [d02e1406a58ea02]. file: [e74f9ed4] check-in: [81fd941d] user: drh branch: branch-3.7.14, size: 204990
12:10
Yet another refactoring of ORDER BY logic in the query planner. This particular check-in works mostly, but still has a few minor issues. file: [f2468071] check-in: [8f448745] user: drh branch: qp-enhancements, size: 210556
2012-10-03
18:09
Fix an out-of-order memset() that occurs before all variable declarations are finished. Also fix a line that exceeds the 80-character line length limit. file: [fabdb473] check-in: [ba2f492f] user: drh branch: trunk, size: 210734
12:38
Fix a query planner problem that only occurs when covering-index-scan is disabled. Fix to tests whose output changed due to the new and more aggressive ORDER BY optimization. file: [cd99218c] check-in: [0f9bb901] user: drh branch: qp-enhancements, size: 210723
00:25
Further attempts to optimize out unnecessary ORDER BY clauses. file: [76de1934] check-in: [6744d9a3] user: drh branch: qp-enhancements, size: 210671
2012-10-02
15:19
More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC. This is a better and less restrictive fix for the problem addressed by the previous check-in. file: [69398e95] check-in: [abcf6a5d] user: drh branch: trunk, size: 209345
14:11
Only continue an ORDER BY optimization into inner loops if the equality constraints on the inner loop match terms of an outer ordered index that are actually used by the ORDER BY clause. file: [d40f2fa1] check-in: [b0e7b4df] user: drh branch: trunk, size: 209435
01:46
Factor an invariant out the loop termination condition for the ORDER BY satisfied-by-index analyzer routine. file: [58a99bf5] check-in: [545bb336] user: drh branch: trunk, size: 209335
01:25
Make sure the outer loop cursor numbers are recorded in time for them to be used by the ORDER BY optimizer. file: [0a309f52] check-in: [351dc8d9] user: drh branch: trunk, size: 209323
01:10
Improvements to the wheretrace output. file: [9f706f54] check-in: [76b27765] user: drh branch: trunk, size: 209314
2012-10-01
17:44
Minor changes to the query planner for improved test coverage. file: [e676efbf] check-in: [c12044df] user: drh branch: trunk, size: 209181
2012-09-29
19:10
Improved ORDER BY optimization when outer loops of a join return a single row. file: [acc2ec5f] check-in: [62225b4a] user: drh branch: trunk, size: 209147
2012-09-27
23:27
Fix some corner case behavior in the new ORDER BY optimization logic. Remove the SQLITE_OrderByIdx bit from the SQLITE_TESTCTRL_OPTIMIZATIONS mask, since enabling it caused many TH3 tests to fail when the NO_OPT configuration parameter was engaged, and since there really isn't any need to turn that optimization off. The SQLITE_OrderByIdxJoin bit remains. file: [d836df3a] check-in: [98b63371] user: drh branch: qp-enhancements, size: 208896
19:53
More test cases an bug fixes for the ORDER BY optimization of joins. All veryquick tests now pass. file: [cd047c12] check-in: [0d573320] user: drh branch: qp-enhancements, size: 208914
17:31
Test cases and bug fixes applied to the ORDER BY optimization for joins. Some test cases fail, but except for the new orderby1.test failures, all failures appear to be issues with the tests, not with the core code. file: [a537824b] check-in: [75cda864] user: drh branch: qp-enhancements, size: 208713
15:05
Add more bits to the bit vector that is used to disable optimizations for built-in test. Add specific bit patterns to disable ORDER BY using an index in general and for joins. Use macros to test for bits in the disabled-optimization bit vector, in order to make the code clearer. file: [4b837884] check-in: [d2fcba1e] user: drh branch: qp-enhancements, size: 208368
14:11
Enable ORDER BY clauses that span joins to be optimized out. file: [36af33a9] check-in: [c29538f9] user: drh branch: qp-enhancements, size: 208390
12:05
Further tweaks to the query planner logic in preparation for adding ORDER BY opt-out for joins. file: [67438c61] check-in: [53efc10a] user: drh branch: qp-enhancements, size: 206719
2012-09-26
23:17
Further refactoring of the ORDER BY related query-planning logic in order to make it easier to extend to support optimizing out ORDER BY on joins. No actual behavior changes, yet. file: [59b852d5] check-in: [96496dda] user: drh branch: qp-enhancements, size: 206627
2012-09-25
20:43
Augment the WhereBestIdx structure to pass down into the query planner information that might be used to better detect ORDER BY and DISTINCT optimizations spanning multiple tables of a join. file: [e75e67f0] check-in: [4226e51f] user: drh branch: qp-enhancements, size: 205718
14:29
Pass information around between the major routines of the query planner using a single pointer to a structure rather than a long list of parameters. file: [82be1d2f] check-in: [1104d42e] user: drh branch: qp-enhancements, size: 205288
2012-09-24
19:50
Remove an unused subfunction parameter and an obsolete comment from the query planner logic in where.c. file: [40708330] check-in: [349a55cd] user: drh branch: trunk, size: 206016
15:30
Change the internal sqlite3WhereBegin() to report that the ORDER BY clause is satisfied by indices using the WhereInfo.nOBSat field of the returned structure. file: [af126a6c] check-in: [22989f35] user: drh branch: trunk, size: 205872
2012-09-21
22:50
Enable query planner tracing using the new (and undocumented) ".wheretrace 1" command in the command-line shell if both the shell and the core are compiled with SQLITE_DEBUG and SQLITE_ENABLE_WHERETRACE. This is not a supported API. Use for testing and debugging only. file: [3b52eeff] check-in: [1be4b16b] user: drh branch: trunk, size: 205860
2012-09-18
17:32
This change generates incorrect code when there are two or more IN operators in the WHERE clause that are both used by the same index. Was: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid. file: [95a2fe36] check-in: [2be661a4] user: drh branch: mistake, size: 204981
2012-09-17
21:24
Make sure the WHERE_IDX_ONLY flag is not set on query plans that will not be using an index. file: [cc3ef08b] check-in: [698b2a28] user: drh branch: fullscan-covering-index, size: 205809
20:44
Add the ability to disable the covering-index-scan optimization at compile-time, start-time, or at run-time. Add test cases to check this configurability. file: [b124d9d7] check-in: [ccb8ecc3] user: drh branch: fullscan-covering-index, size: 205775
2012-09-15
18:45
Attempt to use a covering index even on a full table scan, under the theory that the index will be smaller and require less disk I/O and thus be faster. file: [0d9970a6] check-in: [cfaa7bc1] user: drh branch: fullscan-covering-index, size: 205628
2012-08-25
02:11
Fix a harmless compiler warning. file: [22783f42] check-in: [929b5184] user: drh branch: trunk, size: 204979
00:49
Backport check-in [62678be3df35cd]: When the same index is used for all OR-terms in a WHERE clause, then try to use that index as a covering index. file: [a4b2ea85] check-in: [865dfcba] user: drh branch: branch-3.7.2, size: 203059
2012-08-24
23:24
Move field WhereLevel.pCovidx inside the union to WhereLevel.u.pCovidx. file: [9a28820f] check-in: [b722143d] user: drh branch: multi-or-covering-index, size: 204973
21:54
Remove a NEVER() that is in fact reachable on an OOM. This probably has nothing to do with the multi-or-covering-index change but just happened to be found while testing that change. file: [27c9e43f] check-in: [5499af53] user: drh branch: multi-or-covering-index, size: 204969
18:44
Fix a problem to do with multi-or queries and automatic indexes. file: [b95276a5] check-in: [a3e26038] user: dan branch: multi-or-covering-index, size: 204976
10:52
Experimental change to support the covering index optimization for queries with OR terms in the WHERE clause that search a single index more than once. file: [b4d98014] check-in: [1dc8c7c7] user: dan branch: multi-or-covering-index, size: 205229
2012-05-11
11:28
Fix a harmless compiler warning. file: [24c7494d] check-in: [2b77301b] user: drh branch: trunk, size: 203244
2012-04-20
16:59
Do not consider a DISTINCT clause redundant unless a subset of the result-set is collectively subject to a UNIQUE constraint and it can be guaranteed that all columns of the subset are NOT NULL (either due to NOT NULL constraints WHERE clause terms). Fix for [385a5b56b9]. file: [8e9f01cd] check-in: [7b8548b1] user: dan branch: trunk, size: 203255
15:24
Fix for [2a5629202f]. When considering whether or not a UNIQUE index may be used to optimize an ORDER BY clause, do not assume that all index entries are distinct unless there is some reason to believe that the index contains no NULL values. file: [e25ae482] check-in: [9870e4c4] user: dan branch: trunk, size: 203021
2012-03-29
14:29
Disable the LIKE optimization if the column on the left-hand-side of the LIKE operator belongs to a virtual table. file: [2112422a] check-in: [0bacb879] user: dan branch: trunk, size: 202604
2012-03-28
01:34
Evaluate typeof(X) and length(Y) where X is any column and Y is a blob column without actually loading X and Y from disk. file: [44d78f58] check-in: [b899dbeb] user: drh branch: faster-typeof-and-length, size: 202568
2012-03-16
00:28
Fix harmless compiler warnings. file: [6baab5df] check-in: [74eadeec] user: drh branch: trunk, size: 202565
2012-03-09
22:02
Candidate fix for the optimizer problem described in ticket [b7c8682cc17f3] which can causes a LEFT JOIN to be changed into a INNER JOIN if there are OR terms in the WHERE clause. file: [d4ce63a2] check-in: [0dc4cb93] user: drh branch: trunk, size: 202603
2012-03-03
00:34
Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on an indexed query involving the IN operator. file: [f2cf5975] check-in: [dec9a995] user: drh branch: trunk, size: 201891
2011-12-09
13:24
Modify the OP_Once opcode so that it works correctly in trigger sub-programs. This is a candidate fix for [7bbfb7d442]. file: [af623942] check-in: [557c6905] user: dan branch: trunk, size: 201848
2011-11-16
15:27
Where possible, take advantage of the rowid at the end of index records to optimize range constraints (<, >, <=, >=) on the rowid column. file: [f73752ca] check-in: [3b58f5f0] user: dan branch: trunk, size: 201962
2011-10-21
19:06
Purge lingering references to SQLITE_STAT2 from the code and test scripts. file: [7c85f4c9] check-in: [aed2bf7a] user: drh branch: trunk, size: 201374
16:47
Remove stale requirements marks from the query planner. file: [922145a3] check-in: [76de9914] user: drh branch: trunk, size: 201374
2011-10-18
19:14
Fix an uninitialized variable in OR-clause processing. file: [b617d9e1] check-in: [54aecd92] user: drh branch: trunk, size: 201449
2011-10-15
00:16
Added the tool/warnings-clang.sh script. Changes so that there are no warnings with either gcc or clang even including FTS4 and RTREE and both with and without SQLITE_THREADSAFE=0. file: [813233b3] check-in: [39408702] user: drh branch: trunk, size: 201416
2011-10-14
21:49
Add assert() statements and eliminate needless variable assignments in order to get the clang scan-build utility to report zero problems against the SQLite core. Clang's static analysis did find one real problem - but it was in the command-line shell, not in the SQLite core. file: [0db7e2db] check-in: [60fee957] user: drh branch: trunk, size: 201425
2011-10-11
12:39
Fix requirements marks associate with STAT3. file: [12939ac4] check-in: [9325c1a8] user: drh branch: trunk, size: 201330
2011-10-07
17:45
Add testcase() macros to ensure good test coverage. file: [a6d127dd] check-in: [5c132592] user: drh branch: or-opt, size: 201330
14:40
Prevent infinite recursion of in the query planner for some pathological test cases by disabling OR-clause processing upon first recursion. file: [2e82da48] check-in: [9fca05ea] user: drh branch: or-opt, size: 201219
13:33
Begin an effort to enhance the query planner to do a better job with OR terms in the WHERE clause. This change allows ANDs outside of the OR to be factored into the OR terms if that is helpful in finding better indices. file: [80c53e8e] check-in: [876bd21a] user: drh branch: or-opt, size: 200900
2011-09-23
13:59
Testability enhancements. file: [aafcb21a] check-in: [be44928c] user: drh branch: stat3-trunk, size: 199560
2011-09-22
18:46
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. file: [432a42cf] check-in: [3ca7e449] user: drh branch: stat3-trunk, size: 199523
00:28
Fix an uninitialized variable and a misuse of memcpy(). file: [bd9ca1bb] check-in: [ee110d5a] user: drh branch: stat3-trunk, size: 199488
2011-09-21
00:09
Pull in the latest changes from trunk. Update the STAT3 documentation. file: [da04df6f] check-in: [63fc3e4b] user: drh branch: stat3-trunk, size: 199488
2011-09-16
19:29
Merge all the latest trunk changes into the experimental STAT3 branch. file: [4d732166] check-in: [51908c8f] user: drh branch: stat3-trunk, size: 199488
19:04
Remove unreachable branches from the previous change. Add additional test cases. file: [b641d399] check-in: [cf51ef8a] user: drh branch: trunk, size: 201582
17:43
When analyzing the right-hand side of IN operators to see if the IN operator can work with an index, be sure to decend into nested subqueries. Fix for ticket [1a1308d2538d7] file: [73234bca] check-in: [0156f10e] user: drh branch: trunk, size: 201576
01:34
Add the new OP_Once opcode. Use it to clean up and simplify various one-time initialization sections in the code, including the fix for ticket [002caede898ae]. file: [e7be3516] check-in: [7f00552b] user: drh branch: tkt-002caede898, size: 201337
2011-08-26
13:52
Merge branches branch-3.7.2 and stat3-enhancement into a new branch for testing purposes. file: [9323b7a6] check-in: [0df04f92] user: drh branch: stat3-3.7.2, size: 199244
2011-08-16
17:06
Fix a few harmless compiler warnings. Add SQLITE_ENABLE_STAT3 to the standard compiler warning script. file: [3d9a78a4] check-in: [3d68f9af] user: drh branch: stat3-enhancement, size: 199291
2011-08-13
19:35
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. file: [11889623] check-in: [89b2f708] user: drh branch: stat3-enhancement, size: 199296
2011-08-12
01:51
Begin a branch that experimentally replaces sqlite_stat2 with a new table called sqlite_stat3 that will hopefully facilitate better query planning decisions. file: [24d95b21] check-in: [52e1d7e8] user: drh branch: stat3-enhancement, size: 198995
2011-08-08
17:18
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. file: [67c87af7] check-in: [d1248165] user: drh branch: query-planner-tweaks, size: 202535
2011-08-06
19:48
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. file: [67ad221f] check-in: [6d1e2372] user: drh branch: query-planner-tweaks, size: 201390
2011-08-05
01:09
Allow the sqlite_stat2 table to contain a number of samples other than the default of 10. file: [b8ebb50b] check-in: [b9d41c34] user: drh branch: query-planner-tweaks, size: 201375
2011-08-03
01:07
Adjust the output row estimating logic when using STAT2. file: [e1692422] check-in: [c8ba8855] user: drh branch: query-planner-tweaks, size: 201385
2011-08-02
01:57
Make sure IS NOT NULL constraints work on virtual tables. Fix for ticket [6c14288a473ceff]. file: [7d09f4c1] check-in: [a55f4ab9] user: drh branch: trunk, size: 201385
2011-07-13
18:53
Cherrypicked from trunk: Do not try to use STAT2 for row estimates if the index is unique or nearly so. file: [db40458b] check-in: [d55b64ef] user: drh branch: branch-3.7.2, size: 201330
18:31
Do not try to use STAT2 to refine the row estimate of a query that uses a unique or nearly-unique index. file: [106cd9ab] check-in: [efffc49b] user: drh branch: trunk, size: 201289
2011-07-12
14:48
Cherrypick change [9f14fa56ba] (the fix for [54844eea3f]) from the trunk. file: [def5ef53] check-in: [7afb2354] user: dan branch: branch-3.7.2, size: 201235
2011-07-11
15:52
Here is an attempted enhancement to the query planner that didn't work out. But it seems good to save this change for historical reference, even if it does not belong on the trunk. file: [bc46a3e6] check-in: [8daf6e1b] user: drh branch: query-planner-deadend, size: 201520
2011-07-09
13:00
In where.c::findIndexCol - make sure that the Expr.op is TK_COLUMN before accessing the Expr.iColumn and Expr.iTable fields. Also fix a couple of unreachable branches. file: [ce7cce80] check-in: [418a4da2] user: drh branch: trunk, size: 201194
2011-07-08
16:10
Fix for [54844eea3f]: Do not create automatic indexes on correlated sub-queries. file: [defae982] check-in: [9f14fa56] user: dan branch: trunk, size: 201164
13:07
Extend the SQLITE_TESTCTRL_OPTIMIZATIONS option to disable DISTINCT optimizations. file: [c814c35a] check-in: [18501dd1] user: drh branch: trunk, size: 201047
2011-07-02
19:12
Add a testcase macro to ensure testing a boundary case in DISTINCT processing. file: [c80c154d] check-in: [ff9fc722] user: drh branch: trunk, size: 200859
15:42
Cherrypick change [27c65d4d9c] into the 3.7.2 branch. file: [f4561d52] check-in: [9bbcd8c0] user: dan branch: branch-3.7.2, size: 201118
15:32
Ensure that automatic indexes are only created in scenarios where they may be used more than once. file: [30dc117e] check-in: [27c65d4d] user: dan branch: trunk, size: 200820
13:34
Cherrypick [45e581bff7] into the 3.7.2 branch. file: [ecdf9bfa] check-in: [c593792c] user: dan branch: branch-3.7.2, size: 200986
06:44
Fix a broken assert() in where.c. file: [dcc0d91c] check-in: [090b2917] user: dan branch: experimental, size: 200688
2011-07-01
18:26
Improve use of indexes to optimize DISTINCT queries. file: [83cf8e86] check-in: [6c202ea0] user: dan branch: experimental, size: 200583
14:21
Improvements and tests for detection of redundant DISTINCT qualifiers. file: [207cf2c1] check-in: [7337293c] user: dan branch: experimental, size: 197585
2011-06-30
20:17
Experimental changes to improve optimization of DISTINCT queries. file: [0bdcf670] check-in: [f7ba0219] user: dan branch: experimental, size: 197761
2011-04-09
03:30
Back port the unordered-index-hack to the 3.7.2 branch. file: [c2320551] check-in: [80353020] user: drh branch: branch-3.7.2, size: 194256
03:20
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. file: [55403ce1] check-in: [8a42e236] user: drh branch: trunk, size: 193958
2011-04-08
23:04
Make sure the left-hand side of the IS NOT NULL operator is a simple column and not a general expression before applying the IS NOT NULL optimization. This is a backport of check-in [543f75a6abe3]. file: [6a465e78] check-in: [e8177e01] user: drh branch: branch-3.7.2, size: 194198
21:35
Always make sure the left-hand side of the IS NOT NULL operator is a simple column, not a general expression, before applying the IS NOT NULL query optimization. file: [494d1069] check-in: [543f75a6] user: drh branch: trunk, size: 193900
2011-04-07
19:56
Change two new internal functions in where.c from global to file scope. file: [9af38108] check-in: [5bbfa17d] user: drh branch: trunk, size: 193861
2011-04-05
22:08
Suppress many harmless compiler warnings, mostly signed/unsigned comparisons within asserts or unused parameters in extensions. file: [71e6808f] check-in: [3eeb0ff7] user: drh branch: trunk, size: 193847
2011-04-01
02:26
Fix two compiler errors associated with non-standard compile-time options. file: [176574bf] check-in: [e3bf2d5c] user: drh branch: trunk, size: 193842
2011-03-31
18:36
Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. file: [51e6657e] check-in: [a5aae174] user: drh branch: branch-3.7.2, size: 194159
2011-03-29
15:00
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. file: [8614b235] check-in: [3b964155] user: drh branch: unordered-index-hack, size: 193900
2011-03-17
01:58
Comment enhancement to better explain the logic in the "x IS NULL" optimization. file: [a6e89fe7] check-in: [869f8947] user: drh branch: trunk, size: 193842
01:53
Backport the "x IS NULL" query planner enhancement of [2353176811f] to the 3.7.2 branch. file: [deee5203] check-in: [68daf20d] user: drh branch: branch-3.7.2, size: 193965
01:34
Enhances to the query planner such that "x IS NULL" constraints take the STAT2 statistics into account, just like "x=VALUE" constraints. file: [a41a1c64] check-in: [23531768] user: drh branch: trunk, size: 193758
2011-03-09
22:09
Backport the OP_Next and OP_Prev for UNIQUE indices patch from checkin [f000c9b2b7] on the trunk. file: [124e56fc] check-in: [2d55234e] user: drh branch: branch-3.7.2, size: 193776
21:02
Omit unnecessary OP_Next and OP_Prev operators when uniqueness constraints guarantee that the code will only make one pass through the loop. file: [27c2f4e2] check-in: [f000c9b2] user: drh branch: trunk, size: 193569
2011-03-06
21:28
Remove dead code identified by the clang static analyzer. file: [3bc364ee] check-in: [01a79d5a] user: drh branch: trunk, size: 193442
2011-03-04
01:23
Backport the query planner enhancement of [952f5e8c69904] to the 3.7.2 branch. file: [4d5918de] check-in: [440d9956] user: drh branch: branch-3.7.2, size: 193649
00:56
Do a better job of choosing the join table order when the tables having very different numbers of rows. file: [d7b07386] check-in: [952f5e8c] user: drh branch: trunk, size: 193619
2011-02-17
13:52
Remove an assert() that was made redundant by the previous checkin. file: [bf8c0f58] check-in: [21db7191] user: drh branch: trunk, size: 193535
13:33
Add an ALWAYS() around a always-true test in where.c. file: [259a7274] check-in: [8123283e] user: drh branch: trunk, size: 193581
2011-02-16
23:32
Fix harmless compiler warnings in the query planner. file: [ebc53143] check-in: [31fc4ba6] user: drh branch: trunk, size: 193573
2011-02-11
06:59
Fix a bug in the new WHERE-clause processing that tries to use an index to resolve IS NOT NULL constraints when SQLITE_ENABLE_STAT2 is defined. The bug could cause memory overruns and segfaults. The bug was new to the code and has not appeared in an official release. Found during structural testing. file: [9c140acd] check-in: [a5c36b9f] user: drh branch: trunk, size: 193565
03:56
Allow an index paired with an IS NULL constraint to be used for sorting under the condition that the index be treated as a non-unique index. file: [96d634b8] check-in: [d78949fc] user: drh branch: trunk, size: 193517
02:43
Disable unused NULL tests when SQLITE_ENABLE_STAT2 is not in use. file: [612ca339] check-in: [5ecd1178] user: drh branch: trunk, size: 193251
2011-02-10
17:46
Prevent a segfault when automatic indices try to use a column with an unknown collating function. Ticket [77aa3b1e6592582e38605d36]. This check-in also removes some stray \r characters unrelated to the problem. file: [ebecb7b9] check-in: [f01030a0] user: drh branch: trunk, size: 193146
00:08
Refactor the cost function in the query planner. Give extra cost (thus reduce likelihood of selection) to full table scans. file: [83a89fe4] check-in: [878da276] user: drh branch: trunk, size: 193081
2011-02-09
03:04
Use macros to define the relative costs of search and seek operations when computing costs in the query planner. Current constants seems wrong and need to be fixed, but doing so will alter test results. Need more experimentation to determine accurate relative costs. file: [0ff78ba4] check-in: [5f2ec44b] user: drh branch: trunk, size: 193475
2011-01-28
01:57
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. file: [f4915ac0] check-in: [4847c6cb] user: drh branch: stat2-enhancement, size: 192073
2011-01-24
15:11
Change the cost estimator in the query planner to take into account the logN rowid lookup cost when going from an index to a table. file: [87de2616] check-in: [b442525b] user: drh branch: stat2-enhancement, size: 189643
2011-01-22
00:10
Add the ability to use indices for constraints of the form "x IS NOT NULL" when sqlite_stat2 is available and most entries for column x are NULL. file: [99a9ea77] check-in: [5d5bddd2] user: drh branch: stat2-enhancement, size: 189660
2011-01-21
18:18
Adjustments to the result row estimator for the IN operator so that it gives the same estimates as the equivalent OR operator. Test cases for the same. file: [2de6723c] check-in: [c82cb9c0] user: drh branch: stat2-enhancement, size: 188060
16:27
Make use of histogram data to make better estimates for the number of rows that will be returned from "x IN (v1,v2,v3,...)" constraints. file: [7f2844af] check-in: [fd3977a2] user: drh branch: stat2-enhancement, size: 187612
14:37
Add the ability to use indices when a range contraint is bounded on the lower end by NULL. file: [cf219a42] check-in: [f73a167b] user: drh branch: stat2-enhancement, size: 184667
2011-01-20
16:52
Use histogram data to improve the row-count estimates on equality constraints. file: [068ecc51] check-in: [6bfc5c69] user: drh branch: stat2-enhancement, size: 184007
02:56
The first of a planned series of enhancements to the query planner that enable it to make better use of sqlite_stat2 histograms when the table has many repeated values. file: [5cd6b88d] check-in: [2cd374cd] user: drh branch: stat2-enhancement, size: 181610
2010-12-16
19:52
Fix an assertion fault that can only occur if SQLITE_ENABLE_STAT2 is defined and the constant folding optimization is disabled using sqlite3_test_control(). Problem introduced by [ad8bc68197f2b4] but we missed it prior to the 3.7.4 release due to taking shortcuts and skipping tests in the release checklist. file: [af069e6b] check-in: [70a3d817] user: drh branch: trunk, size: 180630
2010-11-18
13:47
Fix compiler warnings. file: [fa22d45b] check-in: [6c4f1d5c] user: drh branch: trunk, size: 180776
2010-11-16
02:49
Use the estimated number of rows computed for subqueries in the cost computations for outer queries. file: [d5cc65f5] check-in: [56bbc539] user: drh branch: trunk, size: 180788
2010-11-15
21:50
Change the EQP output for the min/max optimization from "SCAN" to "SEARCH". Other changes in where.c in support of full branch coverage testing. file: [6ba0540b] check-in: [d52b5939] user: drh branch: trunk, size: 180715
16:29
Fix the EQP logic so that it correctly reports OOM errors while formatting "detail" text. file: [f4023c5f] check-in: [136c2ac2] user: drh branch: trunk, size: 180511
2010-11-13
16:42
Change the EXPLAIN QUERY PLAN output to use "USING INDEX" instead of "BY INDEX", and to use "SEARCH" instead of "SCAN" for loops that are not full-table scans. file: [5a982c34] check-in: [6611b76b] user: dan branch: experimental, size: 180496
2010-11-12
15:36
Reduce the number of branches that need to be tested in the explainIndexRange() function of where.c. file: [2a5a0c68] check-in: [6fdae9a6] user: drh branch: experimental, size: 180250
2010-11-11
11:43
Fix a bug in the EXPLAIN QUERY PLAN code. file: [6c1905c8] check-in: [7ae06895] user: dan branch: experimental, size: 179477
2010-11-09
17:35
Add missing comments and fix other issues with routines used by new EQP features. file: [2b69056f] check-in: [925f35c5] user: dan branch: experimental, size: 179427
14:49
Further enhancements and fixes for explain query plan. file: [8aded05b] check-in: [73c93f5a] user: dan branch: experimental, size: 178428
2010-11-08
19:01
Experimental changes to EXPLAIN QUERY PLAN. file: [ddfe0e1a] check-in: [f4747eb8] user: dan branch: experimental, size: 177981
2010-10-21
03:13
Add new WHERETRACE macros for better diagnostics of the query planner. Added a new test case for the performance regression fixed by the previous check-in. file: [d9a31eb3] check-in: [1e0db997] user: drh branch: trunk, size: 175902
02:05
Fix the query planner so that it uses the multi-index OR-clause solution if that is the lowest cost estimate. A prior bug cause the multi-index solution to be ignored in some circumstances. file: [4ca22dea] check-in: [28ba6255] user: drh branch: trunk, size: 175620
2010-10-04
23:55
Fix a performance regression (relative to version 3.6.23.1) caused by the query planner taking into account non-indexable WHERE clause terms to select the outermost join loops when it should be selecting tables for the outermost loop that do not benefit from being in an inner loop. file: [204cdfb6] check-in: [ece641eb] user: drh branch: trunk, size: 175580
2010-09-25
22:32
Enhance the ANALYZE command so that it gathers statistics in the sqlite_stat1 table even for tables that are empty or have no indices. file: [34c733f9] check-in: [a7645d29] user: drh branch: trunk, size: 174814
2010-09-14
18:23
Clarify the documentation to better explain when an automatic re-prepare can be induced by rebinding parameters. Add evidence marks to the automatic re-prepare logic. file: [a5040c00] check-in: [3e11f515] user: drh branch: trunk, size: 175238
2010-08-17
23:13
Cherrypick the changes for enhancement requests [e090183531fc27474] (use indices on LIKE with no wildcards) and [4711020446da7d93d993] (use nocase index for LIKE even if the column is binary) into the 3.6.23.1 release of the Apple-OSX branch. file: [0777e1f8] check-in: [220cca50] user: drh branch: apple-osx-3623, size: 156561
2010-08-06
02:10
Change two automatic array variables into static constant arrays. Update and reformat some comments for cleaner presentation. file: [7db3e41c] check-in: [a7a15547] user: drh branch: trunk, size: 175153
2010-08-05
02:52
Fix the query planner so that when it has a choice of full-scan tables to move to the outer loop, it chooses the one that is likely to give the fewest output rows. Ticket [13f033c865f878]. file: [a4b2cb14] check-in: [309bbedf] user: drh branch: trunk, size: 175065
2010-08-04
21:17
If the outer loop of a join must be a full table scan, make sure that an incomplete ANALYZE does not trick the planner into use a table that might be indexable in an inner loop. Ticket [13f033c865f878] file: [a1398b29] check-in: [e7a714b5] user: drh branch: trunk, size: 174151
2010-07-24
19:08
Additional malloc sanity changes. Use sqlite3MemLink() on Index.zColAff and Table.zColAff as a proof of concept. file: [8cf9ca6f] check-in: [e5ecb159] user: drh branch: malloc-enhancement, size: 172904
16:34
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). file: [79202ca8] check-in: [ac1f37a6] user: drh branch: malloc-enhancement, size: 172980
2010-07-22
22:40
Add evidence marks to the where.c source file. Comment only - no code changes. file: [62262cee] check-in: [f3f9e8e5] user: drh branch: trunk, size: 172993
17:49
Enhance the LIKE/GLOB query optimization so that it works as long as there is an index with the appropriate collating sequence and even if the default collating sequence of the column is different. Ticket [4711020446da7d93d99]. file: [19a0f80a] check-in: [9f932655] user: drh branch: trunk, size: 171654
12:33
Try to optimize LIKE and GLOB operators when RHS contains no wildcard. Ticket [e090183531fc274747] file: [3ba8350d] check-in: [613a87d6] user: drh branch: trunk, size: 172092
2010-07-14
20:23
The expression list on the RHS of an IN operator can no longer be empty because an empty expression list is now optimized out by changes in check-in [c288ac644d0bf]. Therefore add ALWAYS() macros around tests for the expression list being non-empty. file: [903a7828] check-in: [fd130ae5] user: drh branch: trunk, size: 172105
2010-07-03
01:44
Fix a buffer overrun in the where.c. Problem detected by valgrind. file: [926c83c6] check-in: [15bb6233] user: drh branch: mistake, size: 172097
2010-07-02
17:05
Fix some warnings when compiling under MSVC. file: [9c642e4f] check-in: [70833877] user: shaneh branch: mistake, size: 172076
2010-06-09
15:47
Fix for ticket [f973c7ac31]. file: [1c895bef] check-in: [6eb058dd] user: dan branch: trunk, size: 172071
2010-04-30
21:03
Avoid assertion faults in queries using indices with redundant columns. Ticket [3dbdcdb14e7f41]. file: [75fee9e2] check-in: [946e06cd] user: drh branch: trunk, size: 171845
2010-04-15
12:36
Fix a problem in the result set size estimation logic of the query planner - a problem introduced by the two previous changes. file: [faadd9c2] check-in: [33b1f584] user: drh branch: wal, size: 171708
01:04
Further refinements to table order selection on join query planning. file: [74ff6f0d] check-in: [defaf0d9] user: drh branch: trunk, size: 170921
2010-04-14
19:01
The query planner uses non-indexable WHERE clause terms to reduce the estimated number of output rows, then uses the estimated number of output rows as a tie-breaker when choosing table order. file: [458b6e0d] check-in: [b87cb0c2] user: drh branch: trunk, size: 169582
2010-04-08
17:28
Fix code coverage problems in where.c. file: [9472b113] check-in: [b04a5282] user: drh branch: trunk, size: 168233
15:01
Fix the computation of the number of rows in a table during automatic index generation. file: [93621d17] check-in: [edeab06a] user: drh branch: trunk, size: 168260
14:38
Fix an integer overflow bug in the automatic index logic. The bug was detected by the testcase() macros added in the previous check-in. Also add some more testcase() macros, since this issue points up their importance. file: [15a4eef6] check-in: [af97b488] user: drh branch: trunk, size: 168256
14:15
Add testcase() macros to the automatic index logic to insure that boundary cases are tested. file: [3a4a3291] check-in: [72865478] user: drh branch: trunk, size: 168127
00:40
When constructing automatic indices do not include the same column more than once. file: [28c270dc] check-in: [d067d9f7] user: drh branch: experimental, size: 167989
2010-04-07
16:54
Wrap all automatic index changes inside SQLITE_OMIT_AUTOMATIC_INDEX. Add the automatic_index PRAGMA to turn it on and off. file: [b3a57071] check-in: [a811a47f] user: drh branch: experimental, size: 167656
14:59
Make sure that all automatic indices are covering indices. Otherwise, the table and index might be used together in a query but the table could get out of sync with the automatic index through out-of-band changes. file: [186b72b0] check-in: [23643131] user: drh branch: experimental, size: 167172
2010-04-06
22:33
Veryquick.test is now working. The SQLITE_STMTSTATUS_AUTOINDEX counter added. file: [68316204] check-in: [abbf16e5] user: drh branch: experimental, size: 165576
18:51
Runs quicktest without hitting an assert now. Some tests get unexpected results still and there is a memory leak. file: [7e924eac] check-in: [a8224448] user: drh branch: experimental, size: 165378
18:28
Progress toward getting automatic indices to work. Still failing in corner cases. file: [4112c801] check-in: [ac6d0fba] user: drh branch: experimental, size: 165502
15:57
Automatically generate transient indices for tables in joins that would otherwise have to use a full table scan. file: [31a93f75] check-in: [1b2a0412] user: drh branch: experimental, size: 164638
2010-03-31
17:47
Clarification of the implementation of SQLITE_STMTSTATUS_FULLSCAN_STEP. No logical code changes - just commenting and layout changes to improve readability. file: [8bbb34e8] check-in: [06b9ca32] user: drh branch: trunk, size: 157427
2010-03-27
09:44
Increase the estimated cost of using a virtual table as the outer loop of a join when there exists an ORDER BY clause that is not satisfied by the virtual table. Fix for [775b39dd3c]. file: [71ef4e89] check-in: [9e075e70] user: dan branch: trunk, size: 157341
2010-02-25
04:15
Make sure the ON clause of a LEFT JOIN does not cause an index to be used to speed access to a table to the left of the join. Ticket [ebdbadade5] file: [399ea4c0] check-in: [f0ae251a] user: drh branch: trunk, size: 157012
02:32
Merge in all of the logging enhancements. This is a cherrypick merge of the following check-ins: [103321e37a], [a8076aede3], [6d910245ad], [7c4cca6d1a], [edea3bb740], [1a6d4bb130], [a8c984c1d6], [69a493182f], and [1168763d2c]. file: [0fab05c9] check-in: [46f406b2] user: drh branch: branch-3.6.22, size: 156905
2010-02-23
17:36
Remove the obsolete sqlite3SafetyOn() mechanism. Add additional logging output for CORRUPT, and CANTOPEN errors. file: [9269ec75] check-in: [7c4cca6d] user: drh branch: trunk, size: 156908
2010-01-21
23:11
Fix a segfault that can occur when the LHS of a LIKE operator has an undefined collating sequence. Ticket [1258875e07553]. file: [1041ef11] check-in: [a82e6b45] user: drh branch: trunk, size: 156983
2009-12-31
19:06
Changes to remove warnings in MSVC build. file: [43b11af0] check-in: [6cf76c2a] user: shaneh branch: trunk, size: 156980
2009-12-30
14:12
Adjustments to column cache handling in order to restore 100% branch test coverage. file: [62553021] check-in: [cc6b959b] user: drh branch: trunk, size: 156951
2009-12-24
16:00
Immediately purge entries from the column cache when the associated register undergoes an affinity change. Ticket [eb5548a849]. Enhance the SQLITE_TESTCTRL_OPTIMIZATIONS setting of sqlite3_test_control so that it can disable the column cache for testing purposes, in an effort to prevent future problems of a similar nature to this one. file: [5bf4b84d] check-in: [ea4e57e1] user: drh branch: trunk, size: 156948
2009-12-16
23:28
Fix for the "(x AND y) OR z" bug backported to version 3.6.21. file: [f20ee9a1] check-in: [86734732] user: drh branch: branch-3.6.21, size: 156951
22:10
Ensure WHERE clause terms involving tables on the right end of a join are not prematurely evaluated when tables on the left end of the join make use of the OR-clause optimization. Fix for ticket [31338dca7e]. file: [5d057a10] check-in: [2c2de252] user: drh branch: trunk, size: 157055
2009-11-23
21:23
Make sure registers computed for the VFilter opcode are marked invalid after the VFilter opcode finishes. Ticket [16fbf14cb2]. file: [11b5b00c] check-in: [83dc7d38] user: drh branch: trunk, size: 154762
2009-11-18
01:25
Suppress more instances of unnecessary OP_IsNull and OP_Affinity opcodes. file: [6dedaffc] check-in: [bf6c0bd1] user: drh branch: trunk, size: 154692
2009-11-17
18:31
Code generator tries to avoid pointless OP_IsNull and OP_Affinity opcodes. file: [ef0dbd39] check-in: [ebb0c8a3] user: drh branch: trunk, size: 154729
2009-11-16
22:54
Fix a reference to freed memory that can occur following an OOM error in where.c. file: [5a8ed388] check-in: [929b6047] user: drh branch: trunk, size: 153580
2009-11-12
19:59
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. file: [d5c9692f] check-in: [b9eab885] user: drh branch: trunk, size: 153698
04:26
Suppress unnecessary OP_Noop instructions on when the right table of a LEFT JOIN uses the index-only optimization. file: [c4ef4980] check-in: [e8aec08b] user: drh branch: trunk, size: 153821
2009-11-10
01:30
Remove the obsolete "$Id:$" RCS identifier strings from the source code. file: [29d33240] check-in: [f6c045f6] user: drh branch: trunk, size: 153751
2009-11-01
19:26
Fix compiler warnings. Better comments on some variables associated with LIKE/GLOB processing in the query planner. file: [fac37876] check-in: [cfa2db0f] user: drh branch: trunk, size: 153816
2009-10-22
20:50
Add some sample requirement implementation comments to where.c. file: [3809a594] check-in: [9854ad00] user: drh branch: trunk, size: 153525
2009-10-19
22:41
Remove an unreachable condition in the WHERE clause processing of bound parameters and replace it with an assert(), for test coverage. file: [937fb6e4] check-in: [3bcd78a1] user: drh branch: trunk, size: 152920
18:11
Remove the sqlite3_reoptimize() API. The same functionality is now provided automatically to queries prepared using prepare_v2(). file: [acf24024] check-in: [2c50b3d5] user: dan branch: trunk, size: 152776
15:52
When generating WHERE clause terms internally for NATURAL and USING joins, identify the table by its position in the FROM list, not by its name or alias. Fix for [b73fb0bd64]. file: [9e8bb75c] check-in: [6fe63711] user: dan branch: trunk, size: 152785
2009-10-17
13:13
Make sure the target register is allocated before adding the bogus OP_Variable opcode in isLikeOrGlob(). Bugfix for the new sqlite3_reoptimize() logic. file: [896ec4cd] check-in: [e74f8dc4] user: drh branch: trunk, size: 152751
2009-10-15
18:35
Add the experimental sqlite3_reoptimize() API. file: [10b4796d] check-in: [9bd6f3d8] user: dan branch: experimental, size: 152650
2009-09-21
16:34
Fix compilation with both OMIT_UTF16 and ENABLE_STAT2 defined. Ticket [56928bd084]. file: [53e26209] check-in: [cd850d49] user: dan branch: trunk, size: 150362
2009-09-09
16:10
Suppress some harmless compiler warnings. file: [68db8ab9] check-in: [f0c72a53] user: drh branch: trunk, size: 150320
2009-09-07
04:38
Warning cleanup from the MSVC compile. file: [15b38ff1] check-in: [26cd015c] user: shane branch: trunk, size: 150238
2009-08-25
16:28
Remove an unreachable branch from where.c in order to restore 100% branch test coverage. Add assert() and testcase() macros to verify that the branch is unreachable. file: [a3218dfc] check-in: [58db7e71] user: drh branch: trunk, size: 150231
15:56
Initialize variables differently in the range processing logic of where.c in order to make sure variables are always initialized even following an OOM error. file: [fc8b33fb] check-in: [3fb3686a] user: drh branch: trunk, size: 150176
2009-08-21
13:22
Change the expression code generator to account for the fact that the new sqlite3AtoF() never returns NaN. Also, clarification of a comment in where.c. file: [b9ad2d2d] check-in: [75f596a0] user: drh branch: trunk, size: 150224
2009-08-20
20:05
Simplifications to the range-scan logic in support of structural testing. file: [ccd88f21] check-in: [bbbee810] user: drh branch: trunk, size: 150074
18:14
Continuing refinements of the range-scan optimizations in where.c. The range scores are changed from an integer 1..9 to 0..100. file: [2d258a56] check-in: [f0c24b5f] user: drh branch: trunk, size: 150066
13:45
Incremental code and comment cleanup in where.c. There is more to be done. file: [02f2bb99] check-in: [4a5d9550] user: drh branch: trunk, size: 149009
02:34
All the sqlite3GetCollSeq() function to specify an arbitrary text encoding. file: [e43ddc77] check-in: [4ee44322] user: drh branch: trunk, size: 147129
2009-08-19
08:18
Add the SQLITE_ENABLE_STAT2 macro. If this is not defined at build-time, the stat2 table is not created, populated, or used. file: [2e61e33f] check-in: [362665e8] user: dan branch: trunk, size: 147046
2009-08-18
16:24
Change the sqlite_stat2 schema to be more flexible. file: [9d4c2f17] check-in: [ded9dec6] user: dan branch: trunk, size: 146943
2009-08-17
17:06
First version of sqlite_stat2 (schema forces exactly 10 samples). file: [33a3aa8b] check-in: [dd96bda2] user: dan branch: trunk, size: 146803
2009-08-13
19:21
If a binary operator in a WHERE clause that should be performed with no affinity conversions applied to its operands (see http://www.sqlite.org/datatype3.html) is optimized by index lookup, do not apply any conversions to the key value before looking it up in the index. Fix for [93fb9f89d6]. file: [7573120c] check-in: [e72186f2] user: dan branch: trunk, size: 141023
07:09
Changes to the query planner that improve the order in which tables/indexes are scanned in join queries. file: [53adef2c] check-in: [19f799b3] user: dan branch: trunk, size: 138845
2009-07-31
06:14
Fix a bug in where.c that could cause SQLite to write to freed memory while compiling a query with many terms in the WHERE clause. (CVS 6952) file: [7e696d69] check-in: [8161af84] user: danielk1977 branch: trunk, size: 137666
2009-07-28
08:43
Fixed reversed labels in WHERETRACE() statement. Debugging code only. (CVS 6948) file: [de6ab601] check-in: [614a8d83] user: shane branch: trunk, size: 137630
2009-07-24
17:58
Allow virtual tables to be used in shared-cache mode. (CVS 6928) file: [bf56a85a] check-in: [5d9e767a] user: danielk1977 branch: trunk, size: 137636
2009-06-16
14:15
Fix a link error and warning that can occur in where.c when compiling under MSVC with SQLITE_OMIT_VIRTUALTABLE defined. Ticket #3914. (CVS 6767) file: [cf0d0917] check-in: [793c93be] user: shane branch: trunk, size: 137560
2009-06-15
16:27
Fix compiler warnings with MSVC build. (CVS 6761) file: [658d99d9] check-in: [e1e64307] user: shane branch: trunk, size: 137477
2009-06-11
17:04
Add an ALWAYS() to a conditional in where.c. (CVS 6747) file: [86fb1a3a] check-in: [1fdb3e1e] user: drh branch: trunk, size: 137460
2009-06-10
19:33
Do not let the reverse_unordered_selects pragma force the use of an index that would not otherwise be used. Ticket #3904. Also: remove an test which is always true. (CVS 6745) file: [cbf29fc2] check-in: [78a391dc] user: drh branch: trunk, size: 137453
2009-06-08
19:44
Additional comments to clarify the operation of the LIKE optimizer in where.c. (CVS 6731) file: [70440f8c] check-in: [cc9c1217] user: drh branch: trunk, size: 137446
17:11
Clarification of the operation of the OR-term optimizer in where.c. (CVS 6730) file: [21555aa8] check-in: [6b42dc3d] user: drh branch: trunk, size: 137016
2009-06-07
23:45
Disable the LIKE optimization if the affinity of the LHS column is not TEXT. Ticket #3901. (CVS 6727) file: [01b8d473] check-in: [a255c645] user: drh branch: trunk, size: 135140
2009-06-06
15:17
Make sure the result of sqlite3VdbeGetOp() is not used as an array following an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724) file: [c6dda6e3] check-in: [127b1398] user: drh branch: trunk, size: 135159
2009-06-03
01:24
Additional changes to reduce stack usage. The SQLITE_SMALL_STACK compile-time option is now available. (CVS 6708) file: [706e9f2f] check-in: [baea79fd] user: drh branch: trunk, size: 135139
2009-05-28
01:00
Additional refinements to Expr handling. Restore compression of trigger expressions. Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue. Remove an unnecessary ExprDup from CHECK constraint processing. And so forth. (CVS 6682) file: [1a21128d] check-in: [4ac2bdfb] user: drh branch: trunk, size: 135032
2009-05-27
10:31
Simplifications to the Expr object: Remove Expr.span completely and convert Expr.token into a char* Expr.zToken. Also simplify the Token object by removing the Token.dyn and Token.quoted fields. (CVS 6681) file: [145bb0d0] check-in: [7cb1c3ba] user: drh branch: trunk, size: 135022
2009-05-22
15:43
Do not transform a WHERE clause of the form "a = ? OR a = ?" to "a IN (?, ?)" if "a" is a column of a virtual table. Ticket #3871. (CVS 6671) file: [d11b8a8c] check-in: [fad88e71] user: danielk1977 branch: trunk, size: 135261
2009-05-06
19:03
Fix compiler warning found with gcc -Wextra. (CVS 6614) file: [c5fa4a7a] check-in: [93bdbc5e] user: drh branch: trunk, size: 134730
18:57
Changes to silence compiler warnings under MSVC. (CVS 6613) file: [f8e2e564] check-in: [df599237] user: shane branch: trunk, size: 134809
18:42
Fix three variable initialization problems found by valgrind. (CVS 6612) file: [31b1c577] check-in: [37428435] user: drh branch: trunk, size: 134793
2009-05-05
15:46
Make sure the left-shift operator never overflows. (CVS 6605) file: [6199249a] check-in: [300da301] user: drh branch: trunk, size: 134757
2009-05-01
21:13
Record within the Token structure itself whether or not the token has been dequoted. This steals one bit from the length of a token and thus limits the size of tokens to 1GiB. (CVS 6589) file: [823891e1] check-in: [12bcb03d] user: drh branch: trunk, size: 134713
2009-04-29
11:50
Fix a case in where.c where a crash can follow a malloc failure. Also modify test code in test8.c to check a return code that was being dropped (causing a test in vtab_err.test to fail). (CVS 6567) file: [de8984ae] check-in: [9664e2b6] user: danielk1977 branch: trunk, size: 134680
2009-04-24
15:46
Get rid of the special RowSet processing in where.c and move that into clients. Added the WHERE_DUPLICATES_OK option to eliminate an unnecessary RowSet during DELETE with a WHERE clause containing ORs. (CVS 6546) file: [d20e083e] check-in: [98606bee] user: drh branch: trunk, size: 134437
14:51
Make sure that the optimizer realizes that an "x IS NULL" contraint does not necessarily give a single-row result even on a UNIQUE index. Ticket #3824. (CVS 6545) file: [5eaf4422] check-in: [207335fd] user: drh branch: trunk, size: 136165
2009-04-23
13:22
Rework the column-cache mechanism to be more robust (and more correct). The column-alias cache is currently disabled, (CVS 6538) file: [6f7199cf] check-in: [dd4d67a6] user: drh branch: trunk, size: 135832
2009-04-22
17:15
Eliminate the OP_VRowid opcode. The regular OP_Rowid now work for both regular and virtual tables. (CVS 6537) file: [423ed1da] check-in: [ecbef450] user: drh branch: trunk, size: 136058
15:32
Change the OP_Rowid opcode so that a deferred OP_Seek is pending, it simply pulls the rowid from the deferred seek target and does not actually move the cursor or do a seek. Other where.c cleanups. (CVS 6536) file: [576a21f6] check-in: [1c508a99] user: drh branch: trunk, size: 136246
02:15
Remove the rowhash object from the code. Rowset now fills its role. (CVS 6535) file: [48f711d2] check-in: [e963bed0] user: drh branch: trunk, size: 136411
2009-04-21
17:23
Fix a segfault that followed a malloc failure introduced by (6527). (CVS 6532) file: [89436306] check-in: [08e71b11] user: danielk1977 branch: trunk, size: 136634
09:02
Attempt to optimize virtual table queries with 'OR' expressions in the WHERE clause. (CVS 6527) file: [2b580cc5] check-in: [f61e4cd9] user: danielk1977 branch: trunk, size: 136597
2009-04-07
13:48
Only enable WHERE-tracing when both TEST and DEBUG are enabled. (CVS 6463) file: [ddf26069] check-in: [55b93649] user: drh branch: trunk, size: 131014
00:43
Always enable WHERE-tracing on a test build. Oops - accidentally included a debugging change to pragma.c in this check-in. The real fix for the pragma problem is in the following checking. (CVS 6458) file: [70199494] check-in: [567cf90b] user: drh branch: trunk, size: 130989
2009-04-06
12:26
Make sure the reverse_unordered_selects pragma works even on unindexed tables that are queried without a WHERE clause (CVS 6453) file: [0eeb451e] check-in: [d8c6b28a] user: drh branch: trunk, size: 130970
2009-03-29
00:15
Turn off the debugging macros in where.c - left on by mistake in the previous check-in. (CVS 6404) file: [5a421d72] check-in: [b601a575] user: drh branch: trunk, size: 130684
00:13
Improvements to cost estimation for evaluating the IN operator. Ticket #3757. (CVS 6403) file: [72b84f31] check-in: [0c438e81] user: drh branch: trunk, size: 130684
2009-03-25
16:51
Remove an unused parameter from sqlite3DequoteExpr. Fix another unrelated and harmless compiler warning. (CVS 6386) file: [d0a78f87] check-in: [8589b0fc] user: drh branch: trunk, size: 129733
2009-03-22
20:36
Allow the keyword INDEXED to be used as the name of a table or index or column - for backwards compatibility. (CVS 6370) file: [55b13048] check-in: [53149c9f] user: drh branch: trunk, size: 129737
2009-03-20
14:18
Make sure struct WhereClause is aligned on an 8-byte boundary. Fix for #3613, #3736. (CVS 6364) file: [42d3756d] check-in: [093a0cf4] user: danielk1977 branch: trunk, size: 129747
2009-03-05
03:48
Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335) file: [ac555c8f] check-in: [5477833e] user: shane branch: trunk, size: 129385
2009-02-24
10:14
Reverse commit (6315) for now. (CVS 6317) file: [ddc9074b] check-in: [0e7c369c] user: danielk1977 branch: trunk, size: 129379
2009-02-23
17:33
Scan an index instead of a table for "SELECT count(*) FROM <tbl>" queries. Because an index is usually smaller than a table on disk, this saves some IO. (CVS 6315) file: [591db2b9] check-in: [294ba6f7] user: danielk1977 branch: trunk, size: 129888
16:52
Add the reverse_unordered_selects pragma. (CVS 6314) file: [72980baa] check-in: [bc078e00] user: drh branch: trunk, size: 129337
2009-02-20
10:58
Instead of using SetNumColumns, specify the number of columns in a table or index using the P4 argument. (CVS 6310) file: [de921742] check-in: [e43ed649] user: danielk1977 branch: trunk, size: 128619
2009-02-19
14:39
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) file: [2284de47] check-in: [d9f6ffbc] user: danielk1977 branch: trunk, size: 128667
2009-02-04
03:59
Changes to completely remove all floating point ops if SQLITE_OMIT_FLOATING_POINT defined. Note that w/o fp, date/time, round, nan, etc. are all gone or limited in functionality. Updated some of the test scripts to support missing fp and 64-bit functionality. Ticket #3029. (CVS 6250) file: [63bb7527] check-in: [5cef4000] user: shane branch: trunk, size: 128342
01:49
Remove compiler warnings under MSVC. (CVS 6249) file: [fb89dfb2] check-in: [6301f08a] user: shane branch: trunk, size: 127987
2009-01-30
05:40
Minor changes to remove a few MSVC compiler warnings at /W3. Ticket #3610. (CVS 6215) file: [ac21a2bc] check-in: [c74c78e4] user: shane branch: trunk, size: 127987
2009-01-24
09:56
Remove incorrect ALWAYS macro associated with empty IN() sets. Ticket #3602. (CVS 6202) file: [48249767] check-in: [f3c09a0c] user: danielk1977 branch: trunk, size: 127989
2009-01-14
00:55
Make sure the OR-clause optimizer takes the cost of sorting into account. Reset the rowid cache on the OP_Rewind and OP_Last opcodes. Bump the version number so that we can do an emergency release. Ticket #3581. (CVS 6173) file: [e9a37def] check-in: [d28b5820] user: drh branch: trunk, size: 127989
2009-01-10
15:34
Fix a bug caused by overzealous code test coverage simplifications. Bug found by TH3. (CVS 6157) file: [bd4fef17] check-in: [3da55787] user: drh branch: trunk, size: 127786
2009-01-09
02:49
More coverage improvements. (CVS 6148) file: [8259ee36] check-in: [6e171c0a] user: drh branch: trunk, size: 127731
2009-01-08
21:00
Increased test coverage in where.c. (CVS 6146) file: [86cd4009] check-in: [1e5725c5] user: drh branch: trunk, size: 127731
03:11
Increase test coverage of where.c. Make sure OR-optimization works on UPDATE and DELETE in addition to SELECT. (Bug found by coverage tests.) (CVS 6139) file: [c67797ea] check-in: [4b2c08e8] user: drh branch: trunk, size: 127790
2009-01-07
20:58
Add new test cases to increase coverage of where.c. (CVS 6138) file: [92ef9d96] check-in: [2e1ab51f] user: drh branch: trunk, size: 127648
18:24
Fix a bug in the LIKE query optimization. (Found by coverage testing.) (CVS 6137) file: [9852acec] check-in: [fe90e911] user: drh branch: trunk, size: 127592
2009-01-06
14:19
Fix compiler warnings. (CVS 6117) file: [ad9d49f7] check-in: [da770a8d] user: drh branch: trunk, size: 127309
00:08
Fix a problem in the WHERE clause generator when the FROM clause is empty. (CVS 6114) file: [0b2eb969] check-in: [a7015625] user: drh branch: trunk, size: 127424
2008-12-30
17:55
Fix a bug in the multi-index OR cost estimator. Remove leftover "breakpoint" commands from test scripts. (CVS 6086) file: [b25a7ecf] check-in: [b090d573] user: drh branch: trunk, size: 127424
16:18
Get EXPLAIN QUERY PLAN working with the multi-index OR optimization. Added new test script "where9.test". (CVS 6084) file: [bb4f4f60] check-in: [4b646022] user: drh branch: trunk, size: 127241
15:26
Add a few more tests to where8.test. (CVS 6081) file: [44df523c] check-in: [ac28aa8b] user: danielk1977 branch: trunk, size: 127116
12:00
Add a couple of extra tests for the "WHERE ... OR" optimization. (CVS 6077) file: [924e77c6] check-in: [35c87585] user: danielk1977 branch: trunk, size: 127141
09:45
Fix a bug in where.c causing a malfunction when an INDEXED BY clause specified an unusable index on other than the leftmost table in the FROM clause. Ticket #3560. (CVS 6076) file: [1e1cadcf] check-in: [f8ff0212] user: danielk1977 branch: trunk, size: 127216
2008-12-29
23:45
Always make sure WhereClause objects are initialized to zero when they are first allocated. (CVS 6073) file: [d0f422dd] check-in: [7d0ae55d] user: drh branch: trunk, size: 127105
18:33
Add test file where8.test. (CVS 6072) file: [90b1fa8a] check-in: [bff460ec] user: danielk1977 branch: trunk, size: 127112
14:51
Remove an old variable declaration that was commented out using a C++ comment. (CVS 6071) file: [a102f06e] check-in: [0b972f14] user: danielk1977 branch: trunk, size: 127113
2008-12-28
20:47
Multi-index OR optimizer response to ORDER BY rowid. But fix in sqlite3_stmt_status(): report a full table scan when "ORDER BY rowid" is used without constraints. (CVS 6069) file: [29c57ed5] check-in: [3464d369] user: drh branch: trunk, size: 127185
18:35
Optimize WHERE clauses that constain AND, BETWEEN, and LIKE terms as operands of an OR. (CVS 6068) file: [4050b918] check-in: [67cf24b3] user: drh branch: trunk, size: 126950
16:55
Simplify the VM code that implements WHERE claues. (CVS 6067) file: [f41330e7] check-in: [fa95f843] user: drh branch: trunk, size: 125876
2008-12-24
11:25
Fix a virtual table related assert() that can fail following a malloc failure. (CVS 6064) file: [b273a232] check-in: [c6fd3b8f] user: danielk1977 branch: trunk, size: 125456
2008-12-23
23:56
Continuing improvements to the multi-index OR-clause optimizer. Added a few simple test cases. (CVS 6062) file: [ef69833c] check-in: [55d4f493] user: drh branch: trunk, size: 125338
16:23
Fix an OOM problem in where.c. (CVS 6060) file: [3f4e8020] check-in: [d2105f61] user: drh branch: trunk, size: 122645
13:35
Multi-index OR-clause optimization now works for simple tests. There are no test scripts for it yet, though. And it is disabled by default, pending further testing and optimization. We need a lot of both. (CVS 6058) file: [50e47032] check-in: [d77a7023] user: drh branch: trunk, size: 122598
2008-12-21
03:51
Continue refactoring where.c in preparation for installing OR-clause optimizations. (CVS 6050) file: [6e5de242] check-in: [778e91dd] user: drh branch: trunk, size: 121117
2008-12-20
02:06
Enhanced analysis of OR terms in a WHERE clause. Another step toward being able to use indices with OR-connected WHERE clause terms. (CVS 6045) file: [d373103e] check-in: [c3f7aa01] user: drh branch: trunk, size: 118258
2008-12-17
19:22
Update the WHERE clause processing infrastructure in preparation for adding multi-index OR evaluation. (CVS 6037) file: [685a1e8d] check-in: [78401b33] user: drh branch: trunk, size: 112590
2008-12-12
17:56
Rework the rowid lookup logic in the query optimizer to fix various boundary value problems. Ticket #3536. Renamed the OP_MoveXX opcodes to OP_SeekXX. (CVS 6024) file: [0ef44949] check-in: [e545490a] user: drh branch: trunk, size: 109200
2008-12-10
19:26
Never use strlen(). Use our own internal sqlite3Strlen30() which is guaranteed to never overflow an integer. Additional explicit casts to avoid nuisance warning messages. (CVS 6007) file: [7c6ab881] check-in: [c872d554] user: drh branch: trunk, size: 109084
2008-12-09
01:32
Fix compiler warnings in where.c and in the TCL test harness. (CVS 5994) file: [c5a21be6] check-in: [680755db] user: drh branch: trunk, size: 109066
2008-12-08
21:37
Some minor name refactoring in where.c. Avoid declaring variables before initializing them in the amalgamation because VC++ doesn't like that. (CVS 5993) file: [538cbf21] check-in: [6ed696e7] user: drh branch: trunk, size: 108965
2008-12-05
17:17
Fix harmless compiler warnings. Improved comments in the query optimizer. (CVS 5982) file: [d2761121] check-in: [adedd697] user: drh branch: trunk, size: 108803
15:24
Make use of sqlite3DbMallocSize to maximize the size of growable buffers after each reallocation. Added new comments and testcase() macros to where.c. (CVS 5981) file: [78ecad37] check-in: [46f2d089] user: drh branch: trunk, size: 108794
02:36
Variable name changes in the query optimizer for disambiguation and clarification. Clear space in boolean vectors for new bit values to encode new query plan templates. (CVS 5980) file: [ef2a149b] check-in: [81bd0b5c] user: drh branch: trunk, size: 107774
2008-11-17
19:18
Modifications to avoid unsigned/signed comparisons in various files. (CVS 5914) file: [96f7c2bd] check-in: [8009220c] user: danielk1977 branch: trunk, size: 107275
16:42
Modifications to avoid unsigned/signed comparisons in where.c. (CVS 5913) file: [40a5c31c] check-in: [f35606d1] user: danielk1977 branch: trunk, size: 107387
2008-11-03
09:06
Fix a bug reported on the mailing list triggered by the pattern "SELECT , (SELECT ... FROM tbl WHERE rowid > ) FROM ...". (CVS 5855) file: [171c9b25] check-in: [6c918c4e] user: danielk1977 branch: trunk, size: 107396
2008-10-25
15:03
Disable the result-set alias cache when on conditional code branches. Ticket #3461. The column cache and result set alias cache mechanisms are prone to this kind of error and need to be refactored. This check-in should be considered a temporary fix in advance of a more general redesign of the whole mechanism. (CVS 5841) file: [1853c1bf] check-in: [1fa3bbd8] user: drh branch: trunk, size: 106922
2008-10-11
16:47
Fix a memory leak on ORDER BY of a compound select caused by the resolver on a flattened query. Also fix a OOM segfault in WHERE clause processing. (CVS 5801) file: [76bc0a7a] check-in: [d2c252d6] user: drh branch: trunk, size: 106823
2008-10-07
23:46
Add the experimental sqlite3_stmt_status() interface. (CVS 5781) file: [53d495de] check-in: [de473efb] user: drh branch: trunk, size: 106840
2008-10-06
05:32
Allow INDEXED BY and NOT INDEXED clauses in SELECT statements. (CVS 5766) file: [da2a0e13] check-in: [98ca5580] user: danielk1977 branch: trunk, size: 106754
2008-10-01
08:43
Fix a bug in where.c where a non-temp register was being incorrectly deallocated. Ticket #3408. (CVS 5758) file: [75b7f45b] check-in: [59d2e89e] user: danielk1977 branch: trunk, size: 105387
2008-09-06
14:19
Deallocate a temp register allocated by codeEqualityTerm() in where.c. If it is not deallocated, its value may be reused by the column-cache mechanism. However, by the time it is used, the value may have been clobbered by a sub-routine that also uses the same temp register. Fix for #3357. (CVS 5679) file: [a9958b26] check-in: [7c0f638e] user: danielk1977 branch: trunk, size: 105387
2008-08-25
12:08
Two if statements should be asserts. GCC was silently ignoring them, hence the problem did not show up in coverage testing. Ticket #3333. (CVS 5607) file: [72a4ac68] check-in: [635933b1] user: drh branch: trunk, size: 105338
2008-08-20
16:35
Refactor the name resolution procedures in the code generator. (CVS 5569) file: [b156f278] check-in: [daf730d1] user: drh branch: trunk, size: 105330
2008-08-01
17:37
Test that virtual table methods xBestIndex, xOpen, xFilter, xNext, xColumn, xRowid, xUpdate, xSync and xBegin can all return error messages using the sqlite3_vtab.zErrMsg variable. (CVS 5519) file: [a800184a] check-in: [007359b7] user: danielk1977 branch: trunk, size: 105063
2008-07-28
19:34
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) file: [ee4878e4] check-in: [e48f9697] user: drh branch: trunk, size: 104884
2008-07-12
14:52
Remove leftover debugging commands (breakpoint and btree_breakpoint) from test scripts. (CVS 5400) file: [e4c40d22] check-in: [dcb16024] user: drh branch: trunk, size: 104685
2008-07-11
16:15
Additional test coverage for the btree module. Remove the failsafe() macro and replace it with ALWAYS() and NEVER(). (CVS 5395) file: [087bfd37] check-in: [d7e2f0d2] user: drh branch: trunk, size: 104672
2008-07-09
13:28
Begin adding the failsafe() macro. (CVS 5383) file: [3324f827] check-in: [8aae4fe7] user: drh branch: trunk, size: 104756
2008-07-08
22:28
Added macros to convert between 32-bit ints and 64-bit ptrs to avoid compiler warnings. (CVS 5378) file: [e8a241aa] check-in: [6cdb6841] user: shane branch: trunk, size: 104645
19:45
Fix a bug in where.c introduced by check-in (5373). (CVS 5375) file: [013a14f8] check-in: [1ed98f9e] user: drh branch: trunk, size: 104619
18:05
Improved testing of the min/max optimization. (CVS 5373) file: [1422d956] check-in: [fa07c360] user: drh branch: trunk, size: 104638
2008-06-26
18:04
Fix handling of "x IN (...)" and "x NOT IN (...)" expressions when the set contains an SQL NULL value. (CVS 5314) file: [6a22ceb8] check-in: [d45a97be] user: danielk1977 branch: trunk, size: 104582
2008-06-25
02:47
If a unique index covers any prefix of the ORDER BY clause then let it satisfy the ORDER BY clause. (CVS 5301) file: [767db25b] check-in: [e53403b6] user: drh branch: trunk, size: 104574
2008-06-15
02:51
Continuing work on the new memory allocation subsystem. Added routines for temporary memory allocation. Right the btree balance mechanism to only do one temporary allocation at a time. (CVS 5220) file: [5c4a999f] check-in: [65fe7b62] user: drh branch: trunk, size: 104456
2008-06-12
00:07
Additional refinements to the new sqlite3_initialize() interface design. (CVS 5206) file: [6af9313b] check-in: [14a9b945] user: drh branch: trunk, size: 104457
2008-05-30
14:58
Fix typos in comments in where.c. (CVS 5180) file: [53c6b801] check-in: [7cadb223] user: drh branch: trunk, size: 104456
2008-05-29
05:23
Fix cosmetic issues spotted while working on ticket #3146 (CVS 5177) file: [ad88aefa] check-in: [5f6eab65] user: drh branch: trunk, size: 104453
2008-05-28
18:01
Use %llx instead of %x for 64 bit values (this only affects a debugging statement). (CVS 5170) file: [d074da73] check-in: [c81efc97] user: shane branch: trunk, size: 104379
2008-05-26
18:33
Fix the LIKE query optimizer so that it works with LIKE patterns ending in '@%' on NOCASE columns. Ticket #3139. (CVS 5158) file: [8c8b360d] check-in: [33548744] user: drh branch: trunk, size: 104376
2008-05-16
15:40
Disable the column cache when coding values that will be passed to the xFilter() method of a virtual table, in case the xFilter() implementation modifies the type or encoding of the value. Ticket #3121. (CVS 5139) file: [ef5bd7ad] check-in: [ecbc0d5d] user: danielk1977 branch: trunk, size: 104425
2008-04-19
14:40
Comment and variable-name cleanup in where.c. Add testcase() macros to insure adequate test coverage of table-driven logic. (CVS 5032) file: [85719d58] check-in: [adcef73b] user: drh branch: trunk, size: 104351
2008-04-18
10:25
Combine cases 3 and 4 in where.c, since case 4 is now a special case of case 3. (CVS 5029) file: [011f866c] check-in: [9a976819] user: danielk1977 branch: trunk, size: 102854
09:01
Allow OP_MoveGt and similar to use an array of registers instead of a serialized record. Modify one type of index range scan to use this. (CVS 5028) file: [e6850aa2] check-in: [c448f15a] user: danielk1977 branch: trunk, size: 105469
2008-04-17
19:14
Additional work on ticket #3015. The previous fix (check-in (4919)) did not appear to work in all cases and it disabled indexing in some places where it should not have. New test cases added to help insure that the current fix is better. (CVS 5026) file: [4835f36b] check-in: [0d2e258e] user: drh branch: trunk, size: 105658
2008-04-10
13:33
First cut at optimizing single-row updates to use a one-pass algorithm. (CVS 4973) file: [a686f1e0] check-in: [fba97f78] user: drh branch: trunk, size: 105487
2008-04-01
05:07
Fix the CSE mechanism so that it takes into account column affinity changes that might be imposed by comparison operators. (CVS 4949) file: [86b042dc] check-in: [91cc646e] user: drh branch: trunk, size: 104895
2008-03-31
23:48
Avoid duplicate OP_Column opcodes by remembering prior results. This is similar to CSE, but only applies to columns. (CVS 4943) file: [811fd1e5] check-in: [c29ee0fe] user: drh branch: trunk, size: 104907
18:19
Factor constant subexpressions out of loops. (CVS 4942) file: [902ddf1e] check-in: [2126db39] user: drh branch: trunk, size: 104586
2008-03-28
19:16
Fix a problem with min() and descending indexes. (CVS 4933) file: [dc146152] check-in: [39705b61] user: danielk1977 branch: trunk, size: 104294
18:11
Fix for #3022. Handle queries like "SELECT min(b) FROM T WHERE a = X AND b > X" when there is an index on (a,b). (CVS 4930) file: [aa7ca845] check-in: [bce28975] user: danielk1977 branch: trunk, size: 104285
2008-03-26
14:56
Make sure ON clause terms of a LEFT JOIN are not used with an index on the right table of the join. Ticket #3015. (CVS 4919) file: [7aeeec67] check-in: [3fafa562] user: drh branch: trunk, size: 104269
2008-03-25
09:47
Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912) file: [f18bac2f] check-in: [04715364] user: danielk1977 branch: trunk, size: 103214
2008-03-17
17:08
Abandon the OR optimization following a memory allocation failure, to avoid referencing uninitialized memory. (CVS 4872) file: [78d6689d] check-in: [9d2afbb5] user: drh branch: trunk, size: 103212
09:36
Return an error when an xBestIndex() method indicates that it intends to use the value of an unusable constraint. Related to #2998. (CVS 4867) file: [dd72c822] check-in: [ffd47027] user: danielk1977 branch: trunk, size: 103171
2008-03-04
17:45
Various renames & cleanups to limit exported symbols on amalgamation build (CVS 4819) file: [c5eaca1f] check-in: [9c6694bb] user: mlcreech branch: trunk, size: 102923
2008-02-23
21:55
Fix a bug in the LIKE optimizer that occurs when the last character before the wildcard is an upper-case 'Z'. Ticket #2959. (CVS 4807) file: [f899a98f] check-in: [610574b2] user: drh branch: trunk, size: 102926
2008-01-23
12:52
Improvements to test coverage in the lemon-generated parser and in the sqlite3_get_table() interface. (CVS 4745) file: [7ff0ca02] check-in: [9f95d79d] user: drh branch: trunk, size: 102342
03:03
Make sqlite3SafetyOn() and sqlite3SafetyOff() macros which disappear when compiling without -DSQLITE_DEBUG=1. (CVS 4744) file: [b6c296c5] check-in: [5375ad6b] user: drh branch: trunk, size: 102665
2008-01-19
20:11
Miscellaneous code simplifications and cleanup and test coverage enhancements. (CVS 4730) file: [0c18a6d8] check-in: [af129b6d] user: drh branch: trunk, size: 102702
2008-01-17
16:22
Registerification of the VDBE is complete. The operand stack has been removed from the code. All instructions operate out of registers only. (CVS 4718) file: [0cc6052f] check-in: [706b41b7] user: drh branch: trunk, size: 102660
02:36
Registerification of the WHERE clause logic. (CVS 4716) file: [75908cb6] check-in: [b3a141b2] user: drh branch: trunk, size: 102708
2008-01-12
19:03
Continuing work toward converting the VM to a register machine. (CVS 4708) file: [27e40d32] check-in: [426f31ec] user: drh branch: trunk, size: 102164
2008-01-09
23:04
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) file: [9705df3c] check-in: [e3cf1c1c] user: drh branch: trunk, size: 102208
02:15
Continued work toward converting to a register-based VM. (CVS 4698) file: [8c2bedcc] check-in: [92deff07] user: drh branch: trunk, size: 102209
2008-01-08
23:54
Registerify the comparison opcodes. (CVS 4697) file: [8f55e725] check-in: [8862ce9c] user: drh branch: trunk, size: 102224
2008-01-07
19:20
Registerify the AUTOINCREMENT processing and the OP_IsNull and OP_NotNull operators. (CVS 4692) file: [306fafa7] check-in: [aa48867c] user: drh branch: trunk, size: 102127
2008-01-05
17:39
First pass at optimizing max()/min() as described in #2853. Some refinements to come. (CVS 4687) file: [0d72b643] check-in: [c449e04f] user: danielk1977 branch: trunk, size: 102110
05:38
Register-ify the OP_ForceInt opcode. (CVS 4684) file: [941635bb] check-in: [32380dca] user: drh branch: trunk, size: 100181
04:06
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) file: [af005c6a] check-in: [cc149eb9] user: drh branch: trunk, size: 100148
2008-01-04
22:01
Implement the out2-prerelease opcode design pattern. (CVS 4681) file: [d015536e] check-in: [fe057a88] user: drh branch: trunk, size: 100180
2008-01-03
23:44
Change the sqlite3ExprCode() function so that callers can request that the result of the expression be left on the stack or in a register. (CVS 4673) file: [ce1e6c53] check-in: [61bfb77c] user: drh branch: trunk, size: 100176
18:39
Modify VFilter and VRename to use registers instead of the vdbe stack for inputs. (CVS 4670) file: [10c0616d] check-in: [253ed40a] user: danielk1977 branch: trunk, size: 100166
18:03
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) file: [f02ecb55] check-in: [0b849805] user: drh branch: trunk, size: 100012
07:54
Change OP_OpenRead and OP_OpenWrite so that the database number is read from the P3 operand, not the stack. (CVS 4663) file: [6b1d4acf] check-in: [35da261d] user: danielk1977 branch: trunk, size: 100062
00:01
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) file: [09edd04e] check-in: [027875e4] user: drh branch: trunk, size: 100100
2008-01-02
00:34
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) file: [49901aac] check-in: [051ec01f] user: drh branch: trunk, size: 99985
2007-12-12
17:42
Try to find some more stack leaks by adding OP_StackDepth to loops in DML statements. None were found. (CVS 4617) file: [4d71db7e] check-in: [12c3029b] user: danielk1977 branch: trunk, size: 100001
2007-11-29
17:43
When using an index to scan a database table, read column data from the index in preference to the table. This increases the likelihood that the table will not be required at all. (CVS 4580) file: [7ec7c7a5] check-in: [061608c7] user: danielk1977 branch: trunk, size: 99954
17:05
Optimisations for expressions of the form "<value> IN (SELECT <column> FROM )". (CVS 4579) file: [a03cd9da] check-in: [56d0e326] user: danielk1977 branch: trunk, size: 99750
2007-11-26
13:36
Additional out-of-memory testing. Fix bugs caused by malloc failures in where.c. Tickets #2794, #2795, #2796, and #2797. (CVS 4560) file: [82e2cb76] check-in: [5e02dbab] user: drh branch: trunk, size: 99664
2007-11-05
05:12
Handle "IS NULL" constraints on virtual table scans. IS NULL constraints are not passed to the virtual table layer. Ticket #2759. (CVS 4523) file: [ddcbc5c4] check-in: [7027368c] user: danielk1977 branch: trunk, size: 99574
2007-09-13
17:54
Fix incorrect index cost assumptions that occur after an ANALYZE. Ticket #2643. (CVS 4424) file: [44042c8b] check-in: [2cfdbfe6] user: drh branch: trunk, size: 99466
2007-09-12
15:41
In the query optimizer, make sure table dependencies from all terms of a compound SELECT statement are recognized so that subqueries in a WHERE clause are not evaluated too early. Fix for ticket #2640. (CVS 4422) file: [1b3a67bb] check-in: [9c9c2a1d] user: drh branch: trunk, size: 99486
2007-08-29
14:06
Use the DbMalloc() and DbRealloc() functions more consistently. (CVS 4323) file: [4687a2a5] check-in: [c790c234] user: danielk1977 branch: trunk, size: 99491
12:31
Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321) file: [beade77e] check-in: [e38ef81b] user: danielk1977 branch: trunk, size: 99514
2007-08-16
11:36
Fix some more small problems introduced by recent refactoring. (CVS 4235) file: [2776a0ca] check-in: [5e2795d0] user: danielk1977 branch: trunk, size: 99502
10:09
More work on refactoring of malloc() interfaces. There are still many errors. (CVS 4233) file: [b5af6231] check-in: [77b16713] user: danielk1977 branch: trunk, size: 99499
04:30
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) file: [366bfb2b] check-in: [deb7ecd6] user: drh branch: trunk, size: 99441
2007-07-30
14:40
Fix a bug with explicit collation sequences attached to a column reference expression that is on the right-hand-side of a binary comparison operator. (CVS 4187) file: [c7e13b81] check-in: [7b699686] user: danielk1977 branch: trunk, size: 99146
2007-06-11
12:56
Fix a bug in the LIKE optimization that was causing the pattern string to be dequoted twice. Ticket #2407. (CVS 4056) file: [12387641] check-in: [abf64d1d] user: drh branch: trunk, size: 98440
2007-06-08
08:39
Make sure rowid comparisons against NULL work correctly. Ticket #2404. (CVS 4050) file: [b5e7a973] check-in: [11ee8ea4] user: drh branch: trunk, size: 98406
00:20
Fix the query optimizer so that it correctly handles constant expressions in the ON clause of a LEFT JOIN. Ticket #2403. (CVS 4049) file: [6a3c44fe] check-in: [46fdd195] user: drh branch: trunk, size: 98400
2007-06-02
07:54
Fix a vdbe stack leak that could occur where one side of a WHERE clause inequality evaluated to SQL null. (CVS 4045) file: [0662fcd8] check-in: [17152bf1] user: danielk1977 branch: trunk, size: 98401
2007-05-29
12:11
Consider explicit collate clauses when matching WHERE constraints to indices. Fix for #2391. (CVS 4040) file: [1c27ddb2] check-in: [f9a95e92] user: danielk1977 branch: trunk, size: 98399
2007-05-04
13:15
Eliminate all uses of sprintf() and strcpy(). These were not being misused. But getting rid of them removes a library dependency. And it avoids warnings from the OpenBSD compiler. Ticket #2336. (CVS 3916) file: [f3920748] check-in: [ba4845b3] user: drh branch: trunk, size: 98292
2007-04-20
12:22
Remove the ARRAYSIZE macro from where.c to avoid a name conflict with microsoft header files. Ticket #2311 (CVS 3863) file: [0f17b7be] check-in: [9389a15f] user: drh branch: trunk, size: 98277
2007-04-06
01:04
Changes to increase test coverage. (CVS 3819) file: [fce0dad6] check-in: [fd4da6b1] user: drh branch: trunk, size: 98380
2007-03-31
01:34
Fix memory leaks in WHERE clause processing and in TRIGGER parsing. (CVS 3775) file: [25e0dbb9] check-in: [6736f454] user: drh branch: trunk, size: 98416
2007-03-30
14:56
Coverage improvements for where.c. (CVS 3764) file: [881cfd88] check-in: [7e0aa964] user: danielk1977 branch: trunk, size: 98191
09:13
Test coverage a few extra lines in where.c. (CVS 3756) file: [b5f8e2a0] check-in: [ea49ddf6] user: danielk1977 branch: trunk, size: 97992
2007-03-28
14:30
Correctly handle NULLs in IN operators. Ticket #2273. The changes in where.c and in the WhereLevel.aInLoop structure are not strictly necessary to fix this problem - they just make the code easier to read. Only the change in OP_Next/OP_Prev operator of vdbe.c is required. (CVS 3735) file: [df68bcbb] check-in: [26348556] user: drh branch: trunk, size: 97595
2007-03-27
13:36
More strict aliasing fixes. The single source file library now runs successfully with -fstrict-alias. (CVS 3725) file: [0ef9acc4] check-in: [c8a8a189] user: drh branch: trunk, size: 97040
2007-03-26
22:05
Modify sources to that they can be combined into a single sqlite3.c source file. Eliminate all type-pruned pointer warnings. (CVS 3722) file: [0825fabc] check-in: [0b832e21] user: drh branch: trunk, size: 97011
2007-03-02
08:12
Handle the case where the estimated cost of a virtual table scan is larger than SQLITE_BIG_DBL. Ticket #2253. (CVS 3670) file: [1242dd54] check-in: [52885ed8] user: danielk1977 branch: trunk, size: 96941
2007-02-23
23:13
Disable the OR optimization if it would conflict with column affinity coercions. Ticket #2249. Additional cleanup and testing of the OR optimization. (CVS 3658) file: [d4a10cf4] check-in: [908daaa9] user: drh branch: trunk, size: 96574
2007-02-06
13:26
When optimizing out an ORDER BY clause due to uniqueness constraints, make sure unused terms to the right in the ORDER BY clause to not reference other tables in a join. Ticket #2211. Additional test cases needed before closing this ticket. (CVS 3629) file: [2a919a3f] check-in: [912faf18] user: drh branch: trunk, size: 93528
2007-01-25
16:56
Fix an additional problem with the IS NULL optimization on LEFT JOINs. Ticket #2189. See also ticket #2177. (CVS 3602) file: [23dc1c75] check-in: [358dd82d] user: drh branch: trunk, size: 92188
2007-01-19
01:06
Make sure the IS NULL optimization introduced by check-in (3494) correctly handles a LEFT JOIN where the a term from the right table of the join uses an IS NULL constraint. Ticket #2177. This check-in also adds the new test cases that were suppose to have been added with (3494) but which were mistakenly omitted. (CVS 3595) file: [46dea18b] check-in: [335863e4] user: drh branch: trunk, size: 91700
2006-12-20
03:24
The query optimizer does a better job of optimizing out ORDER BY clauses that contain the rowid or which use indices that contain the rowid. Ticket #2116. (CVS 3536) file: [f55d4459] check-in: [f245f5c2] user: drh branch: trunk, size: 91215
2006-12-16
16:25
Query optimizer enhancement: In "FROM a,b,c left join d" allow the C table to be reordered with A and B. This used to be the case but the capability was removed by (3203) and (3052) in response to ticket #1652. This change restores the capability. (CVS 3529) file: [b34cc2c7] check-in: [7393c81b] user: drh branch: trunk, size: 90018
2006-11-06
15:10
Fix a bug in the optimizer that was causing it to miss an OR optimization opportunity. (CVS 3502) file: [6e215af5] check-in: [9bf153b5] user: drh branch: trunk, size: 90098
2006-10-28
00:28
Enhance the optimizer so that IS NULL can use an available index. (CVS 3494) file: [1c33e196] check-in: [64762a9d] user: drh branch: trunk, size: 90111
2006-10-27
14:06
Changes directed toward optimizing IS NULL terms in WHERE clauses. (CVS 3492) file: [65a19a70] check-in: [4d336e9e] user: drh branch: trunk, size: 90368
2006-10-18
23:26
Fix a problems that arise if malloc() fails while compiling SELECT statements within a TRIGGER. (CVS 3478) file: [49a0e7cc] check-in: [ee4894b4] user: drh branch: trunk, size: 90039
2006-06-27
13:20
Changes so that it will build with SQLITE_OMIT_VIRTUALTABLE=1. (CVS 3309) file: [75a89957] check-in: [5612b287] user: drh branch: trunk, size: 89946
12:16
Fix bug in transfer of arguments from WHERE clause to virtual table xFilter() methods. (CVS 3305) file: [a5d5cec9] check-in: [cf41f2a3] user: danielk1977 branch: trunk, size: 89862
02:36
Make sure that MATCH terms that a virtual table says should be omitted really are omitted. (CVS 3302) file: [aab29cf7] check-in: [3e1f5567] user: drh branch: trunk, size: 89856
02:33
Cleanup and refactor parts of the optimizer. (CVS 3301) file: [f794d15f] check-in: [6609c25f] user: drh branch: trunk, size: 89855
01:54
Cache and reuse virtual table index information in the optimizer. Improved diagnostics for virtual table index selection. (CVS 3300) file: [676105f8] check-in: [28413cf2] user: drh branch: trunk, size: 89882
2006-06-24
11:51
A few more test cases to improve coverage of virtual table module related code. (CVS 3292) file: [8ba6fa49] check-in: [255aa912] user: danielk1977 branch: trunk, size: 88327
2006-06-23
08:05
Add tests and fixes for handling malloc() failures related to the virtual table feature. (CVS 3285) file: [6175449f] check-in: [5d1d9071] user: danielk1977 branch: trunk, size: 88321
2006-06-20
13:07
Fix some problems with virtual tables and joins in where.c. (CVS 3277) file: [0a133571] check-in: [3e19a7d8] user: danielk1977 branch: trunk, size: 88195
2006-06-19
12:02
Avoid returning MISUSE when sqlite is called recursively by an xBestIndex callback. (CVS 3274) file: [485d368d] check-in: [4339e1bf] user: danielk1977 branch: trunk, size: 87863
04:49
Fix memory leak in where.c. (CVS 3271) file: [0f1fcc2c] check-in: [3d10e8f3] user: danielk1977 branch: trunk, size: 87702
2006-06-14
22:07
Bug fixes in the MATCH and ORDER BY processing of virtual tables. (CVS 3249) file: [d7c3cc01] check-in: [c996185a] user: drh branch: trunk, size: 87659
19:00
Added code to INSERT, DELETE and UPDATE virtual tables. The new code is mostly untested. (CVS 3248) file: [393022cb] check-in: [32c97b88] user: drh branch: trunk, size: 87418
2006-06-13
23:51
The echo module test is now running. Added the tclvar module test but have not yet done anything with it. (CVS 3234) file: [299c385e] check-in: [29199eee] user: drh branch: trunk, size: 87418
17:39
The optimizer recognizes MATCH operators and allows virtual-tables to make use of them. (CVS 3232) file: [7e614b02] check-in: [136bed49] user: drh branch: trunk, size: 87017
15:00
Add the tentative sqlite3_allocate_queryplan() API. (CVS 3228) file: [0b1fcf59] check-in: [7a3e97f7] user: danielk1977 branch: trunk, size: 83207
14:16
Add simple tests for the xFilter and xBestIndex methods. (CVS 3227) file: [f2e17c6f] check-in: [0f4657ea] user: danielk1977 branch: trunk, size: 83007
01:04
Progress toward getting the virtual-table code generator to work. (CVS 3220) file: [c0f3cd38] check-in: [3532f134] user: drh branch: trunk, size: 82799
2006-06-12
21:59
Added code to iterate through virtual tables. All regression tests pass but the new code is completely untested. (CVS 3219) file: [d312cf79] check-in: [01096543] user: drh branch: trunk, size: 82691
2006-06-11
23:41
Progress toward CREATE VIRTUAL TABLE. Still not even close to working... (CVS 3211) file: [3dc5269b] check-in: [898ec36b] user: drh branch: trunk, size: 75818
2006-06-06
11:45
In joins of the form "A left B, C" make sure they are not transformed into "A left C, B". Ticket #1830. See also #1652. (CVS 3203) file: [06ec4431] check-in: [2baa9836] user: drh branch: trunk, size: 75826
2006-05-11
13:26
Correctly handle multi-column indices where multiple columns are constrained by IN operators with subqueries on the right-hand side. Ticket #1807. (CVS 3184) file: [a8f0317d] check-in: [b16541ba] user: drh branch: trunk, size: 75711
2006-04-21
09:38
Additional information about index sorting in EXPLAIN QUERY PLAN. (CVS 3176) file: [dc626f8c] check-in: [39dd9695] user: drh branch: trunk, size: 75695
2006-03-28
23:55
Join optimizer enhancements. (CVS 3156) file: [1ba8eb02] check-in: [0039888f] user: drh branch: trunk, size: 75592
2006-02-24
02:53
Remove unused parameters on internal APIs. Suppress warnings from CodeWarrior. (CVS 3110) file: [39af47e7] check-in: [4b22e4b8] user: drh branch: trunk, size: 75030
2006-02-01
02:45
In joins of the form: "A, B left C" make sure that the reordering optimization does not put table A after table C. Ticket #1652. (CVS 3052) file: [c7d71d5e] check-in: [248b9be9] user: drh branch: trunk, size: 75077
2006-01-24
12:09
Rename some variables to avoid hiding others. Also add "static" to two function signatures that were missing it. (CVS 3024) file: [8409e00f] check-in: [d86f18a4] user: danielk1977 branch: trunk, size: 74976
2006-01-23
13:22
Do not name variables "operator" because some compilers do not realize that "operator" is not a reserved word in ANSI-C. Ticket #1625. (CVS 2997) file: [f79bc17f] check-in: [1f42a338] user: drh branch: trunk, size: 74968
13:00
Fix additional compiler warnings. Tickets #1615, #1616, #1627 (CVS 2994) file: [4c77a9dc] check-in: [6385628e] user: drh branch: trunk, size: 74959
2006-01-20
18:10
More compiler warnings fixed - or in some cases comments are added to explain that the compiler is wrong. (CVS 2984) file: [7ce7a52f] check-in: [507653a9] user: drh branch: trunk, size: 75274
2006-01-18
16:51
Use a global variable protected by a mutex instead of thread-specific-data to record malloc() failures. (CVS 2972) file: [5215507b] check-in: [ac090f2a] user: danielk1977 branch: trunk, size: 75282
2006-01-14
08:02
Fixes for OMIT_SUBQUERY builds: Disable where clause OR->IN optimization. Include EXISTS keyword (for new CREATE TABLE syntax). Test file fixes. (CVS 2943) file: [9fd58a8f] check-in: [8e79a0c2] user: danielk1977 branch: trunk, size: 75342
2006-01-13
15:58
Avoid parsing an entire record header when it is not required. (CVS 2940) file: [6885d655] check-in: [0de729d9] user: danielk1977 branch: trunk, size: 75156
13:01
Fix a vdbe stack overflow problem that could occur with a correlated sub-query. (CVS 2938) file: [1e19c96c] check-in: [caa7da80] user: danielk1977 branch: trunk, size: 74918
06:33
Minor modification to restoreOrClearCursorPosition() to improve efficiency. Do not allocate the extra 8-bytes if memory-management is not enabled. (CVS 2936) file: [a12b4542] check-in: [dd705955] user: danielk1977 branch: trunk, size: 74713
2006-01-11
21:41
Automatically deallocate thread-specific data when it is no longer being used. Ticket #1601. Also implemented the suggestion of ticket #1603. Memory management is now off by default at compile-time. The sqlite3_enable_memory_management() API has been removed. (CVS 2919) file: [a8ba7f4a] check-in: [5d9c6aa9] user: drh branch: trunk, size: 74706
2006-01-10
17:58
Store collation sequence names instead of pointers in sharable schema data structures. (CVS 2904) file: [4fecfccf] check-in: [0f0213be] user: danielk1977 branch: trunk, size: 74690
2006-01-09
06:29
Rename DbSchema to "Schema" and SqliteTsd to "ThreadData". (CVS 2893) file: [18a7a16a] check-in: [82b81f69] user: danielk1977 branch: trunk, size: 74634
2006-01-07
13:21
In shared-cache mode, lock all required tables before beginning to execute the body of the statement program. (CVS 2881) file: [de22a3a8] check-in: [23b587b0] user: danielk1977 branch: trunk, size: 74613
2006-01-05
11:34
Add the shared schema/pager modifications. Very few tests so far. (CVS 2859) file: [3ec45076] check-in: [deeda0dc] user: danielk1977 branch: trunk, size: 74529
2005-12-21
18:36
Bug fixes and additional testing of descending indices. (CVS 2841) file: [0296a20c] check-in: [5638a11e] user: drh branch: trunk, size: 74285
03:16
Progress toward decending indices. (CVS 2839) file: [4db62a60] check-in: [112a34b8] user: drh branch: trunk, size: 74180
2005-12-07
06:27
Add some tests for malloc() failure within the column_name() and column_decl() APIs. (CVS 2805) file: [269569f3] check-in: [78f10ca0] user: danielk1977 branch: trunk, size: 73156
2005-12-06
12:52
Some elements of the new malloc() failure handling. Not all cases work properly yet. Also, library is not threadsafe if malloc() fails right now. (CVS 2800) file: [c0882f2d] check-in: [e1606658] user: danielk1977 branch: trunk, size: 73148
2005-11-26
14:24
Disable the OR-clause optimization if it does not result in an index being used that would not have been used otherwise. In other words, do not convert OR clauses into an IN statement if it does not help the optimizer. (CVS 2789) file: [a9fed5a5] check-in: [7e7cfce0] user: drh branch: trunk, size: 73125
14:08
Make sure left joins still work even when the OR clause optimization fires. Ticket #1537. (CVS 2788) file: [1d144279] check-in: [cbbeb9de] user: drh branch: trunk, size: 73022
2005-11-21
12:48
Less verbose output when EXPLAIN QUERY PLAN identifies use of the primary key. (CVS 2772) file: [9c260db8] check-in: [5045f099] user: drh branch: trunk, size: 72669
12:46
The EXPLAIN QUERY PLAN now identifies when tables use the integer primary key. (CVS 2771) file: [312ca128] check-in: [80721e2c] user: drh branch: trunk, size: 72677
2005-11-14
22:29
Create separate affinities for INTEGER and REAL. (CVS 2766) file: [5b1bc977] check-in: [ce06c123] user: drh branch: trunk, size: 72538
2005-10-13
02:09
Attempt to fix the SQLite core so that no floating point operations are used anywhere if SQLITE_OMIT_FLOATING_POINT is defined at compile-time. This is useful to people who use SQLite on embedded processors that lack floating point support. (CVS 2749) file: [5252bf20] check-in: [a0bdb584] user: drh branch: trunk, size: 72523
2005-09-20
17:42
Code cleanup and simplification. Three new Mem opcodes added. The sqlite3VdbeJumpHere function added. (CVS 2730) file: [3ed72ca0] check-in: [2471957f] user: drh branch: trunk, size: 72178
08:47
Update comments in where.c. No code changes. (CVS 2727) file: [363b4fb0] check-in: [bb84d27e] user: drh branch: trunk, size: 72305
2005-09-19
21:05
ON-clause terms in a LEFT JOIN that restrict only the left table, should not really restrict the left table but instead rows that fail to meet the condition to be joined with NULL rows from the right table. (CVS 2725) file: [2b7b4dd1] check-in: [ea10f978] user: drh branch: trunk, size: 72179
13:15
The sqlite3_query_plan debugging variable now only appears with SQLITE_TEST=1. (CVS 2721) file: [72805108] check-in: [41e226d2] user: drh branch: trunk, size: 72137
12:37
Change some debugging #defines in order to get SSE working again after recent upgrades. (CVS 2719) file: [2e17f49a] check-in: [86eb7d83] user: drh branch: trunk, size: 72162
2005-09-17
13:29
Bug fix in the ORDER BY optimizer. Ticket #1435. (CVS 2707) file: [1cc55c9a] check-in: [553b7ba8] user: drh branch: trunk, size: 72131
13:07
Make sure dependencies on the right-hand side of IN operators are checked correctly. Ticket #1433. (CVS 2706) file: [a595744d] check-in: [21740794] user: drh branch: trunk, size: 72131
2005-09-16
02:38
Fix a whole host of newly discovered memory leaks the occur after a failure of realloc(). (CVS 2696) file: [53a54c14] check-in: [4686d649] user: drh branch: trunk, size: 71496
2005-09-10
16:46
Add the experimental EXPLAIN QUERY PLAN diagnostic capability. (CVS 2685) file: [715e317e] check-in: [986efb7b] user: drh branch: trunk, size: 71409
15:28
Use of the CROSS keyword in a join prevents table reordering. Ticket #1414. (CVS 2683) file: [d032cca1] check-in: [415b8b24] user: drh branch: trunk, size: 70889
2005-09-08
14:17
Remove a few unused variables detected by Borland C. Ticket #1412. (CVS 2675) file: [d69b304e] check-in: [cdfe372a] user: drh branch: trunk, size: 70688
2005-09-01
17:47
Fix over-aggressive optimization of ORDER BY as reported on the mailing list. (CVS 2655) file: [92ab208a] check-in: [efbb4bc8] user: drh branch: trunk, size: 70721
2005-08-29
16:40
Initialize a local variable to avoid a nuisance compiler warning. Ticket #1394. (CVS 2638) file: [bbb973cb] check-in: [9b914901] user: drh branch: trunk, size: 70689
2005-08-28
17:00
The LIKE optimization does the right thing when collating sequences are present. LIKE expressions where the left-hand side has COLLATE NOCASE are optimized in the default case. (CVS 2637) file: [14a2f906] check-in: [ef84ff79] user: drh branch: trunk, size: 70677
2005-08-24
03:52
After calling realloc() on an array to resize it, be sure not to use pointers into the old array. Ticket #1376. (CVS 2617) file: [485041aa] check-in: [9f9a2571] user: drh branch: trunk, size: 70437
2005-08-19
19:14
Increase test coverage of alter.c to 100%. Fix bugs found in the process. (CVS 2603) file: [8392d521] check-in: [b550d04d] user: drh branch: trunk, size: 70197
00:14
Bring testing coverage of the analyze.c file up to 100%. Bugs found and fixed in the process. (CVS 2599) file: [a8401eb8] check-in: [2fe0ac4f] user: drh branch: trunk, size: 70098
2005-08-14
01:20
The case_sensitive_like pragma added. Test cases added for the LIKE optimization. (CVS 2592) file: [de4b3684] check-in: [72ee21c0] user: drh branch: trunk, size: 70084
2005-08-13
16:13
Disable an overzealous optimization the omitted sorting on a join if the first table gave a unique result. The sort can only be omitted if all tables in the join are unique. Ticket #1358. (CVS 2589) file: [27d6432e] check-in: [4f076612] user: drh branch: trunk, size: 70348
2005-08-12
22:56
Optimize LIKE and GLOB operators in the WHERE clause. Code passes all regression tests but still needs additional tests. (CVS 2581) file: [ac754c02] check-in: [3edbe8d6] user: drh branch: trunk, size: 70660
2005-08-02
17:48
Minor refactoring of the new optimizer code. (CVS 2576) file: [72f68f99] check-in: [868322f7] user: drh branch: trunk, size: 67630
2005-07-29
19:43
Fix problems caused by over-agressive optimization of ORDER BY in joins. Lots more testing needed. (CVS 2571) file: [7f59d0ed] check-in: [1a4e526d] user: drh branch: trunk, size: 67663
15:10
Optimizer now converts OR-connected WHERE-clause terms into an IN operator so that they can be used with indices. There are known problems with the ORDER BY optimization in this and in several prior check-ins. This check-in is not recommended for production use. (CVS 2569) file: [c65782be] check-in: [d23c8bf8] user: drh branch: trunk, size: 67359
2005-07-28
23:12
The BETWEEN operator in a WHERE clause is now able to use indices. (CVS 2568) file: [c37799a7] check-in: [cdf8c958] user: drh branch: trunk, size: 64797
20:51
Test cases and tuning of the new optimizer code. (CVS 2567) file: [6c3de6ee] check-in: [4b02703d] user: drh branch: trunk, size: 63851
16:51
The new optimizer now passes all regression tests. (CVS 2566) file: [efed9d45] check-in: [a2121284] user: drh branch: trunk, size: 64419
2005-07-27
20:41
More work on the new optimizer. Fewer tests fail now. (CVS 2565) file: [7757b173] check-in: [ee3a08e3] user: drh branch: trunk, size: 64397
2005-07-23
22:59
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) file: [3e9f8336] check-in: [86ce56cc] user: drh branch: trunk, size: 62946
2005-07-22
00:31
Begin adding code to support multiple IN constraints on the same index. (CVS 2557) file: [70b2195b] check-in: [103f8ccb] user: drh branch: trunk, size: 58113
2005-07-21
18:23
Split the OP_Integer opcode into OP_Integer and OP_Int64. This allows comments to be added to OP_Integer. Cleanup in the optimizer. Allow terms of the FROM clause to be reordered automatically. (CVS 2556) file: [65d9b27e] check-in: [e2f822ac] user: drh branch: trunk, size: 56067
03:48
Add comments to test cases. Improvements to the query plan test variable. (CVS 2555) file: [9e5bd5f1] check-in: [ef3a157f] user: drh branch: trunk, size: 56772
03:15
In where.c, split out the code that selects an index into a separate subroutine. (CVS 2554) file: [bc0473f7] check-in: [c30cbba9] user: drh branch: trunk, size: 55214
2005-07-19
22:22