aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
Commit message (Collapse)AuthorAge
...
* Fix handling of covering indexes that use virtual columns.drh2019-10-24
| | | FossilOrigin-Name: e0f7e321eca91c49102649f70728de69347cbd7b16599b854203c24cfdc348e6
* Refactor names of column index transformation functions, for clarity.drh2019-10-19
| | | | | Get generated columns working with ALTER TABLE RENAME COLUMN. FossilOrigin-Name: 27ab41c9102e7801ff829488fc123a8040da008bef373d6704efbe2f93e1da90
* Claw back some performance from the sqlite3ExprGetColumnOfTable() routine.drh2019-10-18
| | | FossilOrigin-Name: e8426acb94179ff49549aced6ea3c26c49ba4761c2f414fa1772d6a031edc79d
* Initial experimental code for generated column support. Non-functional.drh2019-10-16
| | | FossilOrigin-Name: 11d472c1df707b8d03ec57d8fc582a34f5eb89a9d02a154a9871650c65065b45
* Formatting change on a multi-line conditional, for improved clarity.drh2019-10-15
| | | | | No logic changes. FossilOrigin-Name: 7248e3476511ecd317f54edcfe1e87443bfdcc1b10c89c7734eefcabafec6c0b
* Futher improvements to the IN operator for row-values on virtual tables.drh2019-10-14
| | | FossilOrigin-Name: bc751fb64d5b08e5ca4c85cd1c6fbf09590fa9dad7e176ba373082ea373655b5
* Fix a problem with row-value IN(...) operators and virtual tables.dan2019-10-14
| | | FossilOrigin-Name: aa57d7abac0bb92d4d5fd4e093a11cf8efc04e4eed748b2a400d01f137250649
* Remove some affinity tests that became unreachable due to the prior change.drh2019-08-31
| | | FossilOrigin-Name: e2db1123faac26c0e0b6a1ebef1685ea7633bfcafd1ff743ba5380700f7745af
* When the affinity of a table column is INT or REAL, make the affinity ofdrh2019-08-30
| | | | | | | 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] FossilOrigin-Name: e0d909c740b774d8a46731696e33342be83206cc4a95d07f42fdb3d8cc2d7a8e
* Revise the VDBE comments for NULL-scan so that they also work makedrh2019-08-23
| | | | | sense when reading a NULLS FIRST plan. FossilOrigin-Name: bfe793780fa6fc7a1e7d0ee60606dda272985de9573887dca118e9510fc609f2
* Additional simplifications of the WHERE loop code generator logic fordrh2019-08-23
| | | | | NULLS LAST. FossilOrigin-Name: 1383680d927d7d703933be7653c0019199845e7f7e82bcc76d9ca3808093e9d8
* Simplification of the WHERE loop code generator for NULLS LAST saves adrh2019-08-23
| | | | | few CPU cycles and about a hundred bytes of code space. FossilOrigin-Name: e3ed2f496f51234a8f81d90d47ba603b06dbed38b8bd8f1934294379cde74d3a
* Invert the meaning of the regBignull flag so that it is 1 when doing thedrh2019-08-23
| | | | | | | 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. FossilOrigin-Name: bf875e1a259a4167694e06349458452dc36c1d38aa6843518d9ae46ce74e5559
* Extra VDBE comments in the NULLS LAST logic provide landmarks to helpdrh2019-08-23
| | | | | understand the EXPLAIN output. FossilOrigin-Name: 649b08ead50f10a9ec0357a5e1ed020195d9f93be61ef703ea036a8e53f07a34
* Add additional VDBE coverage marcros.drh2019-08-22
| | | FossilOrigin-Name: d3531f5be7d3769689e2cd8bdc9bab5608759de027d44cc123996f32a4a89583
* Update this branch with latest trunk changes.dan2019-08-21
|\ | | | | FossilOrigin-Name: 6153bcf41a9aa0497f8210311c99ac23846223068f2b6a3a1c2d9dec7673c7e1
| * Retain the affinity of an expression in a WHERE clause when it is ↵dan2019-08-20
| | | | | | | | | | transformed to a reference to an index column on the same expression. Fix for [f043b113]. FossilOrigin-Name: 511da0815673ca4a176aa61dc23a8231b2ab77e8363fc184a78b6e17dba64d49
* | Fix problem with DESC indexes on this branch.dan2019-08-17
| | | | | | FossilOrigin-Name: b49df1fe9b7174ebc60023179e8da628c926e59df3dc01b15d4a28e17807bb97
* | Add support for using indexes for some ORDER BY clauses that use non-default ↵dan2019-08-16
|/ | | | | NULL handling. Still some problems on this branch. FossilOrigin-Name: 81069d7196857e909c94195d67388f71bc9f832eafd9156d8c5cdddb63513b4a
* Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columnsdrh2019-08-06
| | | | | | with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. FossilOrigin-Name: e8234f6939ccff4c10f741cf66d1c537cfebcbd0d1d79a618a64c755a7f087b5
* Stregthen an assert() in the WHERE clause code generator for the min/maxdrh2019-08-03
| | | | | optimization. FossilOrigin-Name: 1bd4b97d6405c9b093f3bfed914c56088ee13e4a2242be62b74a86660f74f533
* Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE ↵dan2019-08-03
| | | | | <expr>=?" where there is an index on <expr>. Fix for [71e183ca]. FossilOrigin-Name: d465c3eef458c851d97eea6e4117247d9c69386b276168080dbff7bb64070c93
* If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not ↵dan2019-08-02
| | | | | null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37]. FossilOrigin-Name: a7277ed0623dccdbf775ae6127611d6bc6e150f6942a048ab4281e5136c0e98d
* Strive to prevent harmless compiler warnings in GCC 4.8.5.drh2019-05-07
| | | FossilOrigin-Name: 8b6691f619ed9a56f6aecbd878ebb447c40984f8767508b248494fd9ec68fbaa
* Streamline the processing of the AND operator. Slightly smaller and faster.drh2019-04-19
| | | FossilOrigin-Name: 7713996aa99ce6dd35b5a2db74dd26658fb8d9817169b2a7531cdef6edb41403
* Eliminate the tool/addopcodes.tcl script. The purpose of that script was todrh2019-04-05
| | | | | | | 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. FossilOrigin-Name: d272819298083ebbde57962a2938925b1aaa1caf03e48bb3ea26ad91e0461d84
* Fix issues with the previous check-in and add more VDBE branch coveragedrh2019-03-30
| | | | | testing macros. FossilOrigin-Name: b5f72f10f2dfdbee9fe98c63ffb933e841203790746a920b99df14ca5c14127c
* Fix a typo in a comment. No changes to code.drh2019-03-18
| | | FossilOrigin-Name: c2f50aa4e7bad8821e91a7490283dd53e44047d10a8cfebc3e2da26c770a5218
* In a query that uses a partial index, the expression that is the WHERE clausedrh2019-03-01
| | | | | | of the partial index must always be true. Use this fact to avoid evaluating identical terms in the WHERE clause of the query. FossilOrigin-Name: 9b2879629c34fc0a8e99d94648903eb93aabbc7a3682c80cb7382f9a9ca5ffb7
* Remove a testcase() macro which is now unreachable due to the contraction ofdrh2019-02-23
| | | | | the use of IN_INDEX_ROWID. FossilOrigin-Name: 90c5a17cd526b256753f876e575f3e731d5e8b9dd6e196cf8d8f7306e099b91c
* Check-in [fa792714ae62fa980] is not a valid fix for ticketdrh2019-02-22
| | | | | | | | [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]. FossilOrigin-Name: 0d456456da6e25b20d9d27ca95f1013082bca52ee74ee9bf91732a9fa843ea45
* When an IN operator drives a query loop, mark it as "CODED" so that itdrh2019-02-20
| | | | | | | | 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]. FossilOrigin-Name: fa792714ae62fa980f1767acc6d622a6727ceb677870243c88548423795dcb5b
* Do not do the optimization that attempts to pull expression values fromdrh2019-02-08
| | | | | | | | 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]. FossilOrigin-Name: 440a7cda000164d3b46109caf2e1dde80681ba9b0d94ba9be6847d2b917445cf
* Merge enhancements and bug fixes from trunk.drh2018-12-31
|\ | | | | FossilOrigin-Name: 9fb646f29c05bca5f677a2c7c4f45c36bfe0a0c6a88cb7968b4a0459bdd63bb2
| * A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewerdrh2018-12-29
| | | | | | | | | | | | | | | | | | 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*. FossilOrigin-Name: 4a0929ac76d8aa5dd65eac3b83d6bbf41e505e01d175ca0fb2b19ba02d439415
* | Increase the number of parameters to sqlite3WhereCodeOneLoopStart() todrh2018-12-25
| | | | | | | | | | | | encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. FossilOrigin-Name: 3c2ad0e915e835b1cb2962879beff50b2745d0cefe1cfc89ef90b7879c139ce6
* | Improvements to EXPLAIN QUERY PLAN formatting. The MULTI-INDEX OR now showsdrh2018-12-24
| | | | | | | | | | | | a separate "INDEX" subtree for each index. SCALAR SUBQUERY entries provide a subquery number that is related back to the .selecttrace output. FossilOrigin-Name: 7153552bac51295c56a1c42ca79d57195851e232509f9e9610375692f48c7e86
* | Restore a line of code that was previously commented out for debugging.drh2018-12-24
| | | | | | FossilOrigin-Name: e53781f5bdf5c7b7d91ffe76565ea2fe5d1b3a9b162b3a88a7017bbe785d4c72
* | Experimental code that tries to put the computation of subqueries inside adrh2018-12-24
|/ | | | | | subroutine, and reuse that subroutine if the same subquery is evaluated more than once. Current code does not work for CHECK constraints. FossilOrigin-Name: 6c44838adbe5dc482bc010e91a6dd7a0f777c989f443dd600740d2c783208e0d
* Split the code generation for the RHS of IN operators and for SELECT anddrh2018-12-23
| | | | | | | 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. FossilOrigin-Name: 2b6494b1509f0d0189f98aa34c990eee99c775ff57826e79b2c5b0a12b4c97ad
* Fix a assert() in the query planner that can arise when doing row-valuedrh2018-11-03
| | | | | | operations on a PRIMARY KEY that contains duplicate columns. Ticket [1a84668dcfdebaf12415d]. FossilOrigin-Name: dcb8c73594ea6b12bad98dc883a585d3e6b925c2ead267dc40332b3d266db5e8
* Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a newdrh2018-09-20
| | | | | | | 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. FossilOrigin-Name: ad130bb86e74e6ce165fdbdce3a19699510f0e62071c1c7923b5a4538d888c7c
* Fix a harmless compiler warning that arose from the ENABLE_CURSOR_HINTSdrh2018-09-12
| | | | | fix of check-in [0af18674ca5b34e67e] FossilOrigin-Name: f578e62ae6f6cc78d8281adab9fa93f3f58711879c2860bbe19f291d257dc0af
* Fix a problem causing ENABLE_CURSOR_HINTS builds to segfault.dan2018-09-11
| | | FossilOrigin-Name: e7033104fa8bd974a9a3d173200aa07a3aa3daade86e7eb65cad5d00b086969e
* Fix a minor problem causing an incorrect cursor-hint to be generated in somedan2018-09-10
| | | | | cases. FossilOrigin-Name: d879c47d7d145cbe99602b2cf70294ddc946709e8d61040942085d29e2c5b6cd
* Further logic simplifications that flow out of the omission of the column cache.drh2018-08-04
| | | FossilOrigin-Name: 7d9072b027cc28dd8ecf5e2686d821017997445c15124eebe2839984622af4db
* Completely remove the column cache logic, which has been a persistent sourcedrh2018-08-03
| | | | | | | of bugs for many years. We recent enhancements to the performance of the OP_Column opcode, the removing the column cache actually makes speed-check.sh run faster. It also saves about 1,800 bytes of code space. FossilOrigin-Name: 3f5f60cd7529330209027fdae8129cca420cec1050eae50a7750d0b715b56972
* Fix the OP_SeekRowid opcode so that it has no type-change side-effects on thedrh2018-08-03
| | | | | | | | | 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. FossilOrigin-Name: fa94b49e02eb6b8fc4acc220ecc2fabef546c65845696758b25965c26b251ea9
* Constant propagation is now restricted to just the WHERE clause. Thedrh2018-07-27
| | | | | | | 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. FossilOrigin-Name: 82c67efb723dba387964f690cd459b420e59e3367d9589016597a76531596391
* Identify Select objects within a single statement using small sequentialdrh2018-07-10
| | | | | | integers rather than "0x%p". This is more readable and yields the same result on successive runs. FossilOrigin-Name: a7cdc5bc85e0edfcc38f920c2ce91599bcbfdb49522d88b08c64596546d13881