SQLite

All files named ”src/whereInt.h”
Login

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

History for src/whereInt.h

2025-06-30
20:19
[8d94cb116c] part of check-in [6fc0b9ac23] Compute WhereLevel.addrBrk and .addrHalt early so that those labels can be used to abort loops early. Use this to improve performance on two more of the cases described by forum post 52651713ac. (check-in: [6fc0b9ac23] user: drh branch: empty-table-optimizations, size: 31489)
2025-06-16
16:07
[02b646ea41] part of check-in [94b53c20e9] Improved debugging output for the transitive constraint optimization. (check-in: [94b53c20e9] user: drh branch: trunk, size: 31413)
2025-06-07
16:45
[b0c5487551] 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: 31387)
2025-03-15
18:26
[ecdbfb5551] part of check-in [8a91aeca60] Fix alignment problems on Linux with -m32 and on Mac PPC. (check-in: [8a91aeca60] user: drh branch: flex-array, size: 31310)
2025-03-14
18:10
[8373791e8d] 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: 31304)
2025-01-26
17:29
[d20cddddb1] part of check-in [a7ecb2f4b7] Small size and complexity reduction on the star-query heuristic. Improved comments for the star-query heuristic. (check-in: [a7ecb2f4b7] user: drh branch: trunk, size: 31155)
2025-01-25
23:04
[510b12f85a] part of check-in [1bc09c9e8b] Revise the strategy used by the star-query heuristic: Instead of decreasing the cost of all fact-table WhereLoops, increase the run-cost of WhereLoops that are SCANs of dimension tables. (check-in: [1bc09c9e8b] user: drh branch: trunk, size: 31125)
2025-01-24
15:55
[3b2ef46177] part of check-in [61f76a45ac] Minor tweaks to the star-query detection and processing. (check-in: [61f76a45ac] user: drh branch: star-query-heuristic, size: 31128)
2025-01-15
19:30
[2b0804f300] part of check-in [dbc2d6a244] Variable names and conditional logic simplified in where.c. These changes are cosmetic only and do not affect the resuling machine code. (check-in: [dbc2d6a244] user: drh branch: trunk, size: 30956)
2024-10-11
20:36
[1e36ec5039] 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: 30956)
2024-08-22
16:22
[a5d079c346] 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: 30582)
2024-08-15
23:38
[6444b888ce] part of check-in [2fbb4dc232] If a subquery is materialized due to an ORDER BY and that ordering is useful in helping to satisfy the ORDER BY or GROUP BY in the order query without doing an extra sort, then omit the extra sort. (check-in: [2fbb4dc232] user: drh branch: order-by-subquery, size: 30506)
2024-05-29
10:40
[002adc3aa2] part of check-in [21daf2463e] Remember the amount of the heuristic cost adjustment associated with star schemas and compensate when computing whether or not to use Bloom filters. (check-in: [21daf2463e] user: drh branch: star-schema, size: 30344)
00:38
[aff769fab5] part of check-in [a98be0f548] Use a heuristic in the query planner to help it better cope with large star schema queries. (check-in: [a98be0f548] user: drh branch: star-schema, size: 30198)
2023-12-22
21:22
[82a13766f1] part of check-in [94c3e1110c] Change parameters on a debugging function to include "const". (check-in: [94c3e1110c] user: drh branch: trunk, size: 30124)
2023-09-15
20:04
[064a1508ed] part of check-in [796a65fa61] Drop support for the view-scan optimization as it was causing multiple performance regressions. In its place, reduce the estimated row count for DISTINCT subsqueries by a factor of 8. (check-in: [796a65fa61] user: drh branch: branch-3.28, size: 27487)
14:06
[4b38c58895] part of check-in [d9625a9eaf] The view-scan optimization was added to enhance the performance of one specific query, but it causes performance regressions on a host of others. Disable it (at least temporarily) in order to try to find an alternative way of fixing the one specific query that it was created to fix - an alternative way that does not cause performance problems for other unrelated queries. (check-in: [d9625a9eaf] user: drh branch: rethink-viewscan, size: 30112)
2023-06-07
08:40
[c7d1990286] 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: 30126)
2022-11-28
15:23
[e25203e5bf] part of check-in [b8eec42143] Rework the covering index checking routine, whereIsCoveringIndex(), so that it can return a "maybe" result for aggregate queries where we are not exactly sure. The index is scored as if it is covering, but the main table is still opened. (check-in: [b8eec42143] user: drh branch: covering-indexed-expr, size: 30129)
2022-10-24
13:50
[752a870900] 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: 27501)
2022-10-22
14:16
[df0c79388c] 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: 30055)
2022-10-20
13:36
[e5f5cf1bc3] 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: 30096)
2022-10-19
11:58
[89a0ae1af6] part of check-in [e3648a07f5] Fix references to "SrcList_item" in comments as that object has since [bfd5bf2c73110fcb] (2021-02-21) been called "SrcItem". Comment changes only. No changes to code. (check-in: [e3648a07f5] user: drh branch: trunk, size: 30677)
2022-09-01
10:41
[ffebbbad93] part of check-in [e3754cc188] In the query planner, add a heuristic that will reduce the cost of a full table scan for a materialized view or subquery if the full scan is the outer-most loop. This is shown to speed up some queries. (check-in: [e3754cc188] user: drh branch: branch-3.28, size: 27422)
10:29
[70cd30de9e] part of check-in [609fbb94b8] In the query planner, add a heuristic that will reduce the estimated cost of a full table scan for a materialized view or subquery if the full scan is the outer-most loop. This is shown to speed up some queries. (check-in: [609fbb94b8] user: drh branch: trunk, size: 30682)
2022-06-01
13:32
[b48ca529ff] 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: 30603)
2022-05-10
23:28
[8da918f392] part of check-in [764b71267e] Fix a bug in the sqlite3WhereMalloc() routines that were added by chekc-in [f237e1d8cc41b937]. The bug was detected by dbsqlfuzz test case 4c5e3e89bc251d28378be88233f531b84ec66901. (check-in: [764b71267e] user: drh branch: trunk, size: 30549)
2022-04-23
18:04
[4db5a877a9] 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: 30549)
2022-04-17
20:30
[eecce79edc] part of check-in [c90602328a] Change OP_Return such that if P3 is 1, the Return is a no-op when the P1 register contains a NULL. (check-in: [c90602328a] user: drh branch: right-join, size: 30477)
2022-04-12
18:04
[ea1e4b6639] 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: 30550)
2022-04-11
17:27
[cd6bddac3a] part of check-in [b6e773a26c] Fix handling of "continue" and "break" from inside the loop for the right operand of a RIGHT JOIN. (check-in: [b6e773a26c] user: drh branch: right-join, size: 30443)
2022-04-09
12:27
[ecf0d9fe3e] 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: 30370)
03:16
[5cd48fd01b] 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: 29964)
03:06
[41ce0a8c03] 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: 29884)
2022-02-04
13:15
[15d2975c3b] part of check-in [70049342d5] Fix various harmless compiler warnings. (check-in: [70049342d5] user: drh branch: trunk, size: 29367)
13:05
[099c7fa273] 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: 29367)
2022-02-01
14:58
[1d82165723] 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: 29287)
2022-01-27
21:18
[0748a6fce9] 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: 29211)
16:14
[e23780eb06] 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: 29064)
2022-01-22
02:52
[8a215acde0] part of check-in [a13afc909c] Omit the WhereLoopBuilder.pOrderBy field, which is no longer needed. (check-in: [a13afc909c] user: drh branch: sqlite3_vtab_distinct, size: 28894)
2021-12-16
00:36
[ce4fb951e4] part of check-in [da3aae7bcf] Change the query planner so that it excludes virtual table constraints that do not have the correct collation. This breaks the expert extension. (check-in: [da3aae7bcf] user: drh branch: vtab-collation-fix, size: 29015)
2021-12-15
20:48
[91865afa4a] part of check-in [241dc0428a] Simplify the generation of the sqlite3_index_info object during query planning for virtual tables. (check-in: [241dc0428a] user: drh branch: trunk, size: 28944)
2021-12-09
01:28
[e83f7ba73d] 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: 28944)
2021-12-08
19:50
[c2cb535e75] part of check-in [0fb2a4e08f] Improvements on the decision of whether or not to use a Bloom filter. (check-in: [0fb2a4e08f] user: drh branch: bloom-filter, size: 28944)
16:15
[d55d5ce5c9] part of check-in [d325025677] Merge the WhereClause fix from trunk (check-in: [d325025677] user: drh branch: bloom-filter, size: 28865)
16:07
[14ebb040ac] 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: 28485)
2021-12-05
20:19
[5c6601d6d0] part of check-in [06f6fefd67] Run as many Bloom filters as possible before index lookups. (check-in: [06f6fefd67] user: drh branch: bloom-filter, size: 28787)
00:45
[3c634e184d] 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: 28590)
2021-12-04
13:43
[2c9d149b1b] part of check-in [28161fba9b] First attempt to use Bloom filters to optimize star-schema queries. (check-in: [28161fba9b] user: drh branch: bloom-filter, size: 28525)
2021-12-03
16:02
[83ae6f7d0f] part of check-in [11d97fb8be] Merge recent trunk enhancements into the bloom-filter branch. (check-in: [11d97fb8be] user: drh branch: bloom-filter, size: 28450)
2021-12-02
04:00
[1630d94185] part of check-in [7edec54ab0] Small performance optimization in sqlite3WhereGetMask(). (check-in: [7edec54ab0] user: drh branch: trunk, size: 28407)
2021-12-01
16:31
[23f990791d] part of check-in [50ac4de1d7] Add a Bloom filter to the automatic-index mechanism. (check-in: [50ac4de1d7] user: drh branch: bloom-filter, size: 28530)
2021-10-14
19:28
[83877a75a1] 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: 28487)
2021-05-04
23:21
[9248161dd0] 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: 28487)
16:51
[e2c7d2e934] part of check-in [9280e3d994] Additional debugging output for whereScanNext() showing equivalence classes when the ".wheretrace" setting contains the 0x20000 bit. (check-in: [9280e3d994] user: drh branch: trunk, size: 28413)
2021-02-21
21:04
[446e5e8018] 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: 28385)
2021-01-21
17:54
[ae03b5e3a4] part of check-in [fc98218cf6] Always enable the IS NOT NULL optimization, even if STAT4 is not enabled. (check-in: [fc98218cf6] user: drh branch: isnotnull-opt, size: 28397)
2020-12-04
01:17
[9a3f577619] part of check-in [d36d6f2923] Alternative implementation of ".selecttrace" and ".wheretrace" that uses a test-control rather than global variables. (check-in: [d36d6f2923] user: drh branch: traceflags-test-control, size: 28502)
2020-09-30
18:22
[bcbba483d0] 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: 27343)
2020-09-28
19:51
[59077fbd0b] 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: 28860)
15:49
[db7472b6eb] 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: 28785)
2020-08-17
21:03
[7bf2fc8f03] 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: 27268)
2020-08-14
17:39
[eb8c2847fb] part of check-in [2f7cb6ab39] Experimental change to try to get some DELETE operations to access values using the index rather than the main table, so as to avoid unnecessary main table seeks. (check-in: [2f7cb6ab39] user: drh branch: delete-bytecode-optimization, size: 28698)
2020-07-29
16:18
[c6b5cb9dc0] 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: 28634)
2020-02-24
16:46
[6b874aa15f] part of check-in [4558163b6a] Rework this changes so that instead of setting the WhereTerm.truthProb when a term is seen to be of low selectivity, it merely sets a new flag (the TERM_HIGHTRUTH flag) which causes whereLoopOutputAdjust() to ignore that term. (check-in: [4558163b6a] user: drh branch: stat4-truthprob, size: 28633)
2020-02-22
16:58
[94e3aadcf4] part of check-in [1babd6ec5d] When stat4 information is available, try to use it to improve the truth probability of WHERE clause terms that do not participate in the index. (check-in: [1babd6ec5d] user: drh branch: stat4-truthprob, size: 28471)
2020-01-16
11:51
[9157228db0] part of check-in [af06f80a59] Clean up the definitions of the TERM_ constants in the code generator. Formatting only - no logic changes. (check-in: [af06f80a59] user: drh branch: trunk, size: 28253)
2020-01-04
19:12
[e1d1db6bbe] part of check-in [8452fe0343] Fix harmless compiler warnings. (check-in: [8452fe0343] user: drh branch: trunk, size: 28253)
2020-01-02
00:45
[d2b7713350] 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: 28241)
2019-12-29
00:52
[a727b32260] 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: 27630)
2019-12-28
13:39
[de1b77e416] part of check-in [85e7688776] Expose some of the Where data structure debug printing routines to the entire WHERE-clause processing module. (check-in: [85e7688776] user: drh branch: trunk, size: 27575)
2019-09-03
14:27
[2c6bae136a] part of check-in [5351e920f4] When we play games with COLLATE in order to commute an operator in the WHERE clause processing, be sure not to use the commuted operator to qualify a partial index, as insufficient COLLATE information is preserved to verify that the expression will correctly qualify the index. Ticket [767a8cbc6d20bd68] (check-in: [5351e920f4] user: drh branch: trunk, size: 27533)
2019-08-23
13:32
[4a296fd4fa] 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: 27458)
13:08
[cce97c33db] 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: 27458)
2019-08-16
21:07
[807766a6a9] 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: 27432)
2019-08-08
15:24
[2082fc2bd1] part of check-in [1e17ea2fd1] Remove support for STAT3. The sqlite_stat3 tables are ignored, if they exist. STAT4 continues to work as it always has, and as it is a superset of STAT3 is the recommended replacement. (check-in: [1e17ea2fd1] user: drh branch: omit-stat3, size: 27312)
2019-08-03
16:37
[2bb9632f90] 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: 27330)
2019-07-29
14:42
[6fab4b6f7e] part of check-in [b47169319a] When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c]. (check-in: [b47169319a] user: dan branch: tkt-6749cb3c, size: 27251)
2019-05-10
16:16
[1b728f7165] part of check-in [ca068d8238] Fix some harmless compiler warnings. (check-in: [ca068d8238] user: mistachkin branch: warnings, size: 27242)
2019-04-26
17:20
[50e1ddaae2] part of check-in [1b25fa108a] An experimental interface for retrieving the estimated cost and estimated number of output rows for a query. (check-in: [1b25fa108a] user: drh branch: cost-est, size: 27215)
2018-12-25
00:15
[5f14db426c] 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: 27148)
2018-09-24
12:37
[f125f29fca] part of check-in [903e501894] Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the code. (check-in: [903e501894] user: drh branch: trunk, size: 26981)
2018-09-21
18:43
[2c4d99faf7] part of check-in [8690b5a0cc] Put a limit counter on the query planner that restricts the number of index+constraint options that can be considered for each table in a join. This prevents certain pathological queries from taking up too much time in the query planner. (check-in: [8690b5a0cc] user: drh branch: trunk, size: 26078)
2018-06-09
02:49
[b90ef9b970] part of check-in [fd09341390] Performance improvement to sqlite3WhereExprUsage(). (check-in: [fd09341390] user: drh branch: trunk, size: 26029)
00:09
[09dbf69274] part of check-in [292724ffc4] Avoid invoking the whereLoopAddOr() routine in the query planner if there are no OR operators in the WHERE clause, thus speeding up query planning slightly. (check-in: [292724ffc4] user: drh branch: trunk, size: 25974)
2018-06-07
14:59
[b09753e74b] 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: 25906)
2018-05-30
00:54
[b6ab96d9c1] 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: 25833)
2018-05-07
11:37
[cbae2bcd37] 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: 25684)
2018-04-05
12:02
[2610cb87dd] part of check-in [813224363d] Fix the sqlite3WhereTrace mechanism so that it compiles with the --disable-amalgamation and the --enable-debug options to ./configure using clang. (check-in: [813224363d] user: drh branch: trunk, size: 25837)
2017-09-11
19:47
[82c04c5075] part of check-in [0fb992af66] Refactor names of constants and functions associated with the auxiliary operators for xBestIndex. (check-in: [0fb992af66] user: drh branch: vtab-extra-ops, size: 25830)
2017-07-10
15:17
[93bb90b77d] part of check-in [a4fc98113a] Fix another problem on this branch. (check-in: [a4fc98113a] user: dan branch: defer-where-subqueries, size: 25834)
2017-04-13
21:29
[2a4b634d63] part of check-in [ce1e2b8877] Fix the skip-ahead-distinct optimization so that it works with indexes that have repeated columns with different collating sequences. (check-in: [ce1e2b8877] user: drh branch: skip-ahead-distinct, size: 25684)
2017-04-07
19:41
[7a21ef633e] 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: 25618)
2017-02-17
15:26
[2d50c2b74a] part of check-in [fb2b8ae831] Set the TF_StatsUsed flag on tables when the query planner outcome is affected by the sqlite_stat1 data. Also, change the column names of the "PRAGMA stats" command so that they are not keywords. (check-in: [fb2b8ae831] user: drh branch: auto-analyze, size: 25558)
2017-02-16
20:52
[c0b092180f] part of check-in [9fc5cd505f] Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now used for more than just DISTINCT processing. (check-in: [9fc5cd505f] user: drh branch: trunk, size: 25316)
2016-10-03
14:44
[2bcc3d176e] part of check-in [5bb7cde073] Avoid unnecessary memset() calls in the query optimizer. (check-in: [5bb7cde073] user: drh branch: trunk, size: 25323)
2016-09-14
01:43
[1d1fd0b3b9] part of check-in [db3614825f] Backport the ORDER BY LIMIT optimization to version 3.8.9. (check-in: [db3614825f] user: drh branch: branch-3.8.9, size: 22123)
2016-07-26
18:06
[14dd243e13] 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: 25323)
2016-07-09
20:23
[1ad3be2a43] 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: 25252)
2016-05-27
12:30
[e5b939701a] part of check-in [71087c12bc] Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and show more details on WhereTerm traces. (check-in: [71087c12bc] user: drh branch: trunk, size: 25144)
2016-05-19
22:13
[6e18240be4] part of check-in [852d1eda6e] In a query with both ORDER BY and LIMIT, if the inner loop satisfies the ORDER BY then try to cut short each invocation of the inner loop once the LIMIT has been satisfied. This check-in is a partial implementation only. (check-in: [852d1eda6e] user: drh branch: orderby-limit, size: 25063)
2016-05-02
10:25
[3b1fc240e3] 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: 24991)
2016-04-14
16:40
[7de94b751f] part of check-in [7b7a69d098] Add the SF_HasAgg constant (currently unused). Also enhance the comments on many other constant definitions to detail constraints on their values. (check-in: [7b7a69d098] user: drh branch: trunk, size: 24981)
13:35
[43466b1078] part of check-in [5317961411] Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. (check-in: [5317961411] user: drh branch: trunk, size: 24677)
2016-02-25
16:04
[93297d56ed] part of check-in [d491745cab] Take the LIMIT clause into account when estimating the cost of sorting. (check-in: [d491745cab] user: drh branch: planner-improvements, size: 24685)
2015-12-30
16:51
[78b6b4de94] part of check-in [2081d75767] Changes to the way that the default BINARY collating sequence is recorded result in a slightly smaller and slightly faster executable. More work could be done to make this cleaner. (check-in: [2081d75767] user: drh branch: trunk, size: 24611)
2015-12-01
21:23
[e20801d89e] part of check-in [9e1d6d4c39] Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. (check-in: [9e1d6d4c39] user: drh branch: trunk, size: 24611)
2015-11-23
21:09
[6afc0d70cf] part of check-in [277a5b4027] Add experimental support for LIKE, GLOB and REGEXP to the virtual table interface. (check-in: [277a5b4027] user: dan branch: vtab-like-operator, size: 24565)
2015-10-22
20:54
[87b0b66cf0] part of check-in [cdc92919e6] Modifications to pass a flag to internal routine sqlite3BtreeCursor() when a cursor that is used solely for deleting b-tree entries, or for obtaining the components of keys to delete from other b-trees, is opened. (check-in: [cdc92919e6] user: dan branch: btree-fordelete-flag, size: 24566)
2015-09-28
23:45
[d7337103c9] part of check-in [70ec88b299] Avoid unnecessary cursors and seeking when running a DELETE against a WITHOUT ROWID table. (check-in: [70ec88b299] user: drh branch: delete-without-rowid-opt, size: 24569)
2015-09-14
14:45
[7892bb54cf] 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: 24492)
2015-08-27
18:24
[292d3ac90d] part of check-in [42f93f582e] Activate the ability to use expressions in indexes in a query. There are some test failures, but mostly this seems to work. (check-in: [42f93f582e] user: drh branch: index-expr, size: 24504)
2015-08-26
21:08
[901c17c1e3] part of check-in [cbc3c9a8bf] Reduce the size of the WhereScan object by 24 bytes while also clarifying its operation. (check-in: [cbc3c9a8bf] user: drh branch: trunk, size: 24436)
2015-08-19
17:11
[880a859922] part of check-in [40e12cfe4c] A list of arguments following a table name translates into equality constraints against hidden columns in that table. (check-in: [40e12cfe4c] user: drh branch: table-valued-functions, size: 24368)
2015-06-08
14:23
[5f87e3c4b0] part of check-in [46ef95c108] Split more subfunctions of where.c out into a new whereexpr.c source file, for improved maintainability. (check-in: [46ef95c108] user: drh branch: view-optimization, size: 24294)
2015-06-06
20:12
[40e1d060b6] 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: 23852)
2015-05-14
01:05
[a6f5a762bc] part of check-in [4541688b3f] A new implementation of indexing with the IS operator that works correctly when the IS operator is in the WHERE clause and the operands are from opposite sides of a LEFT JOIN. (check-in: [4541688b3f] user: drh branch: index-is-operator, size: 22146)
2015-05-13
19:33
[31d30e8362] part of check-in [95b1f9bf14] Simplified implementation of indexing with the IS operator. (check-in: [95b1f9bf14] user: drh branch: index-is-operator, size: 22162)
15:24
[6b5a8ac7b4] part of check-in [6f7f1673d0] An early attempt to get indexes to work with the IS operator. This code passes tests, but much more testing is needed to verify that it works on all corner cases. (check-in: [6f7f1673d0] user: drh branch: index-is-operator, size: 22121)
2015-03-25
15:23
[1fca2f8c64] part of check-in [4e8796af7d] Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns. (check-in: [4e8796af7d] user: dan branch: ota-update, size: 22165)
2015-03-18
20:03
[c1fd5690f9] part of check-in [52e73eeca0] Allow whereShortCut() to use the PRIMARY KEY index of a WITHOUT ROWID table to optimize a vector of "IS" operators in a WHERE clause. (check-in: [52e73eeca0] user: dan branch: ota-update, size: 22097)
2015-03-06
19:47
[cbe4aa5732] part of check-in [a58aafdb4e] Fix the LIKE optimization even when comparing mixed-case BLOBs. (check-in: [a58aafdb4e] user: drh branch: like-opt-fix, size: 22045)
16:45
[0ba6257f2a] part of check-in [5757e803cb] The LIKE optimization must be applied twice, once for strings and a second time for BLOBs. Ticket [05f43be8fdda9f]. This check-in is a proof-of-concept of how that might be done. (check-in: [5757e803cb] user: drh branch: like-opt-fix, size: 21895)
2014-11-03
11:25
[d3633e9b59] part of check-in [f5313e0c68] Remove unused variable from struct WhereInfo. Add some explanatory comments to new code. (check-in: [f5313e0c68] user: dan branch: scanstatus, size: 21699)
2014-11-01
20:38
[a2bc22f4e3] part of check-in [9ea37422a8] If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand. (check-in: [9ea37422a8] user: dan branch: scanstatus, size: 21780)
18:08
[99d324a8f9] part of check-in [8d8cc9608d] Minor fixes and documentation improvements for sqlite3_stmt_scanstatus(). (check-in: [8d8cc9608d] user: dan branch: scanstatus, size: 21674)
2014-10-25
12:28
[19279cd066] part of check-in [b9ad601eab] Do not use virtual (and hence redundant) WHERE-clause terms to restrict the content of a automatic partial index. Show when an automatic partial index is used in the EXPLAIN QUERY PLAN output. (check-in: [b9ad601eab] user: drh branch: trunk, size: 21593)
2014-10-21
01:05
[4b459cdbfc] part of check-in [f4b22a2620] If a skip-scan is a proper subset of some other scan, then adjust the cost of the skip-scan upward so that it is more costly than the other scan. Such a cost imbalance can arise under STAT4 because of difficulties in getting an accurate estimate for skip-scans. (check-in: [f4b22a2620] user: drh branch: trunk, size: 21517)
2014-09-06
16:39
[124d970450] part of check-in [e62aab5e92] Fix typos in comments. No code changes. (check-in: [e62aab5e92] user: peter.d.reid branch: trunk, size: 21530)
2014-08-08
16:52
[923820bee9] part of check-in [299b957027] Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the problem addressed by [2af630c572]. (check-in: [299b957027] user: dan branch: query-planner-fix, size: 21531)
2014-04-25
20:22
[6804c2e501] part of check-in [c51efaa5d2] If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop. (check-in: [c51efaa5d2] user: dan branch: experimental-costs, size: 21532)
2014-04-21
13:21
[929c1349b5] part of check-in [de9a490f59] Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0]. (check-in: [de9a490f59] user: dan branch: trunk, size: 21454)
2014-03-18
20:33
[2564055b44] part of check-in [e258df236b] Make the partial-ORDER-BY information in the query planner available to the SELECT code generator. Still doesn't make a difference in the generated code. (check-in: [e258df236b] user: drh branch: orderby-planning, size: 21379)
15:30
[daa3cdf9f5] part of check-in [b150902579] Experiments with the optimization of ORDER BY and GROUP BY clauses. (check-in: [b150902579] user: drh branch: orderby-planning, size: 21363)
2014-01-28
00:49
[921f935af8] part of check-in [a2c347faf9] Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. (check-in: [a2c347faf9] user: drh branch: branch-3.8.2, size: 21419)
2013-11-13
16:58
[96a75c61f1] part of check-in [5e75ab9388] Improve the way that skip-scan loops are constructued. Add test cases. Improved the scoring of skip-scan loops. (check-in: [5e75ab9388] user: drh branch: skip-scan, size: 21336)
12:27
[a0e8fa5364] part of check-in [27dd5993d1] Add the ability to use an index even if the left-most columns of the index are unconstrainted, provided that the left-most columns have few distinct values. (check-in: [27dd5993d1] user: drh branch: skip-scan, size: 21540)
2013-11-12
20:18
[63c8345d01] part of check-in [0d1328e33c] Minor enhancements to the auxiliary information added to EXPLAIN output with SQLITE_EXPLAIN_ENABLE_COMMENTS. (check-in: [0d1328e33c] user: drh branch: trunk, size: 21190)
18:37
Added: [fda11df00f] part of check-in [c444671246] Break out the structure and macro definitions of where.c into a separate header file whereInt.h for easier editing and debugging. (check-in: [c444671246] user: drh branch: trunk, size: 21115)