/ File History
Login

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

History of src/whereInt.h

2019-09-03
14:27
When we play games with COLLATE in order to commute an operator in the WHERE clause processing, be sure not to use the commuted operator to qualify a partial index, as insufficient COLLATE information is preserved to verify that the expression will correctly qualify the index. Ticket [767a8cbc6d20bd68] file: [2c6bae13] check-in: [5351e920] user: drh branch: trunk, size: 27533
2019-08-23
13:32
Invert the meaning of the regBignull flag so that it is 1 when doing the normal scan and 1 when scanning nulls. This enables the re-do jump at the bottom of the loop to be coded with a single OP_IfNotZero opcode, rather than a sequence of OP_If, OP_Integer, OP_Goto. file: [4a296fd4] check-in: [bf875e1a] user: drh branch: nulls-last, size: 27458
13:08
Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. file: [cce97c33] check-in: [649b08ea] user: drh branch: nulls-last, size: 27458
2019-08-16
21:07
Add support for using indexes for some ORDER BY clauses that use non-default NULL handling. Still some problems on this branch. file: [807766a6] check-in: [81069d71] user: dan branch: nulls-last, size: 27432
2019-08-08
15:24
Remove support for STAT3. The sqlite_stat3 tables are ignored, if they exist. STAT4 continues to work as it always has, and as it is a superset of STAT3 is the recommended replacement. file: [2082fc2b] check-in: [1e17ea2f] user: drh branch: omit-stat3, size: 27312
2019-08-03
16:37
Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca]. file: [2bb9632f] check-in: [d465c3ee] user: dan branch: trunk, size: 27330
2019-07-29
14:42
When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c]. file: [6fab4b6f] check-in: [b4716931] user: dan branch: tkt-6749cb3c, size: 27251
2019-05-10
16:16
Fix some harmless compiler warnings. file: [1b728f71] check-in: [ca068d82] user: mistachkin branch: warnings, size: 27242
2019-04-26
17:20
An experimental interface for retrieving the estimated cost and estimated number of output rows for a query. file: [50e1ddaa] check-in: [1b25fa10] user: drh branch: cost-est, size: 27215
2018-12-25
00:15
Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. file: [5f14db42] check-in: [3c2ad0e9] user: drh branch: reuse-subqueries, size: 27148
2018-09-24
12:37
Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the code. file: [f125f29f] check-in: [903e5018] user: drh branch: trunk, size: 26981
2018-09-21
18:43
Put a limit counter on the query planner that restricts the number of index+constraint options that can be considered for each table in a join. This prevents certain pathological queries from taking up too much time in the query planner. file: [2c4d99fa] check-in: [8690b5a0] user: drh branch: trunk, size: 26078
2018-06-09
02:49
Performance improvement to sqlite3WhereExprUsage(). file: [b90ef9b9] check-in: [fd093413] user: drh branch: trunk, size: 26029
00:09
Avoid invoking the whereLoopAddOr() routine in the query planner if there are no OR operators in the WHERE clause, thus speeding up query planning slightly. file: [09dbf692] check-in: [292724ff] user: drh branch: trunk, size: 25974
2018-06-07
14:59
Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. file: [b09753e7] check-in: [522f1eac] user: drh branch: multikey-opt-idea, size: 25906
2018-05-30
00:54
Demonstration code on a possible technique for optimizing the use of IN operator on columns to the right of multicolumn indexes. If the OP_Noop generated where were really a new opcode that checked to see if there existed any entries in the index with a matching prefix, it might prevent unnecessary iterations of the IN operator. file: [b6ab96d9] check-in: [92f0fe15] user: drh branch: multikey-opt-idea, size: 25833
2018-05-07
11:37
Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. file: [cbae2bcd] check-in: [374d8e26] user: drh branch: trunk, size: 25684
2018-04-05
12:02
Fix the sqlite3WhereTrace mechanism so that it compiles with the --disable-amalgamation and the --enable-debug options to ./configure using clang. file: [2610cb87] check-in: [81322436] user: drh branch: trunk, size: 25837
2017-09-11
19:47
Refactor names of constants and functions associated with the auxiliary operators for xBestIndex. file: [82c04c50] check-in: [0fb992af] user: drh branch: vtab-extra-ops, size: 25830
2017-07-10
15:17
Fix another problem on this branch. file: [93bb90b7] check-in: [a4fc9811] user: dan branch: defer-where-subqueries, size: 25834
2017-04-13
21:29
Fix the skip-ahead-distinct optimization so that it works with indexes that have repeated columns with different collating sequences. file: [2a4b634d] check-in: [ce1e2b88] user: drh branch: skip-ahead-distinct, size: 25684
2017-04-07
19:41
Proof of concept for the ability to use the expression columns in an index on expressions in place of equivalent expressions in the result set or in the WHERE clause. This check-in compiles but is mostly untested. file: [7a21ef63] check-in: [a52ef2ad] user: drh branch: covering-index-on-expr, size: 25618
2017-02-17
15:26
Set the TF_StatsUsed flag on tables when the query planner outcome is affected by the sqlite_stat1 data. Also, change the column names of the "PRAGMA stats" command so that they are not keywords. file: [2d50c2b7] check-in: [fb2b8ae8] user: drh branch: auto-analyze, size: 25558
2017-02-16
20:52
Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now used for more than just DISTINCT processing. file: [c0b09218] check-in: [9fc5cd50] user: drh branch: trunk, size: 25316
2016-10-03
14:44
Avoid unnecessary memset() calls in the query optimizer. file: [2bcc3d17] check-in: [5bb7cde0] user: drh branch: trunk, size: 25323
2016-09-14
01:43
Backport the ORDER BY LIMIT optimization to version 3.8.9. file: [1d1fd0b3] check-in: [db361482] user: drh branch: branch-3.8.9, size: 22123
2016-07-26
18:06
Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases. file: [14dd243e] check-in: [061b8006] user: dan branch: rowvalue, size: 25323
2016-07-09
20:23
Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch. file: [1ad3be2a] check-in: [b2204215] user: dan branch: rowvalue, size: 25252
2016-05-27
12:30
Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and show more details on WhereTerm traces. file: [e5b93970] check-in: [71087c12] user: drh branch: trunk, size: 25144
2016-05-19
22:13
In a query with both ORDER BY and LIMIT, if the inner loop satisfies the ORDER BY then try to cut short each invocation of the inner loop once the LIMIT has been satisfied. This check-in is a partial implementation only. file: [6e18240b] check-in: [852d1eda] user: drh branch: orderby-limit, size: 25063
2016-05-02
10:25
Improvements to the way the LIKE optimization is implemented, resulting in slightly smaller and faster code that is easier to test. file: [3b1fc240] check-in: [54c63b32] user: drh branch: trunk, size: 24991
2016-04-14
16:40
Add the SF_HasAgg constant (currently unused). Also enhance the comments on many other constant definitions to detail constraints on their values. file: [7de94b75] check-in: [7b7a69d0] user: drh branch: trunk, size: 24981
13:35
Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. file: [43466b10] check-in: [53179614] user: drh branch: trunk, size: 24677
2016-02-25
16:04
Take the LIMIT clause into account when estimating the cost of sorting. file: [93297d56] check-in: [d491745c] user: drh branch: planner-improvements, size: 24685
2015-12-30
16:51
Changes to the way that the default BINARY collating sequence is recorded result in a slightly smaller and slightly faster executable. More work could be done to make this cleaner. file: [78b6b4de] check-in: [2081d757] user: drh branch: trunk, size: 24611
2015-12-01
21:23
Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. file: [e20801d8] check-in: [9e1d6d4c] user: drh branch: trunk, size: 24611
2015-11-23
21:09
Add experimental support for LIKE, GLOB and REGEXP to the virtual table interface. file: [6afc0d70] check-in: [277a5b40] user: dan branch: vtab-like-operator, size: 24565
2015-10-22
20:54
Modifications to pass a flag to internal routine sqlite3BtreeCursor() when a cursor that is used solely for deleting b-tree entries, or for obtaining the components of keys to delete from other b-trees, is opened. file: [87b0b66c] check-in: [cdc92919] user: dan branch: btree-fordelete-flag, size: 24566
2015-09-28
23:45
Avoid unnecessary cursors and seeking when running a DELETE against a WITHOUT ROWID table. file: [d7337103] check-in: [70ec88b2] user: drh branch: delete-without-rowid-opt, size: 24569
2015-09-14
14:45
Use symbolic names ONEPASS_OFF, ONEPASS_SINGLE, and ONEPASS_MULTI for the various modes of the one-pass optimization. file: [7892bb54] check-in: [16e56bda] user: drh branch: trunk, size: 24492
2015-08-27
18:24
Activate the ability to use expressions in indexes in a query. There are some test failures, but mostly this seems to work. file: [292d3ac9] check-in: [42f93f58] user: drh branch: index-expr, size: 24504
2015-08-26
21:08
Reduce the size of the WhereScan object by 24 bytes while also clarifying its operation. file: [901c17c1] check-in: [cbc3c9a8] user: drh branch: trunk, size: 24436
2015-08-19
17:11
A list of arguments following a table name translates into equality constraints against hidden columns in that table. file: [880a8599] check-in: [40e12cfe] user: drh branch: table-valued-functions, size: 24368
2015-06-08
14:23
Split more subfunctions of where.c out into a new whereexpr.c source file, for improved maintainability. file: [5f87e3c4] check-in: [46ef95c1] user: drh branch: view-optimization, size: 24294
2015-06-06
20:12
Split out the bulk of the actual VDBE code generation logic from where.c into a new file, leaving behind the analysis logic. This makes the original where.c smaller and hopefully easier to edit. file: [40e1d060] check-in: [faa0e420] user: drh branch: view-optimization, size: 23852
2015-05-14
01:05
A new implementation of indexing with the IS operator that works correctly when the IS operator is in the WHERE clause and the operands are from opposite sides of a LEFT JOIN. file: [a6f5a762] check-in: [4541688b] user: drh branch: index-is-operator, size: 22146
2015-05-13
19:33
Simplified implementation of indexing with the IS operator. file: [31d30e83] check-in: [95b1f9bf] user: drh branch: index-is-operator, size: 22162
15:24
An early attempt to get indexes to work with the IS operator. This code passes tests, but much more testing is needed to verify that it works on all corner cases. file: [6b5a8ac7] check-in: [6f7f1673] user: drh branch: index-is-operator, size: 22121
2015-03-25
15:23
Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns. file: [1fca2f8c] check-in: [4e8796af] user: dan branch: ota-update, size: 22165
2015-03-18
20:03
Allow whereShortCut() to use the PRIMARY KEY index of a WITHOUT ROWID table to optimize a vector of "IS" operators in a WHERE clause. file: [c1fd5690] check-in: [52e73eec] user: dan branch: ota-update, size: 22097
2015-03-06
19:47
Fix the LIKE optimization even when comparing mixed-case BLOBs. file: [cbe4aa57] check-in: [a58aafdb] user: drh branch: like-opt-fix, size: 22045
16:45
The LIKE optimization must be applied twice, once for strings and a second time for BLOBs. Ticket [05f43be8fdda9f]. This check-in is a proof-of-concept of how that might be done. file: [0ba6257f] check-in: [5757e803] user: drh branch: like-opt-fix, size: 21895
2014-11-03
11:25
Remove unused variable from struct WhereInfo. Add some explanatory comments to new code. file: [d3633e9b] check-in: [f5313e0c] user: dan branch: scanstatus, size: 21699
2014-11-01
20:38
If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand. file: [a2bc22f4] check-in: [9ea37422] user: dan branch: scanstatus, size: 21780
18:08
Minor fixes and documentation improvements for sqlite3_stmt_scanstatus(). file: [99d324a8] check-in: [8d8cc960] user: dan branch: scanstatus, size: 21674
2014-10-25
12:28
Do not use virtual (and hence redundant) WHERE-clause terms to restrict the content of a automatic partial index. Show when an automatic partial index is used in the EXPLAIN QUERY PLAN output. file: [19279cd0] check-in: [b9ad601e] user: drh branch: trunk, size: 21593
2014-10-21
01:05
If a skip-scan is a proper subset of some other scan, then adjust the cost of the skip-scan upward so that it is more costly than the other scan. Such a cost imbalance can arise under STAT4 because of difficulties in getting an accurate estimate for skip-scans. file: [4b459cdb] check-in: [f4b22a26] user: drh branch: trunk, size: 21517
2014-09-06
16:39
Fix typos in comments. No code changes. file: [124d9704] check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 21530
2014-08-08
16:52
Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the problem addressed by [2af630c572]. file: [923820be] check-in: [299b9570] user: dan branch: query-planner-fix, size: 21531
2014-04-25
20:22
If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop. file: [6804c2e5] check-in: [c51efaa5] user: dan branch: experimental-costs, size: 21532
2014-04-21
13:21
Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0]. file: [929c1349] check-in: [de9a490f] user: dan branch: trunk, size: 21454
2014-03-18
20:33
Make the partial-ORDER-BY information in the query planner available to the SELECT code generator. Still doesn't make a difference in the generated code. file: [2564055b] check-in: [e258df23] user: drh branch: orderby-planning, size: 21379
15:30
Experiments with the optimization of ORDER BY and GROUP BY clauses. file: [daa3cdf9] check-in: [b1509025] user: drh branch: orderby-planning, size: 21363
2014-01-28
00:49
Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. file: [921f935a] check-in: [a2c347fa] user: drh branch: branch-3.8.2, size: 21419
2013-11-13
16:58
Improve the way that skip-scan loops are constructued. Add test cases. Improved the scoring of skip-scan loops. file: [96a75c61] check-in: [5e75ab93] user: drh branch: skip-scan, size: 21336
12:27
Add the ability to use an index even if the left-most columns of the index are unconstrainted, provided that the left-most columns have few distinct values. file: [a0e8fa53] check-in: [27dd5993] user: drh branch: skip-scan, size: 21540
2013-11-12
20:18
Minor enhancements to the auxiliary information added to EXPLAIN output with SQLITE_EXPLAIN_ENABLE_COMMENTS. file: [63c8345d] check-in: [0d1328e3] user: drh branch: trunk, size: 21190
18:37
Break out the structure and macro definitions of where.c into a separate header file whereInt.h for easier editing and debugging. file: [fda11df0] check-in: [c4446712] user: drh branch: trunk, size: 21115 Added