/ File History
Login

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

History of src/wherecode.c

2019-11-06
19:25
Minor simplification to the changes from check-in [36c11ad51f]. file: [9b84737f] check-in: [7bc8205d] user: mistachkin branch: trunk, size: 94562
17:31
Fix the OP_DeferredSeek index-to-table column map in P4 so that it works with generated columns. Ticket [ce22a07731530118] file: [d1b6cfac] check-in: [36c11ad5] user: drh branch: trunk, size: 94577
2019-11-04
12:49
Changes an unreachable testcase() into an assert(). file: [4b651775] check-in: [5710845b] user: drh branch: trunk, size: 94460
2019-11-03
00:07
The optimization of check-in [9b2879629c34fc0a] is incorrectly reasoned. The WHERE clause of the partial index might not be true if the table of the partial index is the right table of a left join. So disable the optimization in that case. Ticket [623eff57e76d45f6] file: [123cd05e] check-in: [3be19e11] user: drh branch: trunk, size: 94290
2019-10-24
21:02
The previous fix was incomplete. It is also necessary to disable the Expr.y.pTab field when making the translation. file: [28a3f27b] check-in: [b99d5701] user: drh branch: generated-columns, size: 93991
20:29
Fix handling of covering indexes that use virtual columns. file: [c491ae0c] check-in: [e0f7e321] user: drh branch: generated-columns, size: 93966
2019-10-19
13:29
Refactor names of column index transformation functions, for clarity. Get generated columns working with ALTER TABLE RENAME COLUMN. file: [d96190c0] check-in: [27ab41c9] user: drh branch: generated-columns, size: 92675
2019-10-18
12:52
Claw back some performance from the sqlite3ExprGetColumnOfTable() routine. file: [b9bb13fc] check-in: [e8426acb] user: drh branch: generated-columns, size: 92660
2019-10-16
12:18
Initial experimental code for generated column support. Non-functional. file: [39df666a] check-in: [11d472c1] user: drh branch: generated-columns, size: 92670
2019-10-15
19:01
Formatting change on a multi-line conditional, for improved clarity. No logic changes. file: [57d034a0] check-in: [7248e347] user: drh branch: trunk, size: 92661
2019-10-14
20:32
Futher improvements to the IN operator for row-values on virtual tables. file: [e6173659] check-in: [bc751fb6] user: drh branch: trunk, size: 92664
15:15
Fix a problem with row-value IN(...) operators and virtual tables. file: [fde87356] check-in: [aa57d7ab] user: dan branch: trunk, size: 92550
2019-08-30
23:56
When the affinity of a table column is INT or REAL, make the affinity of corresponding index columns NUMERIC. This increases the precision of index lookups for large numbers so that it matches the precision of ordinary comparison operators. Ticket [40812aea1fde9594] file: [b27b95cb] check-in: [e0d909c7] user: drh branch: trunk, size: 92553
2019-08-23
17:09
Revise the VDBE comments for NULL-scan so that they also work make sense when reading a NULLS FIRST plan. file: [535c8e22] check-in: [bfe79378] user: drh branch: nulls-last, size: 92484
17:00
Additional simplifications of the WHERE loop code generator logic for NULLS LAST. file: [3bed0f37] check-in: [1383680d] user: drh branch: nulls-last, size: 92484
16:12
Simplification of the WHERE loop code generator for NULLS LAST saves a few CPU cycles and about a hundred bytes of code space. file: [f8ba8588] check-in: [e3ed2f49] user: drh branch: nulls-last, size: 92438
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: [c02ff23e] check-in: [bf875e1a] user: drh branch: nulls-last, size: 93058
13:08
Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. file: [1700806b] check-in: [649b08ea] user: drh branch: nulls-last, size: 93046
2019-08-22
21:13
Add additional VDBE coverage macros. file: [f8005a06] check-in: [d3531f5b] user: drh branch: nulls-last, size: 92872
2019-08-21
15:41
Update this branch with latest trunk changes. file: [b8f285f9] check-in: [6153bcf4] user: dan branch: nulls-last, size: 91448
2019-08-20
11:43
Retain the affinity of an expression in a WHERE clause when it is transformed to a reference to an index column on the same expression. Fix for [f043b113]. file: [e1131fe9] check-in: [511da081] user: dan branch: trunk, size: 91179
2019-08-17
17:55
Fix problem with DESC indexes on this branch. file: [81c5d1eb] check-in: [b49df1fe] user: dan branch: nulls-last, size: 91399
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: [58889def] check-in: [81069d71] user: dan branch: nulls-last, size: 91372
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: [cf885ea2] check-in: [e8234f69] user: drh branch: pending, size: 91130
2019-08-03
19:06
Strengthen an assert() in the WHERE clause code generator for the min/max optimization. file: [5dd20651] check-in: [1bd4b97d] user: drh branch: trunk, size: 91026
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: [b45c98f2] check-in: [d465c3ee] user: dan branch: trunk, size: 91001
2019-08-02
18:43
If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37]. file: [52451ce3] check-in: [a7277ed0] user: dan branch: tkt-41866dc37, size: 90949
2019-05-07
17:47
Strive to prevent harmless compiler warnings in GCC 4.8.5. file: [37a10042] check-in: [8b6691f6] user: drh branch: trunk, size: 89899
2019-04-19
13:38
Streamline the processing of the AND operator. Slightly smaller and faster. file: [0e766729] check-in: [7713996a] user: drh branch: trunk, size: 89896
2019-04-05
20:56
Eliminate the tool/addopcodes.tcl script. The purpose of that script was to keep the number of parser codes below 256 in order to save parser table space. But we have long since blown through that ceiling so the addopcodes.tcl script was just needless complexity. There is no longer any reason to keep it around. file: [83be72e8] check-in: [d2728192] user: drh branch: trunk, size: 89888
2019-03-30
20:37
Fix issues with the previous check-in and add more VDBE branch coverage testing macros. file: [9572aab9] check-in: [b5f72f10] user: drh branch: oops, size: 89550
2019-03-18
10:30
Fix a typo in a comment. No changes to code. file: [6fa4056c] check-in: [c2f50aa4] user: drh branch: trunk, size: 89497
2019-03-01
18:07
In a query that uses a partial index, the expression that is the WHERE clause of the partial index must always be true. Use this fact to avoid evaluating identical terms in the WHERE clause of the query. file: [ce7b21e1] check-in: [9b287962] user: drh branch: trunk, size: 89497
2019-02-23
00:08
Remove a testcase() macro which is now unreachable due to the contraction of the use of IN_INDEX_ROWID. file: [06184864] check-in: [90c5a17c] user: drh branch: tkt-df46dfb631, size: 88388
2019-02-22
21:33
Check-in [fa792714ae62fa980] is not a valid fix for ticket [df46dfb631f75694], as the new test case in this check-in demonstrates. The fix here causes test cases for the [df46dfb631f75694] bug to fail again, so this check-in is on a branch. A new fix is needed for [df46dfb631f75694]. file: [cdeb7c70] check-in: [0d456456] user: drh branch: tkt-df46dfb631, size: 88463
2019-02-20
12:52
When an IN operator drives a query loop, mark it as "CODED" so that it will not be used afterwards for a (pointless) membership test. This is a better fix for ticket [df46dfb631f75694] than the previous fix that is now on a branch as it preserves the full optimization of check-in [e130319317e76119]. file: [5ee878f7] check-in: [fa792714] user: drh branch: trunk, size: 88403
2019-02-08
04:15
Do not do the optimization that attempts to pull expression values from an index on that expression when processing a multi-index OR (see check-in [a47efb7c8520a0111]) because the expression transformations that are applied become invalid when the processing moves off of the current index and on to the next index. Fix for ticket [4e8e4857d32d401f]. file: [a571d8d7] check-in: [440a7cda] user: drh branch: trunk, size: 88369
2018-12-31
18:30
Merge enhancements and bug fixes from trunk. file: [89d2ec66] check-in: [9fb646f2] user: drh branch: reuse-subqueries, size: 88081
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: [f9f790fc] check-in: [4a0929ac] user: drh branch: trunk, size: 88093
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: [daade831] check-in: [3c2ad0e9] user: drh branch: reuse-subqueries, size: 88063
2018-12-24
20:21
Improvements to EXPLAIN QUERY PLAN formatting. The MULTI-INDEX OR now shows a separate "INDEX" subtree for each index. SCALAR SUBQUERY entries provide a subquery number that is related back to the .selecttrace output. file: [3e948cba] check-in: [7153552b] user: drh branch: reuse-subqueries, size: 88209
14:30
Restore a line of code that was previously commented out for debugging. file: [538ca683] check-in: [e53781f5] user: drh branch: reuse-subqueries, size: 88074
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: [e819fc8e] check-in: [6c44838a] user: drh branch: reuse-subqueries, size: 88076
2018-12-23
21:27
Split the code generation for the RHS of IN operators and for SELECT and EXISTS expressions into two separate subroutines, because there is now little commonality between those to functions. This is intended to help make the code easier to read and maintain. file: [1945ccec] check-in: [2b6494b1] user: drh branch: trunk, size: 88075
2018-11-05
13:35
Fix a assert() in the query planner that can arise when doing row-value operations on a PRIMARY KEY that contains duplicate columns. Ticket [1a84668dcfdebaf12415d]. file: [cf6d3ac7] check-in: [1309c84a] user: drh branch: branch-3.25, size: 88030
2018-11-03
13:11
Fix a assert() in the query planner that can arise when doing row-value operations on a PRIMARY KEY that contains duplicate columns. Ticket [1a84668dcfdebaf12415d]. file: [c45f03ae] check-in: [dcb8c735] user: drh branch: trunk, size: 88032
2018-09-20
19:02
Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a new EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer. This reduces the size of the Expr object by 8 bytes, reduces the overall amount of code, and shaves over 1 million cycles off of the speed test. file: [3df0a541] check-in: [ad130bb8] user: drh branch: trunk, size: 88001
2018-09-19
20:14
Reduce the size of Expr to 64-bytes. This works somewhat, but there are test failures. More importantly, the size reduction from 80- to 64-bytes has not lowered the schema memory usage, but it has made the code a little bigger and a little slower. So the initial evidence is that this Expr refactoring experiment is not working... file: [ab599217] check-in: [24b0f66a] user: drh branch: expr-simplify, size: 88518
17:24
Fix an issue in virtual table handling associated with the new Expr.x.pRight field. file: [3b944b6d] check-in: [8487f84a] user: drh branch: expr-simplify, size: 88512
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: [4c3ec236] check-in: [147c61a6] user: drh branch: expr-simplify, size: 88506
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: [75a3b20d] check-in: [8849a463] user: drh branch: expr-simplify, size: 88049
2018-09-12
00:21
Fix a harmless compiler warning that arose from the ENABLE_CURSOR_HINTS fix of check-in [0af18674ca5b34e67e] file: [4f88f5b3] check-in: [f578e62a] user: drh branch: trunk, size: 87999
2018-09-11
13:38
Fix a problem causing ENABLE_CURSOR_HINTS builds to segfault. file: [e04303b8] check-in: [e7033104] user: dan branch: trunk, size: 88039
2018-09-10
19:27
Fix a minor problem causing an incorrect cursor-hint to be generated in some cases. file: [c1fa3f6f] check-in: [d879c47d] user: dan branch: trunk, size: 88096
2018-08-04
15:53
Further logic simplifications that flow out of the omission of the column cache. file: [2b6cd1b2] check-in: [7d9072b0] user: drh branch: omit-column-cache, size: 88136
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: [9085b9d4] check-in: [3f5f60cd] user: drh branch: omit-column-cache, size: 88135
15:58
Fix the OP_SeekRowid opcode so that it has no type-change side-effects on the key register in P3. This fixes an obcure problem that arises when doing equi-joins between a table with a TEXT column against another table with an INTEGER PRIMARY KEY. The original problem was discovered when OSSFuzz created such a query and hit an assert() in OP_VerifyTabCol that was specifically designed to catch these kinds of errors at run-time. Test cases for this fix are in TH3. file: [eb558ea9] check-in: [fa94b49e] user: drh branch: trunk, size: 88569
2018-07-27
16:57
Constant propagation is now restricted to just the WHERE clause. The mechanism is changed to take affinity and collation into account. This seems to give correct answers. But the search for constant propagation costs 4 million cycles in the speed test. file: [2c552dfe] check-in: [82c67efb] user: drh branch: propagate-const-opt, size: 88711
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: [fe23a552] check-in: [a7cdc5bc] user: drh branch: trunk, size: 88671
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: [3317f2b0] check-in: [439c8162] user: drh branch: multikey-opt-idea, size: 88670
16:07
Test cases. file: [06950dc0] check-in: [085e8637] user: drh branch: multikey-opt-idea, size: 88682
14:59
Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. file: [5f005bbd] check-in: [522f1eac] user: drh branch: multikey-opt-idea, size: 88673
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: [12d88d01] check-in: [6bf251af] user: drh branch: multikey-opt-idea, size: 88614
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: [f941a484] check-in: [87a9fc50] user: drh branch: multikey-opt-idea, size: 88410
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: [49256d67] check-in: [92f0fe15] user: drh branch: multikey-opt-idea, size: 88281
2018-05-09
13:46
Make the internal dynamic string interface available to extensions using the new sqlite3_str object and its associated methods. This is mostly just a renaming of internal objects and methods to use external names, through there are a few small wrapper functions. file: [728c7f70] check-in: [87f261f0] user: drh branch: trunk, size: 88216
2018-05-07
11:37
Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. file: [414ec420] check-in: [374d8e26] user: drh branch: trunk, size: 88200
2018-05-04
00:39
Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines associated with the OR-optimization. file: [300f945e] check-in: [75ac7b4e] user: drh branch: trunk, size: 88372
2018-05-02
14:24
Fix a dangling-else problem that was causing recursive CTEs to malfunction. Begin fixing test cases to work with the new EQP output. file: [3368f079] check-in: [82ca44b8] user: drh branch: rework-EQP, size: 88286
00:33
Begin reengineering the EXPLAIN QUERY PLAN function to provide more intuitive output. file: [13b831d2] check-in: [70b48a79] user: drh branch: rework-EQP, size: 88284
2018-04-24
18:53
Fix a problem with processing "LEFT JOIN tbl ON tbl.a = ? AND (tbl.b=? OR tbl.c=?)" in cases where there are indexes on both tbl(a, b) and tbl(a, c). file: [3cb591fe] check-in: [ce35e39c] user: dan branch: trunk, size: 88303
14:18
Add a hyperlink to the ticket on the code comment for the fix to ticket [7fa8049685b50b5aeb0c2]. file: [52225f6b] check-in: [45247c7f] user: drh branch: trunk, size: 88145
14:05
Do not attempt to read values from indexes-on-expressions if the index is on the RHS of a LEFT JOIN. This won't work if the index cursor points at a null-row. Fix for [7fa80496]. file: [4de72266] check-in: [b8ef967a] user: dan branch: trunk, size: 88095
2018-04-02
00:16
Better solution to the LIKE problem from the previous check-in that works even if the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option is used. file: [982b7450] check-in: [b850dd15] user: drh branch: trunk, size: 87730
2018-03-31
23:28
Fix a logic error discovered by OSSFuzz that can cause an assert() fault if a LIKE operator is used on an INTEGER PRIMARY KEY. file: [e75c351b] check-in: [fc06ddd4] user: drh branch: trunk, size: 87747
2018-03-19
16:59
Show symbolic SELECT names in EXPLAIN QUERY PLAN output when compiling with SQLITE_ENABLE_SELECTTRACE. file: [051ee5c0] check-in: [16c22ff8] user: drh branch: EQP-improvements, size: 87869
2018-02-13
18:48
Fix an incorrect table lookup used to find the appropriate search operator for a WHERE clause on a row-value inequality. The incorrect table lookup was causing an incorrect answer for the less-than operator. Fix for ticket [f484b65f3d6230593c34f11] file: [e1aaadd8] check-in: [f3112e67] user: drh branch: trunk, size: 87718
2018-01-23
16:38
Fix a bug causing spurious "sub-select returns N columns expected 1" errors in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause. Ticket [7310e2fb3d046a5f5]. file: [cb360c51] check-in: [14dfd96f] user: dan branch: trunk, size: 87369
2017-12-21
21:41
Fix SQLITE_DBCONFIG_TRIGGER_EQP so that it works even if SQLITE_DEBUG is not defined. file: [af1e7915] check-in: [afbbfff7] user: drh branch: trunk, size: 87211
2017-12-13
18:01
Correctly invalidate a column cache line when it is overwritten with NULL. Fix for ticket [123c9ba32130a6c9d432]. file: [ff2f0790] check-in: [65754dc3] user: drh branch: trunk, size: 87189
2017-11-17
21:01
Improved fix for ticket [da78413751863] that does not require disabling the query flattener as was done in [005d5b870625]. This also makes the code generator for vector IN operators a little easier to understand. file: [611fcabd] check-in: [723f1be3] user: drh branch: trunk, size: 87135
17:32
New assert() statements in the rowvalue IN expression processing. file: [8605c0ca] check-in: [00c32831] user: drh branch: trunk, size: 86273
2017-10-31
03:40
Remove unnecessary NEVER() and ALWAYS() conditionals. file: [4a117dd5] check-in: [1c80c75d] user: drh branch: trunk, size: 85231
2017-09-09
19:41
Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL constraints. file: [e8c2ece5] check-in: [34c8e952] user: dan branch: vtab-extra-ops, size: 85211
2017-08-25
19:51
Fix a few over-length source code lines. No functional changes. file: [d246d19f] check-in: [1783c54c] user: drh branch: trunk, size: 85206
2017-07-27
20:24
Enhance the like optimization so that it works with an ESCAPE clause. file: [e7be3b7f] check-in: [f5d330f4] user: drh branch: trunk, size: 85206
2017-07-10
16:38
Additional debugging Noop-comment in the constraint generator when wheretrace is enabled. file: [c0c4c315] check-in: [0ca7474f] user: drh branch: defer-where-subqueries, size: 85206
15:17
Fix another problem on this branch. file: [cd923f92] check-in: [a4fc9811] user: dan branch: defer-where-subqueries, size: 85004
14:39
Fix a problem causing non-covered WHERE terms to be evaluated before covered WHERE terms. file: [39bddb38] check-in: [7d3cb39f] user: dan branch: defer-where-subqueries, size: 84997
14:33
When testing non-indexed WHERE constraints, test those that involve correlated sub-queries last of all. This increases the chances of not having to run the sub-query at all. file: [3eb21308] check-in: [1f9c1f35] user: dan branch: defer-where-subqueries, size: 84997
2017-06-24
18:10
Consider the values bound to SQL variables when determining whether or not a partial index may be used. file: [f17f5d51] check-in: [7b59c353] user: dan branch: partial-index-variables, size: 84556
2017-06-02
15:44
Change the name of the OP_Seek opcode into OP_DeferredSeek for better clarity of function. No functional code changes. file: [339ee802] check-in: [ab33d299] user: drh branch: trunk, size: 84553
2017-04-29
14:56
Minor size and performance improvements to the push-down optimization. file: [8ad48867] check-in: [91dfb61a] user: drh branch: pushdown-optimization, size: 84533
2017-04-28
19:59
Within a loop that uses a non-covering index test, test non-indexed terms that can be tested without seeking the main table cursor before those that cannot. file: [878a8c75] check-in: [afe68f0a] user: dan branch: pushdown-optimization, size: 84421
2017-04-11
01:01
Improved comments. Fix a problem when an indexed expression is used in an ORDER BY clause. file: [943e32e9] check-in: [c59eaf2b] user: drh branch: covering-index-on-expr, size: 83931
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: [38d171e3] check-in: [a52ef2ad] user: drh branch: covering-index-on-expr, size: 83369
2017-02-18
20:05
Add an optimization to OP_Column to speed up sequential OP_Column instructions that read earlier fields from the same cursor. Attempt to reorder OP_Column opcodes so as to take advantage of this. file: [373faba5] check-in: [c1adf959] user: dan branch: sort-column-opcodes, size: 81474
2017-02-15
22:36
Query planner optimization to detect empty tables in a join early and bail out without doing excess work. file: [677e9541] check-in: [58797e9b] user: drh branch: trunk, size: 81444
2017-01-28
19:45
Avoid redundant table b-tree cursor seeks in UPDATE statements that use the two-pass strategy. file: [99a8ced1] check-in: [dc555b10] user: dan branch: trunk, size: 81144
2016-12-07
20:22
The use P4_DYNAMIC in place of the P4_MPRINTF operand type. file: [e04ac8f2] check-in: [3954f837] user: drh branch: trunk, size: 81034
2016-12-06
22:47
Performance improvement and size reduction in the Expr node allocator function sqlite3PExpr(). file: [9a3b1034] check-in: [2a81763e] user: drh branch: trunk, size: 81034
2016-11-23
21:01
Disable the query flattener optimization for SELECT statements that are on the RHS of vector IN operators. This is a hack that fixes the bug described in ticket [da7841375186386c]. A better solution that does not disable the query flattener is needed, but this will server for the time being. file: [e895f34f] check-in: [27438fb4] user: drh branch: branch-3.15, size: 80995
2016-11-17
13:13
Disable the query flattener optimization for SELECT statements that are on the RHS of vector IN operators. This is a hack that fixes the bug described in ticket [da7841375186386c]. A better solution that does not disable the query flattener is needed, but this will server for the time being. file: [4ea29899] check-in: [005d5b87] user: drh branch: trunk, size: 81040
2016-11-09
00:10
Enhance the OP_IdxInsert opcode to optionally accept unpacked key material. file: [507738d9] check-in: [89d958ab] user: drh branch: unpacked-IdxInsert, size: 80905
2016-10-10
13:29
Make sure indexes on expressions skip over initial NULL values in the index. Fix for ticket [4baa464912129477f3c9] file: [717a6529] check-in: [71797ba4] user: drh branch: trunk, size: 80860
2016-10-05
20:10
Fix harmless compiler warnings. file: [d07f784c] check-in: [2dde3375] user: drh branch: trunk, size: 80832
2016-10-03
01:21
Allocate Parse objects off of the stack where appropriate for a substantial performance increase and a size reduction. file: [81da7e9b] check-in: [ea8affa9] user: drh branch: trunk, size: 80902
2016-09-16
16:30
Fix a problem causing incorrect code to be generated for IN constraints like "a IN (1, 2, 3)" where column "a" is a rowid column with an extra UNIQUE index created on it. Ticket [0eab1ac759]. file: [e412e09a] check-in: [a92aee55] user: dan branch: trunk, size: 81022
15:42
Replace a faulty assert() with a testcase() to assure the condition is tested. Ticket [0eab1ac7591f]. file: [c23f9b26] check-in: [a49bc0a8] user: drh branch: trunk, size: 81045
2016-09-07
19:37
Fix a problem handling expressions like "(a, b) IN (SELECT ... ORDER BY 1, 2)" when there is an index on "a" but not "b". file: [d172dcf9] check-in: [7f2c5c9e] user: dan branch: rowvalue, size: 81010
13:30
Simplify the affinity handling logic in codeAllEqualityTerms(). Logically the same, just a little easier to read and understand. file: [43522ac8] check-in: [bbab9621] user: drh branch: rowvalue, size: 80301
12:20
Correct affinity computations for a SELECT on the RHS of an IN operator. Fix for ticket [199df4168c]. file: [019a050e] check-in: [2d1983ff] user: drh branch: branch-3.14, size: 74424
2016-09-06
17:13
Avoid unnecessary memory allocations for aiMap in codeEqualityTerm(). file: [b0d4febd] check-in: [70319c3d] user: drh branch: rowvalue, size: 80446
16:53
Avoid a NULL pointer deref in codeAllEqualityConstraints() following an OOM. file: [4bd3e4c3] check-in: [c6e528c1] user: drh branch: rowvalue, size: 80418
16:33
Simplify the fix in commit [7d9bd22c]. file: [ea92c232] check-in: [bd5a3420] user: dan branch: rowvalue, size: 80407
15:25
Fix the header comment on codeEqualityTerm(). file: [49125c4d] check-in: [b7e710e4] user: drh branch: rowvalue, size: 80219
14:58
Fix a problem handling (a, b) IN (SELECT ...) expressions when there is an index on just one of "a" or "b". file: [7279bb68] check-in: [231c72d9] user: dan branch: rowvalue, size: 79912
2016-09-03
15:31
Consider the affinity of "b" when using an "a IN (SELECT b ...)" expression with an index on "a". Fix for [199df416]. file: [8a9a53cb] check-in: [f5e49855] user: dan branch: rowvalue, size: 79556
2016-08-26
18:17
Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS() macros on unreachable branches. file: [ee7b5353] check-in: [87d40195] user: drh branch: rowvalue, size: 79278
17:54
Fix a problem with affinity changes and vector range comparisons. file: [71de4d2d] check-in: [b34413ac] user: dan branch: rowvalue, size: 79169
2016-08-24
12:22
Fix a buffer overrun in the code for handling IN(...) operators when the LHS of the operator contains indexed columns or expressions. file: [5a5528c3] check-in: [f41a0391] user: dan branch: rowvalue, size: 78538
00:51
The previous OOM fix was bad. Back it out and replace it with a better one. file: [0c99e2e9] check-in: [1e3bc369] user: drh branch: rowvalue, size: 78528
2016-08-20
00:07
Change the way TK_SELECT_COLUMN is handled so that the subquery is only generated once even if part of the vector comparison is used for indexing and the other part is now. This change also is a pathway to vector assignment in UPDATE statements. file: [0c790c42] check-in: [d8feea7d] user: drh branch: rowvalue, size: 78465
2016-08-19
18:28
Fix an obsolete comment on codeEqualityTerm(). No changes to code. file: [f3fd16b9] check-in: [d07be5af] user: drh branch: rowvalue, size: 79503
2016-08-18
19:04
Fix a SQL NULL handling bug in the vector IN operator code generation. file: [916b4510] check-in: [936146b1] user: drh branch: rowvalue, size: 79517
2016-08-08
20:15
Fix some cases involving row values and virtual tables. file: [92202261] check-in: [156a41f3] user: dan branch: rowvalue, size: 79494
18:42
Fix the EXPLAIN QUERY PLAN output for row value range constaints that use an index. file: [c2464557] check-in: [bb606511] user: dan branch: rowvalue, size: 79319
2016-08-02
17:45
Fix SQLITE_OMIT_SUBQUERY builds. file: [c2392fa3] check-in: [339f85f4] user: dan branch: rowvalue, size: 78798
2016-08-01
20:14
Fix a problem with vector range constraints involving the rowid column. And other issues. file: [c01c8af9] check-in: [3ef75d45] user: dan branch: rowvalue, size: 78717
2016-07-30
16:39
Remove the EP_Vector expression flag. file: [6131be0c] check-in: [e9d9c6d4] user: dan branch: rowvalue, size: 78306
2016-07-29
20:58
Fix some issues with vector range constraints and the column cache. Also vector range constraints and rowid columns. file: [e3159b1d] check-in: [42607366] user: dan branch: rowvalue, size: 78283
18:12
Change the way "(a, b) = (SELECT *)" expressions are handled in where.c if there is an index on one of the columns only. file: [e259a0b9] check-in: [4dfebff2] user: dan branch: rowvalue, size: 78024
2016-07-26
18:15
Merge latest trunk changes into this branch. file: [3aff7683] check-in: [d4f3d52c] user: dan branch: rowvalue, size: 77317
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: [03fbaa63] check-in: [061b8006] user: dan branch: rowvalue, size: 77292
04:23
Make sure affinity is applied correctly on lower-bound range constraints in the min() optimization. Fix for ticket [a0bac8b3c3d1bb]. file: [99707d11] check-in: [0e9f534f] user: drh branch: apple-osx, size: 74087
2016-07-23
20:24
Allow vector IN(SELECT ...) expressions to use an index if either all the indexed columns are declared NOT NULL or if there is no difference between the expression evaluating to 0 and NULL (as in a WHERE clause). file: [eb0f5e87] check-in: [e2fd6f49] user: dan branch: rowvalue, size: 75228
2016-07-10
19:35
Merge comment typo fixes from trunk. file: [877ceb19] check-in: [728c5aa4] user: mistachkin branch: rowvalue, size: 75225
19:35
Fix typos in comments. No changes to code. file: [11e38f5e] check-in: [77c692a6] user: mistachkin branch: trunk, size: 74062
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: [a66c589b] check-in: [b2204215] user: dan branch: rowvalue, size: 75224
2016-06-20
17:22
Allow LIKE operators that appear in a WHERE clause to be included in the cursor-hint for a cursor on the rhs of a LEFT JOIN. file: [e20cb381] check-in: [7455d932] user: dan branch: cursor-hints, size: 74061
2016-06-17
19:27
Include WHERE terms in the cursor-hint passed to a cursor opened for the rhs of a LEFT JOIN iff we can be sure that those terms will not evaluate to true if the LEFT JOIN generates a row of NULLs. file: [c1b11ad0] check-in: [998095ab] user: dan branch: cursor-hints, size: 73915
14:33
If a table is on the rhs of a LEFT JOIN, include only terms from the joins ON(...) clause in the cursor-hint passed via OP_CursorHint. file: [b9d5f7d8] check-in: [2a2346b0] user: dan branch: cursor-hints, size: 72686
2016-05-26
20:56
Add a new OP_SeekRowid opcode, that combines the functions of OP_MustBeInt and OP_NotExists. This makes the code slightly smaller and faster. file: [ba71a4e4] check-in: [ffe80a1b] user: drh branch: trunk, size: 71645
2016-05-19
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: [e3f18fcd] check-in: [d0130584] user: drh branch: trunk, size: 71722
2016-05-09
19:58
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. file: [d227fca7] check-in: [da94a6e0] user: drh branch: dev, size: 71852
2016-05-06
20:23
Simplification to the logic used to decide between OP_Seek and OP_NotExists. Use OP_NotExists for both DELETE and UPDATE. file: [23fc19ca] check-in: [3a695263] user: drh branch: trunk, size: 71896
16:06
In the WHERE generator, when building code for a DELETE operation, make sure that seeks to the main table are not deferred. This is a better fix for the [16c9801ceba49] bug than the previous. file: [6e2da244] check-in: [150dd09e] user: drh branch: ticket-16c9801ce, size: 71942
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: [28951741] check-in: [54c63b32] user: drh branch: trunk, size: 71825
2016-04-09
18:04
Fix a problem in the code generator for joins on virtual tables where the outer loop of the join uses the IN operator. file: [8fdad9fb] check-in: [6c56b3a0] user: drh branch: trunk, size: 71090
2016-03-08
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: [863aedf0] check-in: [721ae51e] user: drh branch: trunk, size: 70782
00:39
Changes so that some assert()s in the virtual table query planner are correct even following an OOM error. file: [36ea3526] check-in: [9805f6f8] user: drh branch: trunk, size: 70775
2016-03-07
19:08
Avoid a NULL pointer dereference following an OOM while generating code for IN operators on virtual tables. file: [870f3e92] check-in: [c9240086] user: drh branch: trunk, size: 70781
2016-03-02
03:28
Allow the left-hand side of IN operators on virtual tables to have the aConstraintUsage[].omit flag clear. file: [3ca82043] check-in: [1622623c] user: drh branch: vtab-IN-opt, size: 70754
2016-02-22
21:19
Clearer presentation of the logic. No functional changes. file: [39c1ef45] check-in: [a3dcf6db] user: drh branch: skip-scan-improvement, size: 69016
20:52
Avoid an unnecessary seek operation on some corner-case skip-scans. file: [19aa0189] check-in: [38e837e6] user: drh branch: skip-scan-improvement, size: 68817
2016-02-04
11:48
Remove unnecessary sets of db->mallocFailed. file: [791a784b] check-in: [b787165b] user: drh branch: trunk, size: 68732
02:34
Add and use the sqlite3VdbeZeroRegister() interface for coding the common operation of writing zero into a register. file: [f5229eb1] check-in: [1c8d3001] user: drh branch: zero-register, size: 68718
2016-02-01
13:58
Fix a problem causing the OR/covering-index optimization to be disabled if compile time parameter SQLITE_MAX_ATTACHED were set to greater than 30. file: [923f5d04] check-in: [a17712bf] user: dan branch: trunk, size: 68736
2016-01-30
16:59
Merge the implementation of OP_IdxRowid and OP_Seek so that OP_Seek no longer requires the rowid register and a separate OP_IdxRowid call. Shorter and faster prepared statements result. file: [7ea737b1] check-in: [9bec50a1] user: drh branch: trunk, size: 68725
12:50
Simplification and size reduction to the printf logic. Remove the bFlags parameter from sqlite3VXPrintf() and sqlite3XPrintf(). Use sqlite3XPrintf() instead of sqlite3_snprintf() for rendering P4 values in EXPLAIN output. file: [ef0d7019] check-in: [0bdb41c4] user: drh branch: trunk, size: 68812
00:45
Change the P4_INTARRAY so that always begins with a length integer. Print the content of the INTARRAY on EXPLAIN output. file: [3c4757ae] check-in: [6c520d57] user: drh branch: covering-or, size: 68836
2016-01-29
19:29
Experimental attempt to make better use of covering indexes within OR queries. file: [1b2a96c4] check-in: [a323ac3a] user: dan branch: covering-or, size: 68806
16:57
Avoid unnecessary WHERE clause term tests when coding a join where one of the tables contains a OR constraint. file: [22a7fee2] check-in: [ab946039] user: drh branch: OR-clause-improvement, size: 66909
2016-01-16
15:12
Use sqlite3VdbeAddOp4() rather than a separate sqlite3VdbeChangeP4() call, for a slightly smaller and faster binary. file: [8dee26eb] check-in: [a4258cd4] user: drh branch: trunk, size: 66782
2015-12-01
21:23
Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. file: [dfbfe198] check-in: [9e1d6d4c] user: drh branch: trunk, size: 66811
2015-11-05
20:25
The top of an index equality loop normally starts with OP_SeekGE and OP_IdxGT. This check-in adds a flag to OP_SeekGE such that it fails immediately if the key is not equal, then jumps over the OP_IdxGT, saving a call to the key comparison functions. Consider this check-in a proof-of-concept. It needs improvement before going on trunk. Some tests fail, but only because they new use fewer key comparisons than expected (which is a good thing!). file: [b45fe387] check-in: [32e31b9b] user: drh branch: seekeq-experiment, size: 66817
2015-10-28
20:01
Make the internal sqlite3PExpr() interface responsive to the TKFLG_DONTFOLD flag on the operator parameter. file: [4c96182e] check-in: [b10ab59f] user: drh branch: trunk, size: 66426
2015-10-16
20:53
Merge recent enhancements from trunk. Version now 3.9.1. file: [9aa20436] check-in: [26fa091d] user: drh branch: cursor-hints, size: 66411
2015-10-15
19:21
Enhance the use of the column cache for UPDATE statements, making them more efficient for the case where a column is modified to be an expression of other unmodified columns. file: [b924b78a] check-in: [871e091d] user: drh branch: trunk, size: 60797
2015-10-14
20:09
Merge in all the 3.9.0 updates from trunk. file: [4d60b2e8] check-in: [29444149] user: drh branch: cursor-hints, size: 66548
2015-10-10
14:41
Compiler warning fixes: Rename some local variables from "j1" to avoid a name collision with the j1() bessel function in the math library. Omit a dummy initializer that gcc 4.6.3 does not like. file: [cdfff200] check-in: [9ddef84d] user: drh branch: trunk, size: 60934
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: [a32bf1f3] check-in: [7d272aa6] user: drh branch: trunk, size: 60883
10:11
Add tests for fts3 and onepass update/delete operations. Also fix a problem with onepass updates that do not affect any rows. file: [a8723817] check-in: [820c8044] user: dan branch: vtab-onepass, size: 60873
2015-09-24
15:06
Merge trunk changes into the cursor-hints branch. file: [16f0d8b3] check-in: [fbe63762] user: drh branch: cursor-hints, size: 66458
2015-09-19
18:08
Fix compiler warnings. file: [7660e1ad] check-in: [5c31ee62] user: drh branch: trunk, size: 60844
2015-09-18
18:09
Fix a crash that can occur with a skip-scan on an index with expressions when SQLITE_ENABLE_EXPLAIN_COMMENTS is defined. file: [5b534714] check-in: [25f34cb9] user: drh branch: trunk, size: 60870
2015-09-15
17:31
Merge enhancements from trunk. file: [c80f4c78] check-in: [66fe0683] user: drh branch: cursor-hints, size: 66491
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: [186b4935] check-in: [16e56bda] user: drh branch: trunk, size: 60877
14:08
Fix a compiler warning and providing missing VdbeCoverage() calls. file: [91c50036] check-in: [2edd2e5e] user: drh branch: trunk, size: 60865
09:23
Avoid calling sqlite3VdbeCursorMoveto() from more than one point in vdbe.c. Doing so prevents it from being inlined as part of OP_Column. file: [780cccf1] check-in: [166d5af8] user: dan branch: onepass-delete, size: 60840
2015-09-03
14:39
Merge enhancements from trunk. file: [93fa794f] check-in: [25ee3000] user: drh branch: cursor-hints, size: 66180
14:18
Merge enhancements from trunk. file: [6ac85995] check-in: [1ab10cbf] user: drh branch: index-expr, size: 60722
13:46
Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). file: [c0d9b1c7] check-in: [847387ec] user: drh branch: trunk, size: 60566
2015-09-02
18:19
Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). file: [e215fc02] check-in: [be78f413] user: drh branch: trunk, size: 60569
16:51
Small simplification to the EXPLAIN QUERY PLAN logic. file: [713306be] check-in: [d1592d20] user: drh branch: trunk, size: 60580
15:37
Use sqlite3XPrintf() instead of sqlite3StrAccumAppend() in a few places for better performance and a smaller footprint. file: [f749795d] check-in: [82355e41] user: drh branch: trunk, size: 60643
2015-09-01
18:31
Merge enhancements from trunk. file: [a9b88cb2] check-in: [29570a60] user: drh branch: cursor-hints, size: 66313
2015-08-27
20:33
Fix EXPLAIN QUERY PLAN output for indexed-expressions. Fix another obscure fault in the WHERE term scanner. file: [b0bf45ca] check-in: [73d361ce] user: drh branch: index-expr, size: 60855
2015-08-25
19:20
Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the affinity of an index column. file: [3d9113cc] check-in: [1ee089a7] user: drh branch: trunk, size: 60699
2015-08-20
23:45
Merge recent enhancements from trunk, including table-valued expressions. file: [3be7fd91] check-in: [b9927c87] user: drh branch: cursor-hints, size: 66306
2015-08-19
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: [69f19535] check-in: [b9193761] user: drh branch: table-valued-functions, size: 60692
2015-08-18
15:58
Provide hints for all terms in a range constraint if there are any equality terms anywhere in the constraint. Range constraint terms are only omitted for a pure range constraint with no equality prefix. file: [ec90321e] check-in: [b5897bc0] user: drh branch: cursor-hints, size: 66297
2015-08-17
17:19
Avoid generating hints using constraints that are also used to initialize the cursor, since presumably the cursor already knows about those constraints. file: [148c5dc2] check-in: [142b048a] user: drh branch: cursor-hints, size: 66259
2015-08-14
18:50
Fix the cursor hint mechanism so that it does the right thing for indexed lookups. file: [16045545] check-in: [581e3d49] user: drh branch: cursor-hints, size: 65524
15:05
Refactor the sqlite3BtreeCursorHint() interface for improved maintainability. file: [3180ac64] check-in: [fc3fb5cd] user: drh branch: cursor-hints, size: 63583
01:03
Fix the CursorHint so that it includes the scan boundary constraints. On the expression text for the CursorHint opcode, show rowid correctly. file: [28d83834] check-in: [f0d428d1] user: drh branch: cursor-hints, size: 63634
2015-08-13
20:07
Merge in all the trunk changes from the previous year. This breaks the cursor-hint mechanism, but provides a baseline for trouble-shooting. file: [00a5d751] check-in: [82a7a61b] user: drh branch: cursor-hints, size: 63737
2015-07-23
16:39
The sqlite3ExprCodeGetColumn() is not guaranteed to put the result in the register requested. Fix the skip-scan code generator for WITHOUT ROWID tables so that it always checks the register and copies the result if it lands in the wrong register. Fix for ticket [8fd39115d8f46ece70e7d4b3]. file: [5da50492] check-in: [793e206f] user: drh branch: trunk, size: 60683
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: [3f3152ec] check-in: [cabf2187] user: drh branch: view-optimization, size: 60547
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: [0669481c] check-in: [faa0e420] user: drh branch: view-optimization, size: 60544 Added