SQLite

All files named ”src/wherecode.c”
Login

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

History for src/wherecode.c

2025-06-14
09:54
[45adf7743c] part of check-in [9872df2b85] Generates code to implement either an index search or a table scan, according to the results of the OP_IfUseIndex opcode. But does not always work. And the OP_IfUseIndex opcode is currently an unconditional "yes". (check-in: [9872df2b85] user: drh branch: flex-search, size: 117322)
2025-06-13
11:08
[047dfafac7] part of check-in [40a83da503] Further improvements to the EQP text for flex-search. (check-in: [40a83da503] user: drh branch: flex-search, size: 116094)
00:50
[3f7bcdf22c] part of check-in [680e278c3e] Change the flex-search EQP message to be "SEARCH ... OR SCAN" as this seems less disruptive and more readable. (check-in: [680e278c3e] user: drh branch: flex-search, size: 116083)
2025-06-12
19:02
[e1e64cd05b] part of check-in [521948c64f] Preliminary code generation for flex-search. Add a no-op IfUseIndex opcode as a placeholder. (check-in: [521948c64f] user: drh branch: flex-search, size: 116121)
2025-06-07
16:45
[b608a9e2e7] part of check-in [87fd199257] Query planner identifies loops where it might be advantageous to check the number of matching rows and fall back to a full table scan if the number of matching rows is large. (check-in: [87fd199257] user: drh branch: flex-search, size: 115722)
2025-06-06
23:10
[9710e62379] part of check-in [2eb4e9bf0f] Remove unnecessary whitespace and otherwise improve comments in the wherecode.c module. No coding changes. (check-in: [2eb4e9bf0f] user: drh branch: trunk, size: 115573)
2025-05-29
18:44
[65670d1ef8] part of check-in [29b1e1b976] Extend the fix for ticket [623eff57e76d45f6] so that it covers RIGHT JOIN in addition to LEFT JOIN. Problem reported by forum post 2025-05-29T15:10:14Z. (check-in: [29b1e1b976] user: drh branch: trunk, size: 115758)
2025-05-19
12:46
[8825756ea7] part of check-in [298ff5a1dc] Remove stray tab characters from source files. (check-in: [298ff5a1dc] user: drh branch: trunk, size: 115647)
2025-04-15
19:53
[d67fadf543] part of check-in [158e8c4fd7] Fix a minor typo in a code comment. (check-in: [158e8c4fd7] user: drh branch: trunk, size: 115648)
2025-04-10
10:18
[6a3749575b] part of check-in [20acd630b9] Remove unnecessary "www." prefixes on domain names in URLs. (check-in: [20acd630b9] user: drh branch: trunk, size: 115648)
2025-03-14
18:10
[0d3de258d7] part of check-in [6fd6b32d06] Make use of the flexible-array feature of C99, when available, to try to pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. (check-in: [6fd6b32d06] user: drh branch: flex-array, size: 115652)
2025-02-07
19:09
[5baa06f0da] part of check-in [c56092507c] Fix comments on the Parse.nMaxArgs field so that they are correct. Add assert()s to ensure they are correct. Other Parse changes to reduce the amount of memset() needed to initialize it. (check-in: [c56092507c] user: drh branch: trunk, size: 115639)
2024-11-20
15:02
[fa2b5bbb95] part of check-in [16d46e1160] If a subquery is copied and then changes are made to the copy, be sure to give the copy a unique Select.selId value so that the original will not be substituted in place of the modified copy. (check-in: [16d46e1160] user: drh branch: branch-3.47, size: 114195)
14:59
[0c3d3199a2] part of check-in [19d1bede56] Bug fix in the SubrtnSig logic from [c9a3498113074bbc], if a subquery is copied and then changes are made to the copy, be sure to give the copy a unique Select.selId value so that the original will not be substituted in place of the modified copy. Forum post 0b9ded2f8428ac00. (check-in: [19d1bede56] user: drh branch: trunk, size: 115430)
2024-10-25
16:20
[bb0a390fd8] part of check-in [e7f27bbdf4] Merge the latest trunk enhancements into the lateral-join branch. (check-in: [e7f27bbdf4] user: drh branch: lateral-join, size: 115946)
2024-10-23
11:06
[81b9af89f4] part of check-in [987b96aa63] Fix harmless compiler warnings in wherecode.c. One such warning was identified by forum post 721675f007 and the other was found by tool/warnings.sh. (check-in: [987b96aa63] user: drh branch: trunk, size: 115353)
2024-10-11
20:36
[8a260111af] part of check-in [3bb03a2891] Experimental change to explain query plan to identify covering indexes on expressions. (check-in: [3bb03a2891] user: dan branch: eqp-covering-index-on-expr, size: 115210)
2024-10-05
15:51
[e21675eafb] part of check-in [a92bb48a48] Merge latest trunk changes into this branch. (check-in: [a92bb48a48] user: dan branch: lateral-join, size: 114711)
2024-08-22
16:22
[5172d64779] part of check-in [6c00e88ebd] Add the SQLITE_INDEX_SCAN_HEX bit to the sqlite3_index_info.idxFlags bitmask. When set, this bit causes the EXPLAIN QUERY PLAN output to show the idxNum value in hex rather than in decimal. This is purely a debugging aid. (check-in: [6c00e88ebd] user: drh branch: trunk, size: 114118)
2024-08-19
22:48
[137797b0de] part of check-in [8ff5dda844] Refactor the SrcItem object so that information about subqueries is stored in a separately allocated Subquery object. This reduces the memory requirements for SrcItem and makes the code run faster. It also provides an expansion path for subquery processing that does not burden simple queries. The current checking mostly works, but there are still issues that need to be tracked down and fixed. (check-in: [8ff5dda844] user: drh branch: srcitem-opt, size: 114022)
2024-08-17
23:23
[3e130abafc] part of check-in [9f5aeef3cb] Give unique names to fields in the SrcItem object, to facilitate analysis of how those fields are used using "grep". (check-in: [9f5aeef3cb] user: drh branch: srcitem-opt, size: 113657)
2024-07-20
08:31
[84f3b1d4c9] part of check-in [84b80233e7] Optimizations and improved comments. (check-in: [84b80233e7] user: drh branch: lateral-join, size: 114203)
03:57
[e6518bac30] part of check-in [9e50d338eb] Do not do an early abort if a lateral subquery is an empty set. (check-in: [9e50d338eb] user: drh branch: lateral-join, size: 114171)
2024-06-05
20:41
[c9cac0b0b8] part of check-in [8080c6eafd] Small performance optimization in the codeEqualityTerm() routine of the code generator. (check-in: [8080c6eafd] user: drh branch: trunk, size: 113610)
2024-05-31
14:39
[5ad509221e] part of check-in [996c46e61d] Document the OP_Explain opcode. Add the WhereLoop.rRun value as P3 in OP_Explain opcodes associated with WhereLoops, for testing purposes. (check-in: [996c46e61d] user: drh branch: trunk, size: 112770)
2024-05-24
20:18
[d5184620bc] part of check-in [f890812df0] When omitting result columns for the vector-IN optimization, make sure that any result-set column references in both the ORDER BY clause and the GROUP BY clause are updated appropriately. (check-in: [f890812df0] user: drh branch: group-by-consistency, size: 112731)
2024-05-17
22:51
[f5255f49d1] part of check-in [c2188da860] Improvements to a VDBE comment. No changes to anything that affects queries. (check-in: [c2188da860] user: drh branch: trunk, size: 111728)
2024-05-02
19:22
[b9908c0a1a] part of check-in [26b2d9390f] Fix a problem with queries that use "IN(...) ORDER BY ... NULLS LAST" or similar introduced by [d7648e21605a0b38]. (check-in: [26b2d9390f] user: dan branch: trunk, size: 111731)
2024-05-01
19:48
[b73b5bcd08] part of check-in [560f64157d] Avoid an OP_Next in cases where an IN(...) query against a UNIQUE index may return at most 1 row. (check-in: [560f64157d] user: dan branch: unique-in-opt, size: 111714)
2024-04-22
13:31
[1f6940349e] part of check-in [672c2869ef] Extra robustness in the code that causes cursors to return NULL when they are participating in an OUTER JOIN. (check-in: [672c2869ef] user: drh branch: trunk, size: 111103)
00:42
[b0224e0ec3] part of check-in [e1040e51eb] Continuation of the fix at [8c0f69e0e4ae0a44]: If a viaCoroutine FROM clause term is participating in a RIGHT or FULL JOIN, we have to create an always-NULL pseudo-cursor for that term when processing the RIGHT join. dbsqlfuzz 6fd1ff3a64bef4a6c092e8d757548e95698b0df5. (check-in: [e1040e51eb] user: drh branch: trunk, size: 111189)
2024-04-18
16:11
[4b5909be0c] part of check-in [8c0f69e0e4] Correct handling of OUTER JOIN when on or the other operand is a subquery implemented using the VALUES-as-coroutine optimization. dbsqlfuzz bde3bf80aedf25afa56e2997a0545a314765d3f8. (check-in: [8c0f69e0e4] user: drh branch: trunk, size: 111124)
2024-04-06
23:09
[e033875570] part of check-in [681dfe2dd6] Add comments to note the name abiguity between the MySQL push-down optimization and the WHERE-clause push-down optimization. (check-in: [681dfe2dd6] user: drh branch: wrong-branch, size: 110781)
2023-06-30
18:23
[5d77db30a2] part of check-in [4e8718dc35] Improve support for sqlite3_stmt_scanstatus_v2() profiling of sub-queries implemented as co-routines. (check-in: [4e8718dc35] user: dan branch: scanstatus-exp, size: 110402)
2023-06-07
08:40
[bff0bc56cb] part of check-in [26c1bb4bd9] Add a C-source spell-checking facility. make misspell (on Nix) (check-in: [26c1bb4bd9] user: larrybr branch: spell-check, size: 110075)
2023-05-17
16:13
[e63b522e78] part of check-in [4fbe02651e] Simplification, performance improvement, and size reduction in the codeAllEqualityTerms() function of the code generator. (check-in: [4fbe02651e] user: drh branch: trunk, size: 110145)
2023-05-04
11:29
[b300db0bcd] part of check-in [d3370d59cf] Fix a bug in cursor hints that can cause references to tables that have not been opened. Cursor hints are intended for use by COMDB2 only and should not appear in production builds, so this should not be a factor for the vast majority of users. (check-in: [d3370d59cf] user: drh branch: trunk, size: 110222)
2023-04-11
02:10
[85790d7e53] part of check-in [68fcfb58df] Better handling of OOM errors in the cursor-hint logic. dbsqlfuzz 60cd5fff91974af91c2c3692beb4a2d7fdafef46 (check-in: [68fcfb58df] user: drh branch: trunk, size: 110101)
2023-04-10
18:44
[277c38607d] part of check-in [4c5a3c5fb3] New assert() statements to validate the parameters to sqlite3BtreeCursorHint(). Fix a problem with the construction of those parameters discovered by forum post 0b53708c95. (check-in: [4c5a3c5fb3] user: drh branch: trunk, size: 110079)
2023-03-30
16:08
[41c17b0890] part of check-in [960a488a2d] Omit a branch that is no longer needed following [c9c4f287652933eb]. (check-in: [960a488a2d] user: drh branch: trunk, size: 110342)
11:28
[cfb770843e] part of check-in [5583ea82c6] Cherrypick three fixes from trunk. (check-in: [5583ea82c6] user: drh branch: branch-3.41, size: 110271)
2023-03-29
21:58
[7699667601] part of check-in [c9c4f28765] Avoid having OP_SeekScan jump over an OP_IdxGT or OP_IdxGE that follows the OP_SeekGE opcode. Fix for [b50528af4468237c]. (check-in: [c9c4f28765] user: dan branch: trunk, size: 110362)
2023-02-28
19:39
[9919e5a22f] part of check-in [0f5579bef2] Add an sqlite3_db_config() option - SQLITE_DBCONFIG_STMT_SCANSTATS - for enabling and disabling the collection of sqlite3_stmt_scanstats() statistics in SQLITE_ENABLE_STMT_SCANSTATUS builds. Collection of statistics is disabled by default. (check-in: [0f5579bef2] user: dan branch: trunk, size: 110821)
2023-02-13
16:10
[b82d0d3331] part of check-in [1815b15ddb] Allow vector-IN expressions like "(a, b) IN ( (?,?), (?,?) )" to use an index. (check-in: [1815b15ddb] user: dan branch: vector-in-fix, size: 110730)
2022-12-21
20:17
[fe70baaee7] part of check-in [397fb07bb4] Merge the latest trunk enhancements into the begin-concurrent-report branch. (check-in: [397fb07bb4] user: drh branch: begin-concurrent-report, size: 110544)
2022-12-06
18:48
[76bca33792] part of check-in [9499b2f51e] Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop. (check-in: [9499b2f51e] user: dan branch: trunk, size: 110475)
2022-12-03
21:24
[d3146e215f] part of check-in [622d8eb372] Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables. (check-in: [622d8eb372] user: dan branch: scanstatus_v2, size: 110205)
2022-12-02
20:32
[f7121f4c29] part of check-in [5580083364] Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports. (check-in: [5580083364] user: dan branch: scanstatus_v2, size: 110089)
2022-11-30
19:11
[ee52c2781c] part of check-in [8ec361695a] Attempt to rationalize the bits associated with ".wheretrace". Provide a decoder key in sqliteInt.h for what each bit is intended to do. (check-in: [8ec361695a] user: drh branch: trunk, size: 110019)
2022-11-04
18:47
[b5827f38fc] part of check-in [d8568a848a] Merge the latest trunk enhancements into the begin-concurrent-report branch. (check-in: [d8568a848a] user: drh branch: begin-concurrent-report, size: 110010)
2022-10-24
13:50
[cf67460973] part of check-in [3d1992de47] Improve the ability of the query planner to recognize covering indexes even on tables with more than 63 columns and where the index is over columns beyond the 63rd column. (check-in: [3d1992de47] user: drh branch: branch-3.28, size: 90614)
2022-10-22
14:16
[133a94f828] part of check-in [cadf5f6bb1] This branch attempts to improve the detection of covering indexes. This first check-in merely improves a parameter name to sqlite3WhereBegin() to be more descriptive of what it contains, and ensures that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly faster. (check-in: [cadf5f6bb1] user: drh branch: covering-index-enh, size: 109941)
2022-10-20
13:36
[13b6373af6] part of check-in [56442c9bdd] The generalized indexed expression optimization of [2435112867fbd7b6] makes the prior [a47efb7c8520a011] enhancement from 2017 obsolete. This check-in removes the older optimization. (check-in: [56442c9bdd] user: drh branch: trunk, size: 109938)
2022-10-17
09:56
[8ec5a413f1] part of check-in [2ab3cf4d71] Remove a use of alloca() that does more harm than good. (check-in: [2ab3cf4d71] user: drh branch: trunk, size: 116139)
2022-10-07
19:11
[3851a23caf] part of check-in [b6be4ce6db] Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520. (check-in: [b6be4ce6db] user: drh branch: branch-3.39, size: 116102)
18:57
[bb88be457d] part of check-in [63d9efe277] Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520. (check-in: [63d9efe277] user: dan branch: trunk, size: 116140)
18:06
[4f05c8af3f] part of check-in [dc01d9d8d8] Fix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by forum post f61a8b7053. (check-in: [dc01d9d8d8] user: drh branch: branch-3.39, size: 115923)
2022-10-06
14:10
[7ec238362d] part of check-in [8e14c351b2] Fix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by forum post f61a8b7053. (check-in: [8e14c351b2] user: dan branch: trunk, size: 115961)
2022-08-22
15:48
[9c6bd7fc32] part of check-in [2ec6e9e134] Merge all recent trunk enhancements into the begin-concurrent-report branch. (check-in: [2ec6e9e134] user: drh branch: begin-concurrent-report, size: 115837)
02:00
[6bb1cf9d0a] part of check-in [e5eaa80e81] Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the db and ptr parameters are guaranteed to be non-NULL. Use this where appropriate to save more than 2 million CPU cycles on the standard performance test. (check-in: [e5eaa80e81] user: drh branch: trunk, size: 115768)
2022-08-03
17:27
[f8acceb057] part of check-in [0d0c31117a] Improvement on the previous check-in. (check-in: [0d0c31117a] user: drh branch: branch-3.39, size: 115730)
17:26
[719a5bb010] part of check-in [c1ab0ea295] Improvement on the previous check-in. (check-in: [c1ab0ea295] user: drh branch: trunk, size: 115730)
16:04
[3bda24668f] part of check-in [003e4eee6b] For an IN operator used with a RIGHT JOIN, use the number of terms in the vector, not the number of equality terms, to size the column map. dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657. (check-in: [003e4eee6b] user: drh branch: branch-3.39, size: 115731)
15:58
[6fc48e5b25] part of check-in [b184c8d922] For an IN operator used with a RIGHT JOIN, use the number of terms in the vector, not the number of equality terms, to size the column map. dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657, CVE-2022-3195. This problem was injected by [a193749730d6cfba] which was part of the RIGHT JOIN enhancement for version 3.39.0. (check-in: [b184c8d922] user: drh branch: trunk, size: 115731)
2022-07-25
19:05
[210240c9ce] part of check-in [92ac01d41d] Small performance increase and size reduction by splitting out the sqlite3VdbeGetLastOp() from sqlite3VdbeGetOp(). (check-in: [92ac01d41d] user: drh branch: trunk, size: 115673)
2022-06-16
13:44
[ac444e3c1d] part of check-in [8b446d0b85] Merge the latest trunk enhancements into the begin-concurrent-report branch. (check-in: [8b446d0b85] user: drh branch: begin-concurrent-report, size: 115742)
2022-06-01
13:32
[0b09abfcb8] part of check-in [fdd782a7bb] Candidate fix for the problem with row-value WHERE clause constraints on a RIGHT JOIN. (check-in: [fdd782a7bb] user: drh branch: row-value-right-join, size: 115673)
2022-05-31
11:13
[1d5bed686d] part of check-in [aba52a90ee] Add back in a test case for ON-clauses that was removed yesterday by [3869fd9a2b9483cbf] but which turned out to be necessary after all. (check-in: [aba52a90ee] user: drh branch: right-join-bug-20220531, size: 115594)
2022-05-30
17:33
[056c96e617] part of check-in [3869fd9a2b] For an outer join, then ON-clause constraints need to be evaluated at just the right moment - not too early and not too late. Fix for the problem reported by forum post 3902c7b833. (check-in: [3869fd9a2b] user: drh branch: trunk, size: 115384)
2022-05-28
14:32
[226b38cb9c] part of check-in [034d2c511a] Merge the latest trunk enhancements into the begin-concurrent-report branch. (check-in: [034d2c511a] user: drh branch: begin-concurrent-report, size: 115529)
2022-05-14
15:59
[2a8a73bcf1] part of check-in [9d17233c7d] Improvements to the decision of when to check ON constraints for an inner join that is an operand to a RIGHT JOIN. Fix for issue identify by forum post c06b10ad7e. (check-in: [9d17233c7d] user: drh branch: trunk, size: 115460)
2022-05-13
20:11
[c45ba0294d] part of check-in [0f96810b84] Transitive equality constriants do not work on a RIGHT JOIN, since the right-hand side might be a non-matched row. (check-in: [0f96810b84] user: drh branch: trunk, size: 115293)
19:50
[76e9d8e8ce] part of check-in [12ee29d632] Walk back the optimization from check-in [cc458317bd77046c] that tries to reuse the same ephemeral cursor of a list subquery when that subquery is reused, as it does not work in cases where the list subquery is used both for lookups and for scans. (check-in: [12ee29d632] user: drh branch: trunk, size: 115284)
17:45
[4ffa652982] part of check-in [238d9c247c] Defer generating WHERE clause constraints for a RIGHT JOIN until after the ON-clause processing for the RIGHT JOIN has done its own row elimination. This fixes and incorrect output from some RIGHT JOINs that was identified by forum post 41cc3851d864c5e6. (check-in: [238d9c247c] user: drh branch: trunk, size: 115366)
14:52
[51aba5a096] part of check-in [1ffea07ff9] Improved names for flags on the Expr object: EP_FromJoin becames EP_OuterON and EP_InnerJoin becomes EP_InnerON. (check-in: [1ffea07ff9] user: drh branch: trunk, size: 114809)
2022-05-12
11:56
[c1f7210872] part of check-in [c7e3a13a32] Ensure that ON clauses are applied to the correct outer join. (check-in: [c7e3a13a32] user: drh branch: trunk, size: 114820)
2022-05-10
12:24
[e714c7ca73] part of check-in [e6b5224d71] Merge the latest trunk enhancements into the begin-concurrent-report branch. Had to restore the sqlite3VdbeSerialPut() routine that was removed in check-in [6f4d6f212a3558c2] when it was inlined because that routine is used again in a different place by this branch. (check-in: [e6b5224d71] user: drh branch: begin-concurrent-report, size: 114840)
2022-05-04
17:30
[72f8eeed55] part of check-in [b57033d2af] Code EP_InnerJoin constraints at the same time that EP_FromJoin constraints are coded. (check-in: [b57033d2af] user: drh branch: joinD, size: 114771)
2022-05-03
14:25
[eae0a5778f] part of check-in [3dc9fc2f2d] Fix the Bloom filter pull-down optimization so that it jumps to the correct place if it encounters a NULL key. Fix for the bug described by forum thread 2482b32700384a0f. (check-in: [3dc9fc2f2d] user: drh branch: branch-3.38, size: 108285)
14:01
[cd9da760d3] part of check-in [6eda9b1a77] Fix the Bloom filter pull-down optimization so that it jumps to the correct place if it encounters a NULL key. Fix for the bug described by forum thread 2482b32700384a0f. (check-in: [6eda9b1a77] user: drh branch: trunk, size: 114758)
2022-05-02
15:47
[dfc3fbb6b7] part of check-in [053cf45eca] Remove a testcase() macro taht was made obsolete by [a8da85c57e07721d]. (check-in: [053cf45eca] user: drh branch: trunk, size: 114668)
14:32
[9c2af25525] part of check-in [cc458317bd] Improvement on check-in [a193749730d6cfba] so that the subroutine call to the IN operator right-hand side generator from the RIGHT JOIN no-match logic does not generate unreachable byte code. (check-in: [cc458317bd] user: drh branch: trunk, size: 114717)
2022-04-30
18:40
[d629ba77a3] part of check-in [a193749730] Simplified fix to the problem with subroutine reuse in the RIGHT JOIN no-match logic for a subquery on the right-hand side of an IN operator. The code still needs simplification. (check-in: [a193749730] user: drh branch: trunk, size: 114871)
17:22
[96b3424451] part of check-in [ad32da8045] Fix another problem with subroutine reuse in the RIGHT JOIN no-match code for the subquery on the right-hand side of an IN operator. The current code works for all known cases, but seems unnecessarily complex and in need of simplification. Later: The fuzzer finds memory leaks with this version. (check-in: [ad32da8045] user: drh branch: not-working, size: 114841)
12:55
[7bf94299fe] part of check-in [ef72f9e289] Preserve the COLLATE operator on an index on an expression when resolving the use of that expression into a reference to the index. See forum thread 7efabf4b03328e57 for details. (check-in: [ef72f9e289] user: drh branch: branch-3.38, size: 108195)
12:35
[3c6f6ff594] part of check-in [a8da85c57e] Preserve the COLLATE operator on an index on an expression when resolving the use of that expression into a reference to the index. See forum thread 7efabf4b03328e57 for details. (check-in: [a8da85c57e] user: drh branch: trunk, size: 114682)
00:06
[c7e35e28f1] part of check-in [bb2798be3f] Further improvements to codeEqualityTerm() for cases when an IN operator with a right-hand side subquery is used as a constraint that needs to be processed by the RIGHT JOIN non-matched logic. (check-in: [bb2798be3f] user: drh branch: trunk, size: 114639)
2022-04-29
19:00
[c55aba3ea3] part of check-in [56dd306546] Enhance the codeEqualityTerm() routine inside the code generator so that it is able to reuse an IN operator that has an invariant subquery on its right-hand side while coding the non-matched loop of a RIGHT JOIN. dbsqlfuzz 19f1102a70cf966ab249de56d944fc20dbebcfcf (check-in: [56dd306546] user: drh branch: trunk, size: 114347)
2022-04-23
18:04
[55a33d9db1] part of check-in [2c5bb2bff2] For debug builds, if the RIGHT JOIN body subroutine contains a jump that escapes the subroutine, then abort the prepared statement with a descriptive error and SQLITE_INTERNAL. This extra sanity check causes many tests to fail. (check-in: [2c5bb2bff2] user: drh branch: right-join-subrtn-check, size: 114317)
2022-04-21
14:48
[1bff158d86] part of check-in [fd328e52ae] Make sure the code generator knows to invoke row-value subroutines which running the right-join post-processing loop. (check-in: [fd328e52ae] user: drh branch: right-join, size: 114196)
2022-04-18
16:20
[dcf622a965] part of check-in [aab7665ce6] Ensure that left-hand side WITHOUT ROWID tables are set to OP_NullRow prior to running the right-join loop. This fixes a problem introduced by the previous check-in. (check-in: [aab7665ce6] user: drh branch: right-join, size: 114060)
16:10
[1770ab730f] part of check-in [95b242d4c2] Fix problems with WHERE clauses that follow multiple FULL JOINs. This introduces some new faults in the tests, probably due to something unrelated. (check-in: [95b242d4c2] user: drh branch: right-join, size: 114078)
10:26
[4e03f17f8e] part of check-in [1549dcd235] Do not allow an empty table bypass to jump outside of a right-join body subroutine. (check-in: [1549dcd235] user: drh branch: right-join, size: 113817)
2022-04-14
16:34
[cb747d628e] part of check-in [9b9038bcd0] Rerun the subroutines that compute row-values if necessary from within the RIGHT JOIN body subroutine. (check-in: [9b9038bcd0] user: drh branch: right-join, size: 113769)
2022-04-13
16:46
[34e4c44537] part of check-in [7ed2a271e6] Move the explain comment for the RIGHT-JOIN post-processing loop to the verify beginning of the loop - to make the start of the loop clearer to human bytecode readers. (check-in: [7ed2a271e6] user: drh branch: right-join, size: 113695)
01:52
[e0f7b26a9c] part of check-in [218c7167e5] Add missing VdbeCoverage() macros on new branch byte-code opcodes. (check-in: [218c7167e5] user: drh branch: right-join, size: 113695)
2022-04-12
18:04
[3b0cfb2f79] part of check-in [beeecf1604] Factor out the RIGHT JOIN non-matched row loop from sqlite3WhereEnd(). This reduces the register pressure on that routine and helps it to run faster in the common case where there is no RIGHT JOIN. (check-in: [beeecf1604] user: drh branch: right-join, size: 113653)
2022-04-11
14:26
[bdf7de22c7] part of check-in [d91faeffea] Show LEFT and RIGHT JOIN processing in the EXPLAIN QUERY PLAN output. (check-in: [d91faeffea] user: drh branch: right-join, size: 111220)
11:48
[808e94b66f] part of check-in [29927926eb] Merge the Expr.w.iJoin name change from trunk into the right-join branch. (check-in: [29927926eb] user: drh branch: right-join, size: 111032)
11:25
[b48476855e] part of check-in [e8c00442d2] Rename the Expr.w.iRightJoinTable to just Expr.w.iJoin, so that the words "RightJoin" in the former name do not lead readers to believe that this has something to do with RIGHT JOINs in particular. (check-in: [e8c00442d2] user: drh branch: trunk, size: 109079)
2022-04-09
12:27
[39532c183e] part of check-in [549f5a7ee6] The interior of the RIGHT JOIN loop is now a subroutine. (check-in: [549f5a7ee6] user: drh branch: right-join, size: 111042)
03:16
[f25a1d1ad2] part of check-in [55b4543122] A few bits and bobs of code generation toward getting RIGHT JOIN to work. Much more remains to do. (check-in: [55b4543122] user: drh branch: right-join, size: 110242)
03:12
[79813939e0] part of check-in [b1b3845aa3] Merge the sqlite3WhereMalloc() routine from trunk into the right-join branch. (check-in: [b1b3845aa3] user: drh branch: right-join, size: 109126)
03:06
[b7bc24b150] part of check-in [f237e1d8cc] The sqlite3WhereMalloc() routine allocates memory that is automatically deleted when the corresponding WhereInfo object is destroyed. (check-in: [f237e1d8cc] user: drh branch: trunk, size: 109089)
2022-04-08
19:20
[7025f2a5b8] part of check-in [415abd6731] Preliminary code to support RIGHT JOIN. Everything seems to work, except that the code to compute the unmatched rows for the RIGHT JOIN has not yet been added, so the result of a RIGHT JOIN is currently the same as an INNER JOIN. (check-in: [415abd6731] user: drh branch: right-join, size: 109097)
2022-04-07
19:06
[6292d7bf2d] part of check-in [c2965fea9d] Enhance the EXPLAIN output formatting in the CLI so that the subroutine that implements the loop body for the multi-index OR optimization is indented. (check-in: [c2965fea9d] user: drh branch: trunk, size: 109060)
2022-03-12
14:54
[0c29a9f468] part of check-in [c4a61135d5] Merge trunk enhancements, including 3.38.1 patches, into the begin-concurrent-report branch. (check-in: [c4a61135d5] user: drh branch: begin-concurrent-report-3.28, size: 108696)
2022-03-07
14:59
[84be340684] part of check-in [4a2040d5c7] Fix the code generated for vector IN operator constraints on virtual tables so that they work even if the "omit" field in the sqlite3_index_info object is off. This has apparently never worked correctly before. Presumably, nobody has ever before written a virtual table that can use vector IN operator constraints and that relies on bytecode to double-check the constraints. Test cases in TH3. Problem discovered by dbsqlfuzz cab8e26194a40147627094f3c6849c0a7b1e0310. (check-in: [4a2040d5c7] user: drh branch: branch-3.38, size: 108152)
14:51
[555f598a9d] part of check-in [21b656572d] Fix the code generated for vector IN operator constraints on virtual tables so that they work even if the "omit" field in the sqlite3_index_info object is off. This has apparently never worked correctly before. Presumably, nobody has ever before written a virtual table that can use vector IN operator constraints and that relies on bytecode to double-check the constraints. Test cases in TH3. Problem discovered by dbsqlfuzz cab8e26194a40147627094f3c6849c0a7b1e0310. (check-in: [21b656572d] user: drh branch: trunk, size: 108627)
2022-03-05
19:39
[dd0cdd1b2a] part of check-in [45a5d5acf7] Cherry-pick all bug fix changes since the 3.38.0 release. (check-in: [45a5d5acf7] user: drh branch: branch-3.38, size: 108240)
2022-03-03
19:40
[e0f6be39a0] part of check-in [d71fb6fdc3] Restore the ability to push-down OR subterms of the WHERE clause when processing a multi-index OR. (check-in: [d71fb6fdc3] user: drh branch: trunk, size: 108715)
15:59
[5559cf12b4] part of check-in [61a1c6dbd0] Fix for the problem identified in forum post 0cd8e058bf: When evaluating an multi-index OR, do not push down auxiliary WHERE clause terms that involve subqueries into the OR-subqueries. Otherwise, the covering-index optimizer might convert table-references into index-references for the particular OR index that is active for the branch in which the subquery subroutine is coded, and those index-references will not work if the subquery subroutine is invoked from a different OR branch that uses a different index. (check-in: [61a1c6dbd0] user: drh branch: trunk, size: 108718)
2022-03-02
21:04
[273893ebc8] part of check-in [ad3ffa1a75] Bloom filter pull-down optimization is incompatible with Skip-Scan. Make sure the query planner does not try to to both. Forum post 50a1bbe08ce4c29c. (check-in: [ad3ffa1a75] user: drh branch: trunk, size: 108187)
2022-02-25
13:29
[d34d3980f3] part of check-in [54f49f65ac] Improved comment on the codeDeferredSeek() routine. No code changes. (check-in: [54f49f65ac] user: drh branch: trunk, size: 108110)
2022-02-15
20:24
[498216d0a2] part of check-in [213df7a063] Merge recent trunk enhancements into the begin-concurrent-report branch. (check-in: [213df7a063] user: drh branch: begin-concurrent-report, size: 107704)
2022-02-05
21:49
[6150f51c03] part of check-in [32a3a53b62] Record the position of many identifiers in the parse using the new Expr.w.iOfst field. This is done with the idea of providing offset results for sqlite3_error_offset() for a more kinds of errors, though that part is not yet implemented. (check-in: [32a3a53b62] user: drh branch: trunk, size: 107635)
2022-02-04
17:51
[d575990630] part of check-in [1c88bcfff5] Merge all recent trunk enhancements into the begin-concurrent-report branch. (check-in: [1c88bcfff5] user: drh branch: begin-concurrent-report, size: 107702)
13:05
[4a0dd0403e] part of check-in [9f67ad00cd] For the MULTI-INDEX-OR optimization, when pushing down WHERE clause terms from the main query into the various OR-term subqueries, do not push down slices of a vector comparison, since the right-hand operand of the comparison might have only been initialized in a different OR branch that was not taken. dbsqlfuzz 80a9fade844b4fb43564efc972bcb2c68270f5d1. (check-in: [9f67ad00cd] user: drh branch: trunk, size: 107633)
2022-02-01
14:58
[5879604677] part of check-in [eb84b80e1f] Add new interfaces to enable virtual table to process IN operator constraints all at once, rather than one element at a time. (check-in: [eb84b80e1f] user: drh branch: batch-in-operator, size: 107173)
2022-01-27
21:18
[c313ccf5ed] part of check-in [38c5151eb8] Query planner always honors the aConstraintUsage[].omit flag for the SQLITE_INDEX_CONSTRAINT_OFFSET constraint. (check-in: [38c5151eb8] user: drh branch: vtab-limit-offset, size: 106716)
16:14
[37878a0a6f] part of check-in [74fa5757ee] Give the virtual table xBestIndex method access to (some) OFFSET and LIMIT clauses. (check-in: [74fa5757ee] user: drh branch: vtab-limit-offset, size: 106343)
2022-01-25
15:48
[eea33d7529] part of check-in [42e6d842ab] Merge the latest trunk enhancements into the begin-concurrent-report branch. (check-in: [42e6d842ab] user: drh branch: begin-concurrent-report, size: 106409)
2022-01-24
16:47
[8da0f87327] part of check-in [1f7fa46126] Remove many redundant checks for sqlite3.mallocFailed now that any OOM should cause Parse.nErr to be non-zero. (check-in: [1f7fa46126] user: drh branch: trunk, size: 106340)
2022-01-21
16:47
[1d0a747c45] part of check-in [3bc8d16207] When computing a vector to be used as a key for an index lookup, do not check for NULL values and abort until after all key values have been computed, in case one of the later key values involves some initialization that is needed by a LEFT JOIN. Fix for the problem identified by Forum post ab95010d410a0a55. (check-in: [3bc8d16207] user: drh branch: branch-3.37, size: 100942)
16:41
[a0a5138b28] part of check-in [4db5217a28] When computing a vector to be used as a key for an index lookup, do not check for NULL values and abort until after all key values have been computed, in case one of the later key values involves some initialization that is needed by a LEFT JOIN. Fix for the problem identified by Forum post ab95010d410a0a55. (check-in: [4db5217a28] user: drh branch: trunk, size: 106344)
2022-01-17
19:24
[662ce5ebdf] part of check-in [ef6fc89507] Bring the begin-concurrent-report branch up to date with all the latest trunk enhancements. (check-in: [ef6fc89507] user: drh branch: begin-concurrent-report, size: 106351)
2021-12-11
17:10
[6a594ed25b] part of check-in [799db7cb2e] Do not allow early evaluation of Bloom filters that use the IN operator as the machinery to deal with the IN operator is not available. dbsqlfuzz 5b51c247518278f79a45cea978702e86e86cd4f9. (check-in: [799db7cb2e] user: drh branch: trunk, size: 106282)
2021-12-10
17:36
[47311c0a64] part of check-in [403e7312dd] Rename the internal routine constructBloomFilter() to sqlite3ConstructBloomFilter(). OSSFuzz is reporting a crash with a garbled stack that we cannot reproduce. Perhaps the original "constructBloomFilter()" name is colliding with some internal name used by OSSFuzz. We'll see if this rename clears the problem. (check-in: [403e7312dd] user: drh branch: trunk, size: 106227)
2021-12-09
19:42
[98ec56212e] part of check-in [ce42039f56] Remove unused code and fix comments. Final cleanup before merging. (check-in: [ce42039f56] user: drh branch: bloom-filter, size: 106220)
18:44
[c2324c3204] part of check-in [d342ab722d] Enable bloom filters for the right table of a LEFT JOIN. Fix unreachable branches. (check-in: [d342ab722d] user: drh branch: bloom-filter, size: 106220)
01:28
[560424f584] part of check-in [88b43d798c] Add SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program. Improvements to testability of bloom filters. (check-in: [88b43d798c] user: drh branch: bloom-filter, size: 106274)
2021-12-08
16:15
[e2207f011b] part of check-in [d325025677] Merge the WhereClause fix from trunk (check-in: [d325025677] user: drh branch: bloom-filter, size: 106326)
16:07
[280f1f8731] part of check-in [6024682ca4] In the WhereClause object, do not assume that all TERM_VIRTUAL terms appear at the end of the list, because that is no longer true. Instead, keep a separate nBase count that is the size of the list excluding the tail of virtual terms. Use nBase instead of nTerm when scanning terms that are not virtual. Add assert()s to validate correctness of WhereClause. (check-in: [6024682ca4] user: drh branch: trunk, size: 100880)
2021-12-06
23:07
[f82a322a88] part of check-in [00070e1fff] Improved EXPLAIN QUERY PLAN output for Bloom filters. (check-in: [00070e1fff] user: drh branch: bloom-filter, size: 106326)
2021-12-05
20:19
[fa667db48d] part of check-in [06f6fefd67] Run as many Bloom filters as possible before index lookups. (check-in: [06f6fefd67] user: drh branch: bloom-filter, size: 105707)
00:45
[48b456c910] part of check-in [5be2470f87] Try to run all Bloom filters before any Seeks. This gives a small performance gain on the Star-Schema Benchmark. (check-in: [5be2470f87] user: drh branch: bloom-filter, size: 103525)
2021-12-04
18:45
[2253f91bcd] part of check-in [629ee2e3e3] Add VdbeCoverage() macros. Adjust the Bloom-filter hash function so that it correctly deals with zero-blobs. (check-in: [629ee2e3e3] user: drh branch: bloom-filter, size: 101326)
14:24
[ab83c1f7c5] part of check-in [a70429596a] Apply the Bloom filter only on those terms of an index that have equality constraints. (check-in: [a70429596a] user: drh branch: bloom-filter, size: 101278)
13:52
[26b0cbc985] part of check-in [8e078c0e40] Add the "WITH BLOOM FILTER" clause to the EXPLAIN QUERY PLAN output for cases were a Bloom filter is used. (check-in: [8e078c0e40] user: drh branch: bloom-filter, size: 101286)
2021-12-01
16:31
[620e810775] part of check-in [50ac4de1d7] Add a Bloom filter to the automatic-index mechanism. (check-in: [50ac4de1d7] user: drh branch: bloom-filter, size: 101188)
2021-11-09
15:36
[5c85a71ff7] part of check-in [122f4a762a] Merge all recent trunk changes into the begin-concurrent-report branch. (check-in: [122f4a762a] user: drh branch: begin-concurrent-report, size: 100949)
2021-11-02
20:52
[1f5b62f46d] part of check-in [266e9cbada] Proposed fix for a problem associated with OP_SeekScan that results in an incorrect answer. See ticket [5981a8c041a3c2f3]. (check-in: [266e9cbada] user: drh branch: seekscan-fix-20211102, size: 100880)
2021-10-21
14:37
[28e9bba9a1] part of check-in [0770f320b9] Merge all recent trunk changes into the begin-concurrent-report branch. (check-in: [0770f320b9] user: drh branch: begin-concurrent-report, size: 100395)
2021-10-15
17:06
[a1d79cc5a1] part of check-in [8a56de5b9c] Protect the WhereTerm.u union using nearby assert()s and/or branches. (check-in: [8a56de5b9c] user: drh branch: trunk, size: 100326)
2021-10-14
19:28
[5a7d3c80d3] part of check-in [bdd840216c] Protect access to the WhereLoop.u union using nearby assert()s and branches. (check-in: [bdd840216c] user: drh branch: trunk, size: 100187)
2021-10-07
20:46
[0bb4a2a82f] part of check-in [87e2f5eb43] Protect access to the Expr.y union using nearby assert()s and branches. (check-in: [87e2f5eb43] user: drh branch: trunk, size: 99914)
17:43
[6721f5de1d] part of check-in [8eaa1d4a98] Protect all accesses to the Expr.x union using nearby assert()s and branches. (check-in: [8eaa1d4a98] user: drh branch: trunk, size: 99871)
2021-10-04
22:34
[af9bc0608f] part of check-in [32f33f3569] Fix harmless static-analyzer warnings. (check-in: [32f33f3569] user: drh branch: trunk, size: 99699)
12:16
[ff50e44bb0] part of check-in [71b102942c] Merge recent trunk changes into the begin-concurrent-report branch. (check-in: [71b102942c] user: drh branch: begin-concurrent-report, size: 99753)
2021-08-30
17:02
[0208553a06] part of check-in [46e28cbcf6] Do not disable a rowid=? term used to drive an IPK index if it is a transitive constraint. Commit [f1f9b5de] made the same change for non-IPK indexes. (check-in: [46e28cbcf6] user: dan branch: trunk, size: 99684)
2021-08-09
19:41
[d06ed7509a] part of check-in [25a768cb8a] Merge recent trunk enhancements into the begin-concurrent-report branch. (check-in: [25a768cb8a] user: drh branch: begin-concurrent-report, size: 99847)
2021-08-05
15:27
[9b33f463a2] part of check-in [832ac4c1ee] Store the collating sequence name for each column of a table as an extension to the column name, for an additional savings in the heap space needed to hold the schema. (check-in: [832ac4c1ee] user: drh branch: trunk, size: 99778)
2021-08-03
17:05
[401e98037f] part of check-in [385e3b4e9d] Merge recent trunk enhancements into the begin-concurrent-report branch. (check-in: [385e3b4e9d] user: drh branch: begin-concurrent-report, size: 99767)
2021-08-02
18:03
[ef36790a79] part of check-in [8b781dcaf6] Refactor field names in the Column object, zCnName and zCnColl, to make them unique and thus easier to find amid all the other code. (check-in: [8b781dcaf6] user: drh branch: trunk, size: 99698)
2021-06-22
23:30
[d2199da96f] part of check-in [668564100e] This is another alternative fix to the covering index on WHERE_MULTI_OR in a LEFT JOIN problem that is fixed on trunk nearby. In this alternative, covering indexes are simply disabled for WHERE_MULTI_OR on a LEFT JOIN. This might have run-time impact on some obscure queries. This patch is saved for historical reference only. (check-in: [668564100e] user: drh branch: multi-or-covidx-fix3, size: 99727)
2021-06-14
14:01
[116a1964ed] part of check-in [a485d1a1b8] Update this branch with latest changes from begin-concurrent-pnu. (check-in: [a485d1a1b8] user: dan branch: begin-concurrent-report, size: 99761)
2021-06-02
12:44
[d0963d5a2a] part of check-in [d58efb3f21] This is an attempt to address the OP_SeekScan performance issue identified by forum post b4fcb8a598. (check-in: [d58efb3f21] user: drh branch: seekscan-improvements, size: 99700)
2021-05-28
14:28
[bcfee3789a] part of check-in [4488cb883e] If a subquery is used to drive an index, this change avoids making an extra copy of the result of that subquery. But, such situations are probably sufficiently unusual that the added complexity of this enhancement is not worth the performance gain. So I'm going to park this check-in on a branch. If we later find a use case to justify it, we can merge it to trunk then. This is the "further change" that was promised by the prior check-in comment. (check-in: [4488cb883e] user: drh branch: copy-optimization, size: 99914)
12:48
[9f1f65d114] part of check-in [c9f0b9cb0a] Make a deep copy of the result of a subquery in case the subquery is reused. Fix for the problem reported by forum post 28216b36ac and introduced by check-in [f30fb19ff763a7cb]. Further changes to try to optimize the new OP_Copy opcode back into either OP_SCopy or OP_Move will be attempted separately. A test case will be in TH3. (check-in: [c9f0b9cb0a] user: drh branch: trunk, size: 99692)
2021-05-26
14:32
[b40f3addc0] part of check-in [3e2c36a827] Update an assert() in wherecode.c that might fail following an unrelated SQL error. (check-in: [3e2c36a827] user: dan branch: trunk, size: 99693)
2021-05-22
11:23
[adb6727516] part of check-in [b986600520] Do not invoke sqlite3ExprAffinity() after a syntax error that might have left the tree in an inconsistent state. See also [e8a1515b44380cc5] and forum post 7e484e225c. (check-in: [b986600520] user: drh branch: trunk, size: 99677)
2021-05-21
16:32
[d4dded15e9] part of check-in [1dc6cf5113] Merge the latest trunk changes into begin-concurrent-report branch via the begin-concurrent-pnu branch. (check-in: [1dc6cf5113] user: drh branch: begin-concurrent-report, size: 99727)
2021-05-18
19:10
[110ed13049] part of check-in [4a55f72542] In the MULTI-INDEX OR query plan, code for sub-expressions can sometimes be generated twice. But for some subqueries, generating code off of the same tree twice causes problems. So now MULTI-INDEX OR makes a copy of the sub-expressions it uses to avoid code-generating them more than once. dbsqlfuzz 9ebd2140e7206ff724e665f172faea28af801635. (check-in: [4a55f72542] user: drh branch: trunk, size: 99658)
2021-05-12
22:15
[b4c21439f0] part of check-in [b2b0e23ba8] Further simplification of the reverse-order scan logic of the previous check-in. (check-in: [b2b0e23ba8] user: drh branch: trunk, size: 99379)
22:02
[bc8f176a9a] part of check-in [f65c929bf1] Fix the query plan for an indexed lookup on a WITHOUT ROWID table with a DESC primary key when the primary key is constrained by an inequality. See forum post 8988341615. Test cases in TH3. (check-in: [f65c929bf1] user: drh branch: trunk, size: 99420)
2021-05-04
23:21
[4a14b647a6] part of check-in [f1f9b5de3c] When applying the optimization that disables WHERE clause terms that drive indexes, make sure not to do so if the term being disabled is a transitive constraint. Fix for the problem identified by forum post eb8613976a. (check-in: [f1f9b5de3c] user: drh branch: trunk, size: 99420)
18:24
[4cce3dc584] part of check-in [625fb253ee] Also for the 0x20000 bit of ".wheretrace", show when WHERE clause terms are disabled. (check-in: [625fb253ee] user: drh branch: trunk, size: 98840)
2021-04-21
23:13
[992bf0d752] part of check-in [02af30aab2] The new OP_Null opcode from check-in [8b54102a00852b72] was not coded correctly. This check-in attempts to fix that. (check-in: [02af30aab2] user: drh branch: trunk, size: 98656)
11:58
[b4f24544fb] part of check-in [8b54102a00] Initialize the key registers in the skip-scan optimization to NULL, in case the query is run on a corrupt database that causes the initialization of the key to be bypassed. dbsqlfuzz 62fdf2bece00d24cac8a4edf2cf562e6eeac779d (check-in: [8b54102a00] user: drh branch: trunk, size: 98646)
2021-04-16
01:03
[0e42f4ad53] part of check-in [e8a1515b44] Do not invoke sqlite3ExprAffinity() if there is a possibility that the Expr is incomplete due to a prior OOM. dbsqlfuzz b8a824706914488bd236da51118eb9174ceb870f (check-in: [e8a1515b44] user: drh branch: trunk, size: 98592)
2021-04-07
17:46
[dbc9ff7386] part of check-in [655c28412f] Merge latest changes into this branch. (check-in: [655c28412f] user: dan branch: begin-concurrent-report, size: 98638)
2021-04-05
16:20
[8bdc239eae] part of check-in [644bb77f8b] Avoid coding unindexed WHERE constraints if an equivalent transitive term has already been coded by an outer loop. (check-in: [644bb77f8b] user: dan branch: trunk, size: 98569)
2021-04-02
20:53
[086795ef42] part of check-in [a221625933] Merge latest trunk changes with this branch. (check-in: [a221625933] user: dan branch: begin-concurrent-report, size: 98605)
2021-03-20
15:46
[c7354c9749] part of check-in [1b83e232c4] Use the canonical name, not the AS name, when showing the MATERIALIZE or CO-ROUTINE lines for a CTE. (check-in: [1b83e232c4] user: drh branch: eqp-improvements, size: 98536)
2021-03-19
13:00
[40a5d24cd0] part of check-in [6f8faec022] Improved labeling of EXPLAIN QUERY PLAN output. Many test failures due to the different output format. (check-in: [6f8faec022] user: drh branch: eqp-improvements, size: 98537)
2021-03-11
19:26
[c515843650] part of check-in [6994a2d8af] Merge latest changes from begin-concurrent-pnu into this branch. (check-in: [6994a2d8af] user: dan branch: begin-concurrent-report, size: 98810)
2021-02-21
21:04
[e57a869031] part of check-in [bfd5bf2c73] Rename the "struct SrcList_item" object to the more succinct "SrcItem". This is a symbolic change only. The logic is unmodified. (check-in: [bfd5bf2c73] user: drh branch: trunk, size: 98741)
2021-01-27
17:15
[43a63441f8] part of check-in [390cf60a28] Ensure a cursor used by the SeekScan operator does not point to a valid row on the first iteration of the loop. Possible fix for [ee51301f316c09e]. (check-in: [390cf60a28] user: dan branch: fix-2d6e8400, size: 98768)
2020-11-26
17:54
[cbd5094b4c] part of check-in [d2de81a24f] Merge latest changes from begin-concurrent-pnu into this branch. (check-in: [d2de81a24f] user: dan branch: begin-concurrent-report, size: 98571)
2020-10-02
13:57
[5e0b6dec85] part of check-in [c144d6404f] Import further corner-case fixes for the in-scan-vs-index or OP_SeekScan optimization from trunk. (check-in: [c144d6404f] user: drh branch: branch-3.28, size: 90611)
13:48
[a3a1aff30f] part of check-in [ad5ab24ebd] Additional corner-case fixes for the in-scan-vs-index or OP_SeekScan optimization. (check-in: [ad5ab24ebd] user: drh branch: trunk, size: 98502)
12:11
[e9958d23b3] part of check-in [ec37744c6e] For the OP_SeekScan optimization, the OP_IdxGT does not necessarily come right after the OP_SeekGE. So use the P2 operand of OP_SeekScan to point to the first instruction after OP_IdxGT. Problem found by dbsqlfuzz. (check-in: [ec37744c6e] user: drh branch: branch-3.28, size: 90813)
11:55
[1a229b9d1f] part of check-in [091d719394] For the OP_SeekScan optimization, the OP_IdxGT does not necessarily come right after the OP_SeekGE. So use the P2 operand of OP_SeekScan to point to the first instruction after OP_IdxGT. Problem found by dbsqlfuzz. (check-in: [091d719394] user: drh branch: trunk, size: 98704)
02:07
[40317cffac] part of check-in [9a1cdf7e9c] Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works with forwards scans. Thanks to OSSFuzz for pointing out the problem to us. (check-in: [9a1cdf7e9c] user: drh branch: branch-3.28, size: 90620)
02:02
[d19490e96a] part of check-in [c75c3a3b75] Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works with forwards scans. Thanks to OSSFuzz for pointing out the problem to us. (check-in: [c75c3a3b75] user: drh branch: trunk, size: 98511)
2020-10-01
14:38
[5fc7fe7186] part of check-in [e9d1efa597] Remove a debugging printf() accidentally left in the previous check-in. (check-in: [e9d1efa597] user: drh branch: trunk, size: 98325)
14:36
[dd05b1c064] part of check-in [dbec6910d9] The IN-early-out optimization does not work for virtual tables. Do not try to use it there. Fix for ticket [2d5a3163563d559f]. Test cases in TH3. (check-in: [dbec6910d9] user: drh branch: trunk, size: 98397)
2020-09-30
18:22
[3e46ac6aad] part of check-in [f07ac3fb38] Improved query optimization for multi-column indexes where the second or later columns are constrained by an IN operator and the earlier index columns limit the search to a small number of rows. Use the new OP_SeekScan opcode which does scanning of the relevant range of the index but gives up and falls back to doing a seek if the number of rows scanned grows to large, in order to guard against pathological cases where the estimated number of rows to be scanned is far too small. (check-in: [f07ac3fb38] user: drh branch: branch-3.28, size: 90434)
18:06
[b6293c637e] part of check-in [4a43430fd2] Improved query optimization for multi-column indexes where the second or later columns are constrained by an IN operator and the earlier index columns limit the search to a small number of rows. Use the new OP_SeekScan opcode which does scanning of the relevant range of the index but gives up and falls back to doing a seek if the number of rows scanned grows to large, in order to guard against pathological cases where the estimated number of rows to be scanned is far too small. (check-in: [4a43430fd2] user: drh branch: trunk, size: 98146)
18:03
[ccaedd1965] part of check-in [dc4172e6b8] For the OP_SeekScan opcode, adjust the number of steps run before giving up based on the estimated number of comparisons needed to perform a seek. (check-in: [dc4172e6b8] user: drh branch: in-scan-vs-index, size: 98177)
17:32
[13a212b333] part of check-in [7395e96b8c] Back out the incorrect optimization of check-in [e51ecadcbdef5ce6] as ticket [5c4e7aa793943803] reports a case where the optimization does not work. (check-in: [7395e96b8c] user: drh branch: trunk, size: 97301)
2020-09-29
20:22
[8d5e5973bc] part of check-in [9e57e758a6] Coverage testing of the OP_SeekScan opcode. Fix a problem that comes up when OP_SeekScan reaches the end of the table. (check-in: [9e57e758a6] user: drh branch: in-scan-vs-index, size: 97615)
15:32
[89d14a834b] part of check-in [8fd7d8dfcd] Typo fix to repair the early-out optimization. Also avoid unnecessary OP_SeekHit opcodes. (check-in: [8fd7d8dfcd] user: drh branch: in-scan-vs-index, size: 97597)
01:48
[9c2301ecfd] part of check-in [f3c36b840c] The OP_SeekScan opcode works, but using it requires disabling the IN-earlyout optimization because the OP_IfNoHope opcode might move the cursor. (check-in: [f3c36b840c] user: drh branch: in-scan-vs-index, size: 97555)
2020-09-28
19:51
[4096498d05] part of check-in [d720b6981e] Revisiting the IN-scan optimization to try to fix it for the corner case where the statistics deceive the query planner into using a scan when an indexed lookup would be better. This check-in changes the code generation to do the IN-scan using a new OP_SeekScan opcode. That new opcode is designed to abandon the scan and fall back to a seek if it doesn't find a match quickly enough. For this work-in-progress check-in, OP_SeekScan is still a no-op and OP_SeekGE still ends up doing all the work. (check-in: [d720b6981e] user: drh branch: in-scan-vs-index, size: 97506)
15:49
[895ff782a6] part of check-in [43f7ddad80] Small performance improvement and size reduction by reducing the size of the WhereTerm object. (check-in: [43f7ddad80] user: drh branch: trunk, size: 97332)
2020-09-17
11:32
[9afd600ca9] part of check-in [751fe4edb2] Prevent use-after-free of the u.vtab.idxStr string following an OOM while generating the OP_VFilter opcode. (check-in: [751fe4edb2] user: drh branch: trunk, size: 97326)
2020-09-01
02:02
[8e6776e9a1] part of check-in [49b7631e86] Improvements to the IN-early-out optimization so that it works more efficiently when there are two or more indexed IN clauses on a single table. (check-in: [49b7631e86] user: drh branch: branch-3.28, size: 89622)
01:52
[8b1176a3b7] part of check-in [35505c68c1] Improvements to the IN-early-out optimization so that it works more efficiently when there are two or more indexed IN clauses on a single table. (check-in: [35505c68c1] user: drh branch: trunk, size: 97125)
2020-08-31
19:19
[3d3f45ebcb] part of check-in [8301da31d0] An attempt to improve the performance of the IN-early-out optimization (see check-in [09fffbdf9f2f6ce3]) by avoiding unnecessary calls to the b-tree search algorithm in OP_IfNoHope when the index key is at hand and the same answer can be obtained by doing a quick key comparison. Update: Experiment did not work out. (check-in: [8301da31d0] user: drh branch: branch-3.28-in-early-out-fail, size: 89723)
16:31
[28b243fe62] part of check-in [e9d983c683] An attempt to improve the performance of the IN-early-out optimization (see check-in [09fffbdf9f2f6ce3]) by avoiding unnecessary calls to the b-tree search algorithm in OP_IfNoHope when the index key is at hand and the same answer can be obtained by doing a quick key comparison. Update 2020-08-31: This experiment did not work out. A better approach is now on trunk. (check-in: [e9d983c683] user: drh branch: in-early-out-fail, size: 97226)
2020-08-17
21:03
[fd8d83689a] part of check-in [0ecda43371] When doing an UPDATE or DELETE using a multi-column index where only a few of the earlier columns of the index are useful for the index lookup, postpone doing the main table seek until after all WHERE clause constraints have been evaluated, in case those constraints can be covered by unused later terms of the index, thus avoiding unnecessary main table seeks. (check-in: [0ecda43371] user: dan branch: branch-3.28, size: 89613)
2020-08-15
19:58
[110fa357bf] part of check-in [e51ecadcbd] Omit the unnecessary not-NULL check on the upper bound of a forward index range scan. The subsequent OP_IdxGT will always catch the NULL. Similarly, omit the not-NULL check on the lower bound of a reverse index range scan, as the SeekLE opcode will disallow the NULL. (check-in: [e51ecadcbd] user: drh branch: trunk, size: 97116)
2020-08-14
20:04
[cb9bc7cef9] part of check-in [a495f60d31] For UPDATE and DELETE, use OP_DeferredSeek always. If the seek must later be resolved, add the OP_FinishSeek opcode after all WHERE clause terms have been processed. This obviates the need for the WHERE_SEEK_TABLE and WHERE_SEEK_UNIQ_TABLE flags to sqlite3WhereBegin() and the ensuing complication, and it allows the covering index optimization to be used further into WHERE clause processing. (check-in: [a495f60d31] user: drh branch: delete-bytecode-optimization, size: 97085)
2020-07-30
19:56
[a1e168ea0c] part of check-in [fd01e78827] Merge begin-concurrent-pnu changes into this branch. (check-in: [fd01e78827] user: dan branch: begin-concurrent-report, size: 97591)
2020-07-29
16:18
[3fa28a5668] part of check-in [a80ae2c98b] Dozens and dozens of typo fixes in comments. This change adds no value to the end product and is disruptive, so it is questionable whether or not it will ever land on trunk. (check-in: [a80ae2c98b] user: drh branch: typos, size: 97522)
2020-07-22
13:38
[8064fe5c04] part of check-in [9ce1710aad] Continuing work toward supporting unsigned 32-bit page numbers. (check-in: [9ce1710aad] user: drh branch: larger-databases, size: 97522)
2020-07-17
11:07
[efe6de4c11] part of check-in [12a909fb3d] Bring this branch up to date with begin-concurrent-pnu. (check-in: [12a909fb3d] user: dan branch: begin-concurrent-report, size: 97591)
2020-03-19
21:17
[9e931b9d01] part of check-in [3cf7537b5e] Initial code for a proposed new sqlite3_stmt_mode() API. This is an incomplete snapshot of a work-in-progress. (check-in: [3cf7537b5e] user: drh branch: sqlite3_stmt_mode, size: 97540)
2020-03-02
21:00
[e0b28348f2] part of check-in [ad961aee15] Fix reporting for some range scan cases. (check-in: [ad961aee15] user: dan branch: begin-concurrent-report, size: 97495)
01:16
[7b939de85d] part of check-in [704bb9a39a] Ensure that the NULL-scan pass counter is initialized when a ORDER BY NULLS LAST is used on the right table of a LEFT JOIN. Ticket [e12a0ae526bb51c7]. (check-in: [704bb9a39a] user: drh branch: trunk, size: 97522)
2020-01-29
15:03
[f5df56e395] part of check-in [dcb4838757] Fix a problem with the processing of IN(...) constraints handled by virtual table implementations that do not set the "omit" flag when the virtual table column contains at least one NULL value. (check-in: [dcb4838757] user: dan branch: trunk, size: 97426)
2020-01-12
22:38
[ec8870d6fe] part of check-in [3e3c60d812] Better than removing the incorrect assert() is to change it into a testcase() together with a comment indicating where an appropriate test case can be found, and the ticket that provoked the change. Ticket [614b25314c766238] (check-in: [3e3c60d812] user: drh branch: trunk, size: 97380)
22:20
[3f7b0f73a2] part of check-in [6a999c5aa0] Remove an incorrect assert(). Fix for ticket [614b25314c766238] (check-in: [6a999c5aa0] user: drh branch: trunk, size: 97202)
2020-01-04
16:55
[75ad6cbb8d] part of check-in [95ef68966c] Fix a problem where the loop for the RHS of a LEFT JOIN uses values from an IN() clause as the second or subsequent field of an index. (check-in: [95ef68966c] user: dan branch: trunk, size: 97324)
2020-01-02
00:45
[b8acf97f95] part of check-in [7bfd42f1dc] The sqlite3WhereEnd() call now unwinds all Expr modifications made by the sqlite3WhereBegin(). (check-in: [7bfd42f1dc] user: drh branch: trunk, size: 97368)
2019-12-29
00:52
[a987d22b42] part of check-in [21ef6e9933] Add the OP_FinishSeek opcode which completes an OP_DeferredSeek if the seek has not already completed. Also add the sqlite3WhereUsesDeferredSeek() interface to the query planner. The UPDATE implementation adds an OP_FinishSeek before running the final OP_Insert if one is needed. Ticket [ec8abb025e78f40c] and also an assertion fault reported by Yongheng. (check-in: [21ef6e9933] user: drh branch: trunk, size: 96755)
2019-12-28
18:08
[3c9b185cdb] part of check-in [82be135dee] Change an assert() in where.c to a testcase() macro, since the condition may be false. This was a problem with the assert() only, there is no bug in release builds that omit assert(). (check-in: [82be135dee] user: dan branch: trunk, size: 96726)
16:20
[8f4b83ef41] part of check-in [9421b442ca] Disable early coding of transitive constraints at the end of each loop in the WHERE clause processing if the loop being coded is for a LEFT JOIN, even if the loop is part of an OR-clause optimization for virtual tables. Test cases in TH3. (check-in: [9421b442ca] user: drh branch: trunk, size: 96725)
14:33
[65e1df2a47] part of check-in [c4d5b75c93] Further improvements to .wheretrace during loop code generation. (check-in: [c4d5b75c93] user: drh branch: trunk, size: 96686)
14:07
[d074abccfb] part of check-in [59cc46e5a6] New enhancements to .wheretrace. The 0x20000 flag shows the WHERE clause before and after coding each loop. The 0x800 flag shows status at the start and at the end of each loop. An extra "C" tag is shown on coded terms. (check-in: [59cc46e5a6] user: drh branch: trunk, size: 96505)
2019-12-26
00:20
[d42d3e0fe9] part of check-in [e5fd8b5050] Disable the optimization that tries to pull the value of an expression from an index on that expression if the expression is a constant. (check-in: [e5fd8b5050] user: drh branch: trunk, size: 95449)
2019-12-23
14:20
[bb58d5e6e7] part of check-in [0b1dbd60f5] For expressions like (x, y) IN (SELECT ...) where the SELECT uses window-functions, require that all columns on the LHS be indexed before an index can be used. Fix for [d9ed4ebe]. (check-in: [0b1dbd60f5] user: dan branch: trunk, size: 95393)
2019-12-22
18:55
[c4cb79b7c9] part of check-in [56539e1c13] Fix to the optimization of check-in [a47efb7c8520a011] that reads the values of expressions used in an index-on-expression directly from the index rather than recomputing the value. If the expression has a top-level COLLATE or unlikely() operator, be sure to clear the corresponding flags prior to converting it into a TK_COLUMN expression. Failure to do this is most likely harmless in production, but might cause an assertion fault in debugging builds. Ticket [b0cb8aff561a6dcd]. Test cases in TH3. (check-in: [56539e1c13] user: drh branch: trunk, size: 96484)
17:32
[9c274ea84e] part of check-in [8c856404b4] Ensure sqlite3WindowRewrite() is called on a SELECT statement before any terms aremoved from it as part of IN() clause processing. Fix for [f00d096ca]. (check-in: [8c856404b4] user: dan branch: trunk, size: 96331)
2019-12-20
22:46
[9c2757cb43] part of check-in [056bb8dcbd] Do not try to access a generated column through an index if the collating sequence for the generated column is non-standard. Part 2 of ticket [e0a8120553f4b082] (check-in: [056bb8dcbd] user: drh branch: trunk, size: 95232)
2019-12-09
14:34
[7efa97f4dc] part of check-in [e3398c5ffb] Fix a gramfuzz find. If a partial index that does not reference any column of its table is used by an UPDATE statement in one-pass mode, then avoid the use of OP_DeferredSeek since the seek might not be resolved prior to the OP_Delete and OP_Insert that implement the UPDATE. (check-in: [e3398c5ffb] user: drh branch: trunk, size: 94701)
2019-11-21
18:28
[909325b98d] part of check-in [8b12e95fec] Fix a problem that comes up when using generated columns that evaluate to a constant in an index and then making use of that index in a join. (check-in: [8b12e95fec] user: drh branch: trunk, size: 94677)
2019-11-06
19:25
[9b84737fd6] part of check-in [7bc8205dd9] Minor simplification to the changes from check-in [36c11ad51f]. (check-in: [7bc8205dd9] user: mistachkin branch: trunk, size: 94562)
17:31
[d1b6cfac96] part of check-in [36c11ad51f] Fix the OP_DeferredSeek index-to-table column map in P4 so that it works with generated columns. Ticket [ce22a07731530118] (check-in: [36c11ad51f] user: drh branch: trunk, size: 94577)
2019-11-04
12:49
[4b6517752f] part of check-in [5710845b63] Changes an unreachable testcase() into an assert(). (check-in: [5710845b63] user: drh branch: trunk, size: 94460)
2019-11-03
00:07
[123cd05eae] part of check-in [3be19e1151] 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] (check-in: [3be19e1151] user: drh branch: trunk, size: 94290)
2019-10-24
21:02
[28a3f27b44] part of check-in [b99d570131] The previous fix was incomplete. It is also necessary to disable the Expr.y.pTab field when making the translation. (check-in: [b99d570131] user: drh branch: generated-columns, size: 93991)
20:29
[c491ae0ce1] part of check-in [e0f7e321ec] Fix handling of covering indexes that use virtual columns. (check-in: [e0f7e321ec] user: drh branch: generated-columns, size: 93966)
2019-10-19
13:29
[d96190c0b5] part of check-in [27ab41c910] Refactor names of column index transformation functions, for clarity. Get generated columns working with ALTER TABLE RENAME COLUMN. (check-in: [27ab41c910] user: drh branch: generated-columns, size: 92675)
2019-10-18
12:52
[b9bb13fce6] part of check-in [e8426acb94] Claw back some performance from the sqlite3ExprGetColumnOfTable() routine. (check-in: [e8426acb94] user: drh branch: generated-columns, size: 92660)
2019-10-16
12:18
[39df666a72] part of check-in [11d472c1df] Initial experimental code for generated column support. Non-functional. (check-in: [11d472c1df] user: drh branch: generated-columns, size: 92670)
2019-10-15
19:01
[57d034a0db] part of check-in [7248e34765] Formatting change on a multi-line conditional, for improved clarity. No logic changes. (check-in: [7248e34765] user: drh branch: trunk, size: 92661)
2019-10-14
20:32
[e6173659b1] part of check-in [bc751fb64d] Futher improvements to the IN operator for row-values on virtual tables. (check-in: [bc751fb64d] user: drh branch: trunk, size: 92664)
15:15
[fde87356e0] part of check-in [aa57d7abac] Fix a problem with row-value IN(...) operators and virtual tables. (check-in: [aa57d7abac] user: dan branch: trunk, size: 92550)
2019-08-30
23:56
[b27b95cbd9] part of check-in [e0d909c740] 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] (check-in: [e0d909c740] user: drh branch: trunk, size: 92553)
2019-08-23
17:09
[535c8e2284] part of check-in [bfe793780f] Revise the VDBE comments for NULL-scan so that they also work make sense when reading a NULLS FIRST plan. (check-in: [bfe793780f] user: drh branch: nulls-last, size: 92484)
17:00
[3bed0f377a] part of check-in [1383680d92] Additional simplifications of the WHERE loop code generator logic for NULLS LAST. (check-in: [1383680d92] user: drh branch: nulls-last, size: 92484)
16:12
[f8ba85888b] part of check-in [e3ed2f496f] Simplification of the WHERE loop code generator for NULLS LAST saves a few CPU cycles and about a hundred bytes of code space. (check-in: [e3ed2f496f] user: drh branch: nulls-last, size: 92438)
13:32
[c02ff23ea4] part of check-in [bf875e1a25] 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. (check-in: [bf875e1a25] user: drh branch: nulls-last, size: 93058)
13:08
[1700806bb5] part of check-in [649b08ead5] Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. (check-in: [649b08ead5] user: drh branch: nulls-last, size: 93046)
2019-08-22
21:13
[f8005a06f7] part of check-in [d3531f5be7] Add additional VDBE coverage macros. (check-in: [d3531f5be7] user: drh branch: nulls-last, size: 92872)
2019-08-21
15:41
[b8f285f93d] part of check-in [6153bcf41a] Update this branch with latest trunk changes. (check-in: [6153bcf41a] user: dan branch: nulls-last, size: 91448)
2019-08-20
11:43
[e1131fe94c] part of check-in [511da08156] 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]. (check-in: [511da08156] user: dan branch: trunk, size: 91179)
2019-08-17
17:55
[81c5d1eb90] part of check-in [b49df1fe9b] Fix problem with DESC indexes on this branch. (check-in: [b49df1fe9b] user: dan branch: nulls-last, size: 91399)
2019-08-16
21:07
[58889def15] part of check-in [81069d7196] Add support for using indexes for some ORDER BY clauses that use non-default NULL handling. Still some problems on this branch. (check-in: [81069d7196] user: dan branch: nulls-last, size: 91372)
2019-08-06
14:37
[cf885ea2d4] part of check-in [e8234f6939] 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. (check-in: [e8234f6939] user: drh branch: pending, size: 91130)
2019-08-03
19:06
[5dd20651af] part of check-in [1bd4b97d64] Strengthen an assert() in the WHERE clause code generator for the min/max optimization. (check-in: [1bd4b97d64] user: drh branch: trunk, size: 91026)
16:37
[b45c98f260] part of check-in [d465c3eef4] Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca]. (check-in: [d465c3eef4] user: dan branch: trunk, size: 91001)
2019-08-02
18:43
[52451ce367] part of check-in [a7277ed062] 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]. (check-in: [a7277ed062] user: dan branch: tkt-41866dc37, size: 90949)
2019-05-07
17:47
[37a1004237] part of check-in [8b6691f619] Strive to prevent harmless compiler warnings in GCC 4.8.5. (check-in: [8b6691f619] user: drh branch: trunk, size: 89899)
2019-04-19
13:38
[0e76672930] part of check-in [7713996aa9] Streamline the processing of the AND operator. Slightly smaller and faster. (check-in: [7713996aa9] user: drh branch: trunk, size: 89896)
2019-04-05
20:56
[83be72e8d1] part of check-in [d272819298] 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. (check-in: [d272819298] user: drh branch: trunk, size: 89888)
2019-03-30
20:37
[9572aab9ef] part of check-in [b5f72f10f2] Fix issues with the previous check-in and add more VDBE branch coverage testing macros. (check-in: [b5f72f10f2] user: drh branch: oops, size: 89550)
2019-03-18
10:30
[6fa4056c5c] part of check-in [c2f50aa4e7] Fix a typo in a comment. No changes to code. (check-in: [c2f50aa4e7] user: drh branch: trunk, size: 89497)
2019-03-01
18:07
[ce7b21e1be] part of check-in [9b2879629c] 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. (check-in: [9b2879629c] user: drh branch: trunk, size: 89497)
2019-02-23
00:08
[061848646c] part of check-in [90c5a17cd5] Remove a testcase() macro which is now unreachable due to the contraction of the use of IN_INDEX_ROWID. (check-in: [90c5a17cd5] user: drh branch: tkt-df46dfb631, size: 88388)
2019-02-22
21:33
[cdeb7c7028] part of check-in [0d456456da] 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]. (check-in: [0d456456da] user: drh branch: tkt-df46dfb631, size: 88463)
2019-02-20
12:52
[5ee878f714] part of check-in [fa792714ae] 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]. (check-in: [fa792714ae] user: drh branch: trunk, size: 88403)
2019-02-08
04:15
[a571d8d7c1] part of check-in [440a7cda00] 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]. (check-in: [440a7cda00] user: drh branch: trunk, size: 88369)
2018-12-31
18:30
[89d2ec668a] part of check-in [9fb646f29c] Merge enhancements and bug fixes from trunk. (check-in: [9fb646f29c] user: drh branch: reuse-subqueries, size: 88081)
2018-12-29
02:26
[f9f790fc1c] part of check-in [4a0929ac76] A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. (check-in: [4a0929ac76] user: drh branch: trunk, size: 88093)
2018-12-25
00:15
[daade83137] part of check-in [3c2ad0e915] Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. (check-in: [3c2ad0e915] user: drh branch: reuse-subqueries, size: 88063)
2018-12-24
20:21
[3e948cbadc] part of check-in [7153552bac] 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. (check-in: [7153552bac] user: drh branch: reuse-subqueries, size: 88209)
14:30
[538ca683d7] part of check-in [e53781f5bd] Restore a line of code that was previously commented out for debugging. (check-in: [e53781f5bd] user: drh branch: reuse-subqueries, size: 88074)
02:34
[e819fc8ecb] part of check-in [6c44838adb] 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. (check-in: [6c44838adb] user: drh branch: reuse-subqueries, size: 88076)
2018-12-23
21:27
[1945ccec1b] part of check-in [2b6494b150] 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. (check-in: [2b6494b150] user: drh branch: trunk, size: 88075)
2018-11-05
13:35
[cf6d3ac7b4] part of check-in [1309c84ad3] 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]. (check-in: [1309c84ad3] user: drh branch: branch-3.25, size: 88030)
2018-11-03
13:11
[c45f03aefc] part of check-in [dcb8c73594] 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]. (check-in: [dcb8c73594] user: drh branch: trunk, size: 88032)
2018-09-20
19:02
[3df0a54137] part of check-in [ad130bb86e] 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. (check-in: [ad130bb86e] user: drh branch: trunk, size: 88001)
2018-09-19
20:14
[ab5992174e] part of check-in [24b0f66ac6] 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... (check-in: [24b0f66ac6] user: drh branch: expr-simplify, size: 88518)
17:24
[3b944b6dc5] part of check-in [8487f84af0] Fix an issue in virtual table handling associated with the new Expr.x.pRight field. (check-in: [8487f84af0] user: drh branch: expr-simplify, size: 88512)
14:54
[4c3ec236bf] part of check-in [147c61a6d4] 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. (check-in: [147c61a6d4] user: drh branch: expr-simplify, size: 88506)
2018-09-18
21:35
[75a3b20d28] part of check-in [8849a463d6] 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. (check-in: [8849a463d6] user: drh branch: expr-simplify, size: 88049)
2018-09-12
00:21
[4f88f5b39a] part of check-in [f578e62ae6] Fix a harmless compiler warning that arose from the ENABLE_CURSOR_HINTS fix of check-in [0af18674ca5b34e67e] (check-in: [f578e62ae6] user: drh branch: trunk, size: 87999)
2018-09-11
13:38
[e04303b85e] part of check-in [e7033104fa] Fix a problem causing ENABLE_CURSOR_HINTS builds to segfault. (check-in: [e7033104fa] user: dan branch: trunk, size: 88039)
2018-09-10
19:27
[c1fa3f6fc8] part of check-in [d879c47d7d] Fix a minor problem causing an incorrect cursor-hint to be generated in some cases. (check-in: [d879c47d7d] user: dan branch: trunk, size: 88096)
2018-08-04
15:53
[2b6cd1b277] part of check-in [7d9072b027] Further logic simplifications that flow out of the omission of the column cache. (check-in: [7d9072b027] user: drh branch: omit-column-cache, size: 88136)
2018-08-03
23:04
[9085b9d40a] part of check-in [3f5f60cd75] 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. (check-in: [3f5f60cd75] user: drh branch: omit-column-cache, size: 88135)
15:58
[eb558ea9a4] part of check-in [fa94b49e02] 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. (check-in: [fa94b49e02] user: drh branch: trunk, size: 88569)
2018-07-27
16:57
[2c552dfe50] part of check-in [82c67efb72] 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. (check-in: [82c67efb72] user: drh branch: propagate-const-opt, size: 88711)
2018-07-10
19:48
[fe23a55294] part of check-in [a7cdc5bc85] 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. (check-in: [a7cdc5bc85] user: drh branch: trunk, size: 88671)
2018-06-07
17:32
[3317f2b083] part of check-in [439c816227] Remove the NextIfOpen and PrevIfOpen opcodes which are no longer needed when the IN-early-out optimization is working. (check-in: [439c816227] user: drh branch: multikey-opt-idea, size: 88670)
16:07
[06950dc0ed] part of check-in [085e863713] Test cases. (check-in: [085e863713] user: drh branch: multikey-opt-idea, size: 88682)
14:59
[5f005bbdb4] part of check-in [522f1eacc2] Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. (check-in: [522f1eacc2] user: drh branch: multikey-opt-idea, size: 88673)
2018-06-05
20:45
[12d88d0195] part of check-in [6bf251af43] 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. (check-in: [6bf251af43] user: drh branch: multikey-opt-idea, size: 88614)
15:16
[f941a484fd] part of check-in [87a9fc504f] 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. (check-in: [87a9fc504f] user: drh branch: multikey-opt-idea, size: 88410)
2018-05-30
00:54
[49256d67b9] part of check-in [92f0fe155d] 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. (check-in: [92f0fe155d] user: drh branch: multikey-opt-idea, size: 88281)
2018-05-09
13:46
[728c7f7073] part of check-in [87f261f0cb] 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. (check-in: [87f261f0cb] user: drh branch: trunk, size: 88216)
2018-05-07
11:37
[414ec42097] part of check-in [374d8e2644] Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. (check-in: [374d8e2644] user: drh branch: trunk, size: 88200)
2018-05-04
00:39
[300f945eb4] part of check-in [75ac7b4e4f] Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines associated with the OR-optimization. (check-in: [75ac7b4e4f] user: drh branch: trunk, size: 88372)
2018-05-02
14:24
[3368f0797a] part of check-in [82ca44b82f] Fix a dangling-else problem that was causing recursive CTEs to malfunction. Begin fixing test cases to work with the new EQP output. (check-in: [82ca44b82f] user: drh branch: rework-EQP, size: 88286)
00:33
[13b831d258] part of check-in [70b48a7972] Begin reengineering the EXPLAIN QUERY PLAN function to provide more intuitive output. (check-in: [70b48a7972] user: drh branch: rework-EQP, size: 88284)
2018-04-24
18:53
[3cb591fe73] part of check-in [ce35e39c5c] 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). (check-in: [ce35e39c5c] user: dan branch: trunk, size: 88303)
14:18
[52225f6b51] part of check-in [45247c7f29] Add a hyperlink to the ticket on the code comment for the fix to ticket [7fa8049685b50b5aeb0c2]. (check-in: [45247c7f29] user: drh branch: trunk, size: 88145)
14:05
[4de722661b] part of check-in [b8ef967ab1] 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]. (check-in: [b8ef967ab1] user: dan branch: trunk, size: 88095)
2018-04-02
00:16
[982b7450c5] part of check-in [b850dd1599] 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. (check-in: [b850dd1599] user: drh branch: trunk, size: 87730)
2018-03-31
23:28
[e75c351bb4] part of check-in [fc06ddd458] Fix a logic error discovered by OSSFuzz that can cause an assert() fault if a LIKE operator is used on an INTEGER PRIMARY KEY. (check-in: [fc06ddd458] user: drh branch: trunk, size: 87747)
2018-03-19
16:59
[051ee5c07e] part of check-in [16c22ff818] Show symbolic SELECT names in EXPLAIN QUERY PLAN output when compiling with SQLITE_ENABLE_SELECTTRACE. (check-in: [16c22ff818] user: drh branch: EQP-improvements, size: 87869)
2018-02-13
18:48
[e1aaadd8fe] part of check-in [f3112e67cd] 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] (check-in: [f3112e67cd] user: drh branch: trunk, size: 87718)
2018-01-23
16:38
[cb360c511f] part of check-in [14dfd96f9b] 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]. (check-in: [14dfd96f9b] user: dan branch: trunk, size: 87369)
2017-12-21
21:41
[af1e79154a] part of check-in [afbbfff720] Fix SQLITE_DBCONFIG_TRIGGER_EQP so that it works even if SQLITE_DEBUG is not defined. (check-in: [afbbfff720] user: drh branch: trunk, size: 87211)
2017-12-13
18:01
[ff2f079097] part of check-in [65754dc3b8] Correctly invalidate a column cache line when it is overwritten with NULL. Fix for ticket [123c9ba32130a6c9d432]. (check-in: [65754dc3b8] user: drh branch: trunk, size: 87189)
2017-11-17
21:01
[611fcabd05] part of check-in [723f1be3d4] 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. (check-in: [723f1be3d4] user: drh branch: trunk, size: 87135)
17:32
[8605c0ca0c] part of check-in [00c3283174] New assert() statements in the rowvalue IN expression processing. (check-in: [00c3283174] user: drh branch: trunk, size: 86273)
2017-10-31
03:40
[4a117dd588] part of check-in [1c80c75d4b] Remove unnecessary NEVER() and ALWAYS() conditionals. (check-in: [1c80c75d4b] user: drh branch: trunk, size: 85231)
2017-09-09
19:41
[e8c2ece584] part of check-in [34c8e95261] Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL constraints. (check-in: [34c8e95261] user: dan branch: vtab-extra-ops, size: 85211)
2017-08-25
19:51
[d246d19f54] part of check-in [1783c54ce9] Fix a few over-length source code lines. No functional changes. (check-in: [1783c54ce9] user: drh branch: trunk, size: 85206)
2017-07-27
20:24
[e7be3b7f4c] part of check-in [f5d330f495] Enhance the like optimization so that it works with an ESCAPE clause. (check-in: [f5d330f495] user: drh branch: trunk, size: 85206)
2017-07-10
16:38
[c0c4c31573] part of check-in [0ca7474f05] Additional debugging Noop-comment in the constraint generator when wheretrace is enabled. (check-in: [0ca7474f05] user: drh branch: defer-where-subqueries, size: 85206)
15:17
[cd923f921c] part of check-in [a4fc98113a] Fix another problem on this branch. (check-in: [a4fc98113a] user: dan branch: defer-where-subqueries, size: 85004)
14:39
[39bddb38a4] part of check-in [7d3cb39f60] Fix a problem causing non-covered WHERE terms to be evaluated before covered WHERE terms. (check-in: [7d3cb39f60] user: dan branch: defer-where-subqueries, size: 84997)
14:33
[3eb2130872] part of check-in [1f9c1f359e] 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. (check-in: [1f9c1f359e] user: dan branch: defer-where-subqueries, size: 84997)
2017-06-24
18:10
[f17f5d51e3] part of check-in [7b59c353b8] Consider the values bound to SQL variables when determining whether or not a partial index may be used. (check-in: [7b59c353b8] user: dan branch: partial-index-variables, size: 84556)
2017-06-02
15:44
[339ee802d9] part of check-in [ab33d299c7] Change the name of the OP_Seek opcode into OP_DeferredSeek for better clarity of function. No functional code changes. (check-in: [ab33d299c7] user: drh branch: trunk, size: 84553)
2017-04-29
14:56
[8ad4886766] part of check-in [91dfb61a1a] Minor size and performance improvements to the push-down optimization. (check-in: [91dfb61a1a] user: drh branch: pushdown-optimization, size: 84533)
2017-04-28
19:59
[878a8c75af] part of check-in [afe68f0a80] 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. (check-in: [afe68f0a80] user: dan branch: pushdown-optimization, size: 84421)
2017-04-11
01:01
[943e32e9dc] part of check-in [c59eaf2b7c] Improved comments. Fix a problem when an indexed expression is used in an ORDER BY clause. (check-in: [c59eaf2b7c] user: drh branch: covering-index-on-expr, size: 83931)
2017-04-07
19:41
[38d171e309] part of check-in [a52ef2ad7c] 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. (check-in: [a52ef2ad7c] user: drh branch: covering-index-on-expr, size: 83369)
2017-02-18
20:05
[373faba5f8] part of check-in [c1adf95958] 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. (check-in: [c1adf95958] user: dan branch: sort-column-opcodes, size: 81474)
2017-02-15
22:36
[677e95413c] part of check-in [58797e9baf] Query planner optimization to detect empty tables in a join early and bail out without doing excess work. (check-in: [58797e9baf] user: drh branch: trunk, size: 81444)
2017-01-28
19:45
[99a8ced164] part of check-in [dc555b1039] Avoid redundant table b-tree cursor seeks in UPDATE statements that use the two-pass strategy. (check-in: [dc555b1039] user: dan branch: trunk, size: 81144)
2016-12-07
20:22
[e04ac8f24c] part of check-in [3954f83798] The use P4_DYNAMIC in place of the P4_MPRINTF operand type. (check-in: [3954f83798] user: drh branch: trunk, size: 81034)
2016-12-06
22:47
[9a3b103419] part of check-in [2a81763e68] Performance improvement and size reduction in the Expr node allocator function sqlite3PExpr(). (check-in: [2a81763e68] user: drh branch: trunk, size: 81034)
2016-11-23
21:01
[e895f34fe8] part of check-in [27438fb43d] 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. (check-in: [27438fb43d] user: drh branch: branch-3.15, size: 80995)
2016-11-17
13:13
[4ea2989984] part of check-in [005d5b8706] 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. (check-in: [005d5b8706] user: drh branch: trunk, size: 81040)
2016-11-09
00:10
[507738d957] part of check-in [89d958abba] Enhance the OP_IdxInsert opcode to optionally accept unpacked key material. (check-in: [89d958abba] user: drh branch: unpacked-IdxInsert, size: 80905)
2016-10-10
13:29
[717a65294d] part of check-in [71797ba431] Make sure indexes on expressions skip over initial NULL values in the index. Fix for ticket [4baa464912129477f3c9] (check-in: [71797ba431] user: drh branch: trunk, size: 80860)
2016-10-05
20:10
[d07f784cda] part of check-in [2dde337512] Fix harmless compiler warnings. (check-in: [2dde337512] user: drh branch: trunk, size: 80832)
2016-10-03
01:21
[81da7e9b1b] part of check-in [ea8affa9e4] Allocate Parse objects off of the stack where appropriate for a substantial performance increase and a size reduction. (check-in: [ea8affa9e4] user: drh branch: trunk, size: 80902)
2016-09-16
16:30
[e412e09aba] part of check-in [a92aee5520] 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]. (check-in: [a92aee5520] user: dan branch: trunk, size: 81022)
15:42
[c23f9b26fb] part of check-in [a49bc0a824] Replace a faulty assert() with a testcase() to assure the condition is tested. Ticket [0eab1ac7591f]. (check-in: [a49bc0a824] user: drh branch: trunk, size: 81045)
2016-09-07
19:37
[d172dcf999] part of check-in [7f2c5c9ee3] Fix a problem handling expressions like "(a, b) IN (SELECT ... ORDER BY 1, 2)" when there is an index on "a" but not "b". (check-in: [7f2c5c9ee3] user: dan branch: rowvalue, size: 81010)
13:30
[43522ac811] part of check-in [bbab9621f5] Simplify the affinity handling logic in codeAllEqualityTerms(). Logically the same, just a little easier to read and understand. (check-in: [bbab9621f5] user: drh branch: rowvalue, size: 80301)
12:20
[019a050e92] part of check-in [2d1983ff9f] Correct affinity computations for a SELECT on the RHS of an IN operator. Fix for ticket [199df4168c]. (check-in: [2d1983ff9f] user: drh branch: branch-3.14, size: 74424)
2016-09-06
17:13
[b0d4febdd9] part of check-in [70319c3d76] Avoid unnecessary memory allocations for aiMap in codeEqualityTerm(). (check-in: [70319c3d76] user: drh branch: rowvalue, size: 80446)
16:53
[4bd3e4c3c9] part of check-in [c6e528c1c0] Avoid a NULL pointer deref in codeAllEqualityConstraints() following an OOM. (check-in: [c6e528c1c0] user: drh branch: rowvalue, size: 80418)
16:33
[ea92c232f9] part of check-in [bd5a342008] Simplify the fix in commit [7d9bd22c]. (check-in: [bd5a342008] user: dan branch: rowvalue, size: 80407)
15:25
[49125c4db8] part of check-in [b7e710e406] Fix the header comment on codeEqualityTerm(). (check-in: [b7e710e406] user: drh branch: rowvalue, size: 80219)
14:58
[7279bb68e2] part of check-in [231c72d9f6] Fix a problem handling (a, b) IN (SELECT ...) expressions when there is an index on just one of "a" or "b". (check-in: [231c72d9f6] user: dan branch: rowvalue, size: 79912)
2016-09-03
15:31
[8a9a53cb52] part of check-in [f5e4985541] Consider the affinity of "b" when using an "a IN (SELECT b ...)" expression with an index on "a". Fix for [199df416]. (check-in: [f5e4985541] user: dan branch: rowvalue, size: 79556)
2016-08-26
18:17
[ee7b5353ff] part of check-in [87d40195ae] Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS() macros on unreachable branches. (check-in: [87d40195ae] user: drh branch: rowvalue, size: 79278)
17:54
[71de4d2d36] part of check-in [b34413ac7e] Fix a problem with affinity changes and vector range comparisons. (check-in: [b34413ac7e] user: dan branch: rowvalue, size: 79169)
2016-08-24
12:22
[5a5528c39b] part of check-in [f41a0391b7] Fix a buffer overrun in the code for handling IN(...) operators when the LHS of the operator contains indexed columns or expressions. (check-in: [f41a0391b7] user: dan branch: rowvalue, size: 78538)
00:51
[0c99e2e97c] part of check-in [1e3bc3698a] The previous OOM fix was bad. Back it out and replace it with a better one. (check-in: [1e3bc3698a] user: drh branch: rowvalue, size: 78528)
2016-08-20
00:07
[0c790c422e] part of check-in [d8feea7dcd] 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. (check-in: [d8feea7dcd] user: drh branch: rowvalue, size: 78465)
2016-08-19
18:28
[f3fd16b9b4] part of check-in [d07be5afb0] Fix an obsolete comment on codeEqualityTerm(). No changes to code. (check-in: [d07be5afb0] user: drh branch: rowvalue, size: 79503)
2016-08-18
19:04
[916b451003] part of check-in [936146b12e] Fix a SQL NULL handling bug in the vector IN operator code generation. (check-in: [936146b12e] user: drh branch: rowvalue, size: 79517)
2016-08-08
20:15
[92202261a6] part of check-in [156a41f30a] Fix some cases involving row values and virtual tables. (check-in: [156a41f30a] user: dan branch: rowvalue, size: 79494)
18:42
[c24645572e] part of check-in [bb60651163] Fix the EXPLAIN QUERY PLAN output for row value range constaints that use an index. (check-in: [bb60651163] user: dan branch: rowvalue, size: 79319)
2016-08-02
17:45
[c2392fa30b] part of check-in [339f85f414] Fix SQLITE_OMIT_SUBQUERY builds. (check-in: [339f85f414] user: dan branch: rowvalue, size: 78798)
2016-08-01
20:14
[c01c8af931] part of check-in [3ef75d45eb] Fix a problem with vector range constraints involving the rowid column. And other issues. (check-in: [3ef75d45eb] user: dan branch: rowvalue, size: 78717)
2016-07-30
16:39
[6131be0cb1] part of check-in [e9d9c6d46b] Remove the EP_Vector expression flag. (check-in: [e9d9c6d46b] user: dan branch: rowvalue, size: 78306)
2016-07-29
20:58
[e3159b1d6e] part of check-in [42607366bf] Fix some issues with vector range constraints and the column cache. Also vector range constraints and rowid columns. (check-in: [42607366bf] user: dan branch: rowvalue, size: 78283)
18:12
[e259a0b9b0] part of check-in [4dfebff292] Change the way "(a, b) = (SELECT *)" expressions are handled in where.c if there is an index on one of the columns only. (check-in: [4dfebff292] user: dan branch: rowvalue, size: 78024)
2016-07-26
18:15
[3aff768356] part of check-in [d4f3d52c5a] Merge latest trunk changes into this branch. (check-in: [d4f3d52c5a] user: dan branch: rowvalue, size: 77317)
18:06
[03fbaa6390] part of check-in [061b800603] 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. (check-in: [061b800603] user: dan branch: rowvalue, size: 77292)
04:23
[99707d1190] part of check-in [0e9f534fef] Make sure affinity is applied correctly on lower-bound range constraints in the min() optimization. Fix for ticket [a0bac8b3c3d1bb]. (check-in: [0e9f534fef] user: drh branch: apple-osx, size: 74087)
2016-07-23
20:24
[eb0f5e8700] part of check-in [e2fd6f49b1] 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). (check-in: [e2fd6f49b1] user: dan branch: rowvalue, size: 75228)
2016-07-10
19:35
[877ceb19cf] part of check-in [728c5aa436] Merge comment typo fixes from trunk. (check-in: [728c5aa436] user: mistachkin branch: rowvalue, size: 75225)
19:35
[11e38f5e2d] part of check-in [77c692a670] Fix typos in comments. No changes to code. (check-in: [77c692a670] user: mistachkin branch: trunk, size: 74062)
2016-07-09
20:23
[a66c589bdc] part of check-in [b2204215b2] Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch. (check-in: [b2204215b2] user: dan branch: rowvalue, size: 75224)
2016-06-20
17:22
[e20cb381ff] part of check-in [7455d932f5] 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. (check-in: [7455d932f5] user: dan branch: cursor-hints, size: 74061)
2016-06-17
19:27
[c1b11ad094] part of check-in [998095aba0] 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. (check-in: [998095aba0] user: dan branch: cursor-hints, size: 73915)
14:33
[b9d5f7d8eb] part of check-in [2a2346b042] 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. (check-in: [2a2346b042] user: dan branch: cursor-hints, size: 72686)
2016-05-26
20:56
[ba71a4e4ba] part of check-in [ffe80a1bfa] Add a new OP_SeekRowid opcode, that combines the functions of OP_MustBeInt and OP_NotExists. This makes the code slightly smaller and faster. (check-in: [ffe80a1bfa] user: drh branch: trunk, size: 71645)
2016-05-19
18:56
[e3f18fcda2] part of check-in [d01305841d] Clean up the WHERE_* macros used for the wctrlFlags parameter on the sqlite3WhereBegin() interface, freeing up some bits to be used for other things. (check-in: [d01305841d] user: drh branch: trunk, size: 71722)
2016-05-09
19:58
[d227fca7d7] part of check-in [da94a6e0eb] Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. (check-in: [da94a6e0eb] user: drh branch: dev, size: 71852)
2016-05-06
20:23
[23fc19ca54] part of check-in [3a69526318] Simplification to the logic used to decide between OP_Seek and OP_NotExists. Use OP_NotExists for both DELETE and UPDATE. (check-in: [3a69526318] user: drh branch: trunk, size: 71896)
16:06
[6e2da2449d] part of check-in [150dd09ebd] 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. (check-in: [150dd09ebd] user: drh branch: ticket-16c9801ce, size: 71942)
2016-05-02
10:25
[28951741be] part of check-in [54c63b3292] Improvements to the way the LIKE optimization is implemented, resulting in slightly smaller and faster code that is easier to test. (check-in: [54c63b3292] user: drh branch: trunk, size: 71825)
2016-04-09
18:04
[8fdad9fbba] part of check-in [6c56b3a047] Fix a problem in the code generator for joins on virtual tables where the outer loop of the join uses the IN operator. (check-in: [6c56b3a047] user: drh branch: trunk, size: 71090)
2016-03-08
01:11
[863aedf086] part of check-in [721ae51e44] Add a NEVER() to the code generator. Change the parameter name "mExtra" to "mPrereq" in the query planner, to more closely reflect its meaning. (check-in: [721ae51e44] user: drh branch: trunk, size: 70782)
00:39
[36ea3526e4] part of check-in [9805f6f852] Changes so that some assert()s in the virtual table query planner are correct even following an OOM error. (check-in: [9805f6f852] user: drh branch: trunk, size: 70775)
2016-03-07
19:08
[870f3e9260] part of check-in [c924008692] Avoid a NULL pointer dereference following an OOM while generating code for IN operators on virtual tables. (check-in: [c924008692] user: drh branch: trunk, size: 70781)
2016-03-02
03:28
[3ca820435c] part of check-in [1622623cbb] Allow the left-hand side of IN operators on virtual tables to have the aConstraintUsage[].omit flag clear. (check-in: [1622623cbb] user: drh branch: vtab-IN-opt, size: 70754)
2016-02-22
21:19
[39c1ef4598] part of check-in [a3dcf6db76] Clearer presentation of the logic. No functional changes. (check-in: [a3dcf6db76] user: drh branch: skip-scan-improvement, size: 69016)
20:52
[19aa0189a6] part of check-in [38e837e605] Avoid an unnecessary seek operation on some corner-case skip-scans. (check-in: [38e837e605] user: drh branch: skip-scan-improvement, size: 68817)
2016-02-04
11:48
[791a784bbf] part of check-in [b787165b25] Remove unnecessary sets of db->mallocFailed. (check-in: [b787165b25] user: drh branch: trunk, size: 68732)
02:34
[f5229eb1fc] part of check-in [1c8d300189] Add and use the sqlite3VdbeZeroRegister() interface for coding the common operation of writing zero into a register. (check-in: [1c8d300189] user: drh branch: zero-register, size: 68718)
2016-02-01
13:58
[923f5d04b3] part of check-in [a17712bf8d] 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. (check-in: [a17712bf8d] user: dan branch: trunk, size: 68736)
2016-01-30
16:59
[7ea737b14e] part of check-in [9bec50a1e7] 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. (check-in: [9bec50a1e7] user: drh branch: trunk, size: 68725)
12:50
[ef0d701902] part of check-in [0bdb41c45a] 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. (check-in: [0bdb41c45a] user: drh branch: trunk, size: 68812)
00:45
[3c4757ae85] part of check-in [6c520d5726] Change the P4_INTARRAY so that always begins with a length integer. Print the content of the INTARRAY on EXPLAIN output. (check-in: [6c520d5726] user: drh branch: covering-or, size: 68836)
2016-01-29
19:29
[1b2a96c425] part of check-in [a323ac3a9d] Experimental attempt to make better use of covering indexes within OR queries. (check-in: [a323ac3a9d] user: dan branch: covering-or, size: 68806)
16:57
[22a7fee236] part of check-in [ab94603974] Avoid unnecessary WHERE clause term tests when coding a join where one of the tables contains a OR constraint. (check-in: [ab94603974] user: drh branch: OR-clause-improvement, size: 66909)
2016-01-16
15:12
[8dee26eb18] part of check-in [a4258cd461] Use sqlite3VdbeAddOp4() rather than a separate sqlite3VdbeChangeP4() call, for a slightly smaller and faster binary. (check-in: [a4258cd461] user: drh branch: trunk, size: 66782)
2015-12-01
21:23
[dfbfe198e4] part of check-in [9e1d6d4c39] Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. (check-in: [9e1d6d4c39] user: drh branch: trunk, size: 66811)
2015-11-05
20:25
[b45fe3878b] part of check-in [32e31b9bc8] 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!). (check-in: [32e31b9bc8] user: drh branch: seekeq-experiment, size: 66817)
2015-10-28
20:01
[4c96182e7b] part of check-in [b10ab59fb8] Make the internal sqlite3PExpr() interface responsive to the TKFLG_DONTFOLD flag on the operator parameter. (check-in: [b10ab59fb8] user: drh branch: trunk, size: 66426)
2015-10-16
20:53
[9aa2043685] part of check-in [26fa091d68] Merge recent enhancements from trunk. Version now 3.9.1. (check-in: [26fa091d68] user: drh branch: cursor-hints, size: 66411)
2015-10-15
19:21
[b924b78acd] part of check-in [871e091df6] 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. (check-in: [871e091df6] user: drh branch: trunk, size: 60797)
2015-10-14
20:09
[4d60b2e8a8] part of check-in [2944414934] Merge in all the 3.9.0 updates from trunk. (check-in: [2944414934] user: drh branch: cursor-hints, size: 66548)
2015-10-10
14:41
[cdfff200d0] part of check-in [9ddef84d43] 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. (check-in: [9ddef84d43] user: drh branch: trunk, size: 60934)
2015-09-29
17:20
[a32bf1f304] part of check-in [7d272aa62c] 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. (check-in: [7d272aa62c] user: drh branch: trunk, size: 60883)
10:11
[a87238178f] part of check-in [820c804468] Add tests for fts3 and onepass update/delete operations. Also fix a problem with onepass updates that do not affect any rows. (check-in: [820c804468] user: dan branch: vtab-onepass, size: 60873)
2015-09-24
15:06
[16f0d8b39e] part of check-in [fbe637620f] Merge trunk changes into the cursor-hints branch. (check-in: [fbe637620f] user: drh branch: cursor-hints, size: 66458)
2015-09-19
18:08
[7660e1ad16] part of check-in [5c31ee62a1] Fix compiler warnings. (check-in: [5c31ee62a1] user: drh branch: trunk, size: 60844)
2015-09-18
18:09
[5b534714fe] part of check-in [25f34cb9b5] Fix a crash that can occur with a skip-scan on an index with expressions when SQLITE_ENABLE_EXPLAIN_COMMENTS is defined. (check-in: [25f34cb9b5] user: drh branch: trunk, size: 60870)
2015-09-15
17:31
[c80f4c7866] part of check-in [66fe068326] Merge enhancements from trunk. (check-in: [66fe068326] user: drh branch: cursor-hints, size: 66491)
2015-09-14
14:45
[186b493599] part of check-in [16e56bdade] Use symbolic names ONEPASS_OFF, ONEPASS_SINGLE, and ONEPASS_MULTI for the various modes of the one-pass optimization. (check-in: [16e56bdade] user: drh branch: trunk, size: 60877)
14:08
[91c5003692] part of check-in [2edd2e5edd] Fix a compiler warning and providing missing VdbeCoverage() calls. (check-in: [2edd2e5edd] user: drh branch: trunk, size: 60865)
09:23
[780cccf12a] part of check-in [166d5af891] Avoid calling sqlite3VdbeCursorMoveto() from more than one point in vdbe.c. Doing so prevents it from being inlined as part of OP_Column. (check-in: [166d5af891] user: dan branch: onepass-delete, size: 60840)
2015-09-03
14:39
[93fa794fcd] part of check-in [25ee3000e9] Merge enhancements from trunk. (check-in: [25ee3000e9] user: drh branch: cursor-hints, size: 66180)
14:18
[6ac8599523] part of check-in [1ab10cbf27] Merge enhancements from trunk. (check-in: [1ab10cbf27] user: drh branch: index-expr, size: 60722)
13:46
[c0d9b1c7c7] part of check-in [847387ec8e] Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). (check-in: [847387ec8e] user: drh branch: trunk, size: 60566)
2015-09-02
18:19
[e215fc0223] part of check-in [be78f413df] Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). (check-in: [be78f413df] user: drh branch: trunk, size: 60569)
16:51
[713306be19] part of check-in [d1592d201a] Small simplification to the EXPLAIN QUERY PLAN logic. (check-in: [d1592d201a] user: drh branch: trunk, size: 60580)
15:37
[f749795d05] part of check-in [82355e4108] Use sqlite3XPrintf() instead of sqlite3StrAccumAppend() in a few places for better performance and a smaller footprint. (check-in: [82355e4108] user: drh branch: trunk, size: 60643)
2015-09-01
18:31
[a9b88cb297] part of check-in [29570a6048] Merge enhancements from trunk. (check-in: [29570a6048] user: drh branch: cursor-hints, size: 66313)
2015-08-27
20:33
[b0bf45ca49] part of check-in [73d361ce9e] Fix EXPLAIN QUERY PLAN output for indexed-expressions. Fix another obscure fault in the WHERE term scanner. (check-in: [73d361ce9e] user: drh branch: index-expr, size: 60855)
2015-08-25
19:20
[3d9113cc30] part of check-in [1ee089a72d] Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the affinity of an index column. (check-in: [1ee089a72d] user: drh branch: trunk, size: 60699)
2015-08-20
23:45
[3be7fd91b3] part of check-in [b9927c876c] Merge recent enhancements from trunk, including table-valued expressions. (check-in: [b9927c876c] user: drh branch: cursor-hints, size: 66306)
2015-08-19
15:20
[69f19535a6] part of check-in [b919376147] 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. (check-in: [b919376147] user: drh branch: table-valued-functions, size: 60692)
2015-08-18
15:58
[ec90321e51] part of check-in [b5897bc0f0] 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. (check-in: [b5897bc0f0] user: drh branch: cursor-hints, size: 66297)
2015-08-17
17:19
[148c5dc225] part of check-in [142b048ac7] Avoid generating hints using constraints that are also used to initialize the cursor, since presumably the cursor already knows about those constraints. (check-in: [142b048ac7] user: drh branch: cursor-hints, size: 66259)
2015-08-14
18:50
[16045545fb] part of check-in [581e3d4988] Fix the cursor hint mechanism so that it does the right thing for indexed lookups. (check-in: [581e3d4988] user: drh branch: cursor-hints, size: 65524)
15:05
[3180ac6422] part of check-in [fc3fb5cd0d] Refactor the sqlite3BtreeCursorHint() interface for improved maintainability. (check-in: [fc3fb5cd0d] user: drh branch: cursor-hints, size: 63583)
01:03
[28d8383482] part of check-in [f0d428d13a] Fix the CursorHint so that it includes the scan boundary constraints. On the expression text for the CursorHint opcode, show rowid correctly. (check-in: [f0d428d13a] user: drh branch: cursor-hints, size: 63634)
2015-08-13
20:07
[00a5d75121] part of check-in [82a7a61bc0] Merge in all the trunk changes from the previous year. This breaks the cursor-hint mechanism, but provides a baseline for trouble-shooting. (check-in: [82a7a61bc0] user: drh branch: cursor-hints, size: 63737)
2015-07-23
16:39
[5da5049224] part of check-in [793e206f90] 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]. (check-in: [793e206f90] user: drh branch: trunk, size: 60683)
2015-06-08
22:59
[3f3152ecf4] part of check-in [cabf218716] 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. (check-in: [cabf218716] user: drh branch: view-optimization, size: 60547)
2015-06-06
20:12
Added: [0669481cab] part of check-in [faa0e420e9] 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. (check-in: [faa0e420e9] user: drh branch: view-optimization, size: 60544)