/ History for src/whereInt.h
Login

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

History for src/whereInt.h

2020-02-24
16:46
[6b874aa1] part of check-in [4558163b] 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: [4558163b] user: drh branch: stat4-truthprob, size: 28633)
2020-02-22
16:58
[94e3aadc] part of check-in [1babd6ec] 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: [1babd6ec] user: drh branch: stat4-truthprob, size: 28471)
2020-01-16
11:51
[9157228d] part of check-in [af06f80a] Clean up the definitions of the TERM_ constants in the code generator. Formatting only - no logic changes. (check-in: [af06f80a] user: drh branch: trunk, size: 28253)
2020-01-04
19:12
[e1d1db6b] part of check-in [8452fe03] Fix harmless compiler warnings. (check-in: [8452fe03] user: drh branch: trunk, size: 28253)
2020-01-02
00:45
[d2b77133] part of check-in [7bfd42f1] The sqlite3WhereEnd() call now unwinds all Expr modifications made by the sqlite3WhereBegin(). (check-in: [7bfd42f1] user: drh branch: trunk, size: 28241)
2019-12-29
00:52
[a727b322] part of check-in [21ef6e99] 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: [21ef6e99] user: drh branch: trunk, size: 27630)
2019-12-28
13:39
[de1b77e4] part of check-in [85e76887] Expose some of the Where data structure debug printing routines to the entire WHERE-clause processing module. (check-in: [85e76887] user: drh branch: trunk, size: 27575)
2019-09-03
14:27
[2c6bae13] part of check-in [5351e920] 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: [5351e920] user: drh branch: trunk, size: 27533)
2019-08-23
13:32
[4a296fd4] part of check-in [bf875e1a] 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: [bf875e1a] user: drh branch: nulls-last, size: 27458)
13:08
[cce97c33] part of check-in [649b08ea] Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. (check-in: [649b08ea] user: drh branch: nulls-last, size: 27458)
2019-08-16
21:07
[807766a6] part of check-in [81069d71] Add support for using indexes for some ORDER BY clauses that use non-default NULL handling. Still some problems on this branch. (check-in: [81069d71] user: dan branch: nulls-last, size: 27432)
2019-08-08
15:24
[2082fc2b] part of check-in [1e17ea2f] Remove support for STAT3. The sqlite_stat3 tables are ignored, if they exist. STAT4 continues to work as it always has, and as it is a superset of STAT3 is the recommended replacement. (check-in: [1e17ea2f] user: drh branch: omit-stat3, size: 27312)
2019-08-03
16:37
[2bb9632f] part of check-in [d465c3ee] 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: [d465c3ee] user: dan branch: trunk, size: 27330)
2019-07-29
14:42
[6fab4b6f] part of check-in [b4716931] 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: [b4716931] user: dan branch: tkt-6749cb3c, size: 27251)
2019-05-10
16:16
[1b728f71] part of check-in [ca068d82] Fix some harmless compiler warnings. (check-in: [ca068d82] user: mistachkin branch: warnings, size: 27242)
2019-04-26
17:20
[50e1ddaa] part of check-in [1b25fa10] An experimental interface for retrieving the estimated cost and estimated number of output rows for a query. (check-in: [1b25fa10] user: drh branch: cost-est, size: 27215)
2018-12-25
00:15
[5f14db42] part of check-in [3c2ad0e9] Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. (check-in: [3c2ad0e9] user: drh branch: reuse-subqueries, size: 27148)
2018-09-24
12:37
[f125f29f] part of check-in [903e5018] 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: [903e5018] user: drh branch: trunk, size: 26981)
2018-09-21
18:43
[2c4d99fa] part of check-in [8690b5a0] 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: [8690b5a0] user: drh branch: trunk, size: 26078)
2018-06-09
02:49
[b90ef9b9] part of check-in [fd093413] Performance improvement to sqlite3WhereExprUsage(). (check-in: [fd093413] user: drh branch: trunk, size: 26029)
00:09
[09dbf692] part of check-in [292724ff] 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: [292724ff] user: drh branch: trunk, size: 25974)
2018-06-07
14:59
[b09753e7] part of check-in [522f1eac] Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. (check-in: [522f1eac] user: drh branch: multikey-opt-idea, size: 25906)
2018-05-30
00:54
[b6ab96d9] part of check-in [92f0fe15] 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: [92f0fe15] user: drh branch: multikey-opt-idea, size: 25833)
2018-05-07
11:37
[cbae2bcd] part of check-in [374d8e26] Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. (check-in: [374d8e26] user: drh branch: trunk, size: 25684)
2018-04-05
12:02
[2610cb87] part of check-in [81322436] Fix the sqlite3WhereTrace mechanism so that it compiles with the --disable-amalgamation and the --enable-debug options to ./configure using clang. (check-in: [81322436] user: drh branch: trunk, size: 25837)
2017-09-11
19:47
[82c04c50] part of check-in [0fb992af] Refactor names of constants and functions associated with the auxiliary operators for xBestIndex. (check-in: [0fb992af] user: drh branch: vtab-extra-ops, size: 25830)
2017-07-10
15:17
[93bb90b7] part of check-in [a4fc9811] Fix another problem on this branch. (check-in: [a4fc9811] user: dan branch: defer-where-subqueries, size: 25834)
2017-04-13
21:29
[2a4b634d] part of check-in [ce1e2b88] Fix the skip-ahead-distinct optimization so that it works with indexes that have repeated columns with different collating sequences. (check-in: [ce1e2b88] user: drh branch: skip-ahead-distinct, size: 25684)
2017-04-07
19:41
[7a21ef63] part of check-in [a52ef2ad] 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: [a52ef2ad] user: drh branch: covering-index-on-expr, size: 25618)
2017-02-17
15:26
[2d50c2b7] part of check-in [fb2b8ae8] 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: [fb2b8ae8] user: drh branch: auto-analyze, size: 25558)
2017-02-16
20:52
[c0b09218] part of check-in [9fc5cd50] Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now used for more than just DISTINCT processing. (check-in: [9fc5cd50] user: drh branch: trunk, size: 25316)
2016-10-03
14:44
[2bcc3d17] part of check-in [5bb7cde0] Avoid unnecessary memset() calls in the query optimizer. (check-in: [5bb7cde0] user: drh branch: trunk, size: 25323)
2016-09-14
01:43
[1d1fd0b3] part of check-in [db361482] Backport the ORDER BY LIMIT optimization to version 3.8.9. (check-in: [db361482] user: drh branch: branch-3.8.9, size: 22123)
2016-07-26
18:06
[14dd243e] part of check-in [061b8006] 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: [061b8006] user: dan branch: rowvalue, size: 25323)
2016-07-09
20:23
[1ad3be2a] part of check-in [b2204215] Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch. (check-in: [b2204215] user: dan branch: rowvalue, size: 25252)
2016-05-27
12:30
[e5b93970] part of check-in [71087c12] Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and show more details on WhereTerm traces. (check-in: [71087c12] user: drh branch: trunk, size: 25144)
2016-05-19
22:13
[6e18240b] part of check-in [852d1eda] 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: [852d1eda] user: drh branch: orderby-limit, size: 25063)
2016-05-02
10:25
[3b1fc240] part of check-in [54c63b32] Improvements to the way the LIKE optimization is implemented, resulting in slightly smaller and faster code that is easier to test. (check-in: [54c63b32] user: drh branch: trunk, size: 24991)
2016-04-14
16:40
[7de94b75] part of check-in [7b7a69d0] Add the SF_HasAgg constant (currently unused). Also enhance the comments on many other constant definitions to detail constraints on their values. (check-in: [7b7a69d0] user: drh branch: trunk, size: 24981)
13:35
[43466b10] part of check-in [53179614] Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. (check-in: [53179614] user: drh branch: trunk, size: 24677)
2016-02-25
16:04
[93297d56] part of check-in [d491745c] Take the LIMIT clause into account when estimating the cost of sorting. (check-in: [d491745c] user: drh branch: planner-improvements, size: 24685)
2015-12-30
16:51
[78b6b4de] part of check-in [2081d757] 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: [2081d757] user: drh branch: trunk, size: 24611)
2015-12-01
21:23
[e20801d8] part of check-in [9e1d6d4c] Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. (check-in: [9e1d6d4c] user: drh branch: trunk, size: 24611)
2015-11-23
21:09
[6afc0d70] part of check-in [277a5b40] Add experimental support for LIKE, GLOB and REGEXP to the virtual table interface. (check-in: [277a5b40] user: dan branch: vtab-like-operator, size: 24565)
2015-10-22
20:54
[87b0b66c] part of check-in [cdc92919] 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: [cdc92919] user: dan branch: btree-fordelete-flag, size: 24566)
2015-09-28
23:45
[d7337103] part of check-in [70ec88b2] Avoid unnecessary cursors and seeking when running a DELETE against a WITHOUT ROWID table. (check-in: [70ec88b2] user: drh branch: delete-without-rowid-opt, size: 24569)
2015-09-14
14:45
[7892bb54] part of check-in [16e56bda] Use symbolic names ONEPASS_OFF, ONEPASS_SINGLE, and ONEPASS_MULTI for the various modes of the one-pass optimization. (check-in: [16e56bda] user: drh branch: trunk, size: 24492)
2015-08-27
18:24
[292d3ac9] part of check-in [42f93f58] Activate the ability to use expressions in indexes in a query. There are some test failures, but mostly this seems to work. (check-in: [42f93f58] user: drh branch: index-expr, size: 24504)
2015-08-26
21:08
[901c17c1] part of check-in [cbc3c9a8] Reduce the size of the WhereScan object by 24 bytes while also clarifying its operation. (check-in: [cbc3c9a8] user: drh branch: trunk, size: 24436)
2015-08-19
17:11
[880a8599] part of check-in [40e12cfe] A list of arguments following a table name translates into equality constraints against hidden columns in that table. (check-in: [40e12cfe] user: drh branch: table-valued-functions, size: 24368)
2015-06-08
14:23
[5f87e3c4] part of check-in [46ef95c1] Split more subfunctions of where.c out into a new whereexpr.c source file, for improved maintainability. (check-in: [46ef95c1] user: drh branch: view-optimization, size: 24294)
2015-06-06
20:12
[40e1d060] part of check-in [faa0e420] 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: [faa0e420] user: drh branch: view-optimization, size: 23852)
2015-05-14
01:05
[a6f5a762] part of check-in [4541688b] 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: [4541688b] user: drh branch: index-is-operator, size: 22146)
2015-05-13
19:33
[31d30e83] part of check-in [95b1f9bf] Simplified implementation of indexing with the IS operator. (check-in: [95b1f9bf] user: drh branch: index-is-operator, size: 22162)
15:24
[6b5a8ac7] part of check-in [6f7f1673] 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: [6f7f1673] user: drh branch: index-is-operator, size: 22121)
2015-03-25
15:23
[1fca2f8c] part of check-in [4e8796af] Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns. (check-in: [4e8796af] user: dan branch: ota-update, size: 22165)
2015-03-18
20:03
[c1fd5690] part of check-in [52e73eec] 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: [52e73eec] user: dan branch: ota-update, size: 22097)
2015-03-06
19:47
[cbe4aa57] part of check-in [a58aafdb] Fix the LIKE optimization even when comparing mixed-case BLOBs. (check-in: [a58aafdb] user: drh branch: like-opt-fix, size: 22045)
16:45
[0ba6257f] part of check-in [5757e803] 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: [5757e803] user: drh branch: like-opt-fix, size: 21895)
2014-11-03
11:25
[d3633e9b] part of check-in [f5313e0c] Remove unused variable from struct WhereInfo. Add some explanatory comments to new code. (check-in: [f5313e0c] user: dan branch: scanstatus, size: 21699)
2014-11-01
20:38
[a2bc22f4] part of check-in [9ea37422] 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: [9ea37422] user: dan branch: scanstatus, size: 21780)
18:08
[99d324a8] part of check-in [8d8cc960] Minor fixes and documentation improvements for sqlite3_stmt_scanstatus(). (check-in: [8d8cc960] user: dan branch: scanstatus, size: 21674)
2014-10-25
12:28
[19279cd0] part of check-in [b9ad601e] 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: [b9ad601e] user: drh branch: trunk, size: 21593)
2014-10-21
01:05
[4b459cdb] part of check-in [f4b22a26] 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: [f4b22a26] user: drh branch: trunk, size: 21517)
2014-09-06
16:39
[124d9704] part of check-in [e62aab5e] Fix typos in comments. No code changes. (check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 21530)
2014-08-08
16:52
[923820be] part of check-in [299b9570] 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: [299b9570] user: dan branch: query-planner-fix, size: 21531)
2014-04-25
20:22
[6804c2e5] part of check-in [c51efaa5] 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: [c51efaa5] user: dan branch: experimental-costs, size: 21532)
2014-04-21
13:21
[929c1349] part of check-in [de9a490f] 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: [de9a490f] user: dan branch: trunk, size: 21454)
2014-03-18
20:33
[2564055b] part of check-in [e258df23] 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: [e258df23] user: drh branch: orderby-planning, size: 21379)
15:30
[daa3cdf9] part of check-in [b1509025] Experiments with the optimization of ORDER BY and GROUP BY clauses. (check-in: [b1509025] user: drh branch: orderby-planning, size: 21363)
2014-01-28
00:49
[921f935a] part of check-in [a2c347fa] 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: [a2c347fa] user: drh branch: branch-3.8.2, size: 21419)
2013-11-13
16:58
[96a75c61] part of check-in [5e75ab93] Improve the way that skip-scan loops are constructued. Add test cases. Improved the scoring of skip-scan loops. (check-in: [5e75ab93] user: drh branch: skip-scan, size: 21336)
12:27
[a0e8fa53] part of check-in [27dd5993] 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: [27dd5993] user: drh branch: skip-scan, size: 21540)
2013-11-12
20:18
[63c8345d] part of check-in [0d1328e3] Minor enhancements to the auxiliary information added to EXPLAIN output with SQLITE_EXPLAIN_ENABLE_COMMENTS. (check-in: [0d1328e3] user: drh branch: trunk, size: 21190)
18:37
[fda11df0] part of check-in [c4446712] Break out the structure and macro definitions of where.c into a separate header file whereInt.h for easier editing and debugging. (check-in: [c4446712] user: drh branch: trunk, size: 21115) Added