aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
Commit message (Collapse)AuthorAge
...
* Remove the NextIfOpen and PrevIfOpen opcodes which are no longer neededdrh2018-06-07
| | | | | when the IN-early-out optimization is working. FossilOrigin-Name: 439c8162272795b422a0e01b01b832fbc12b39914c9632a674162af8bdecff98
* Test cases.drh2018-06-07
| | | FossilOrigin-Name: 085e863713a3f2d420c0076b275a6ac445a59d4d93f9eb0e8503b4e3f5589249
* Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of thisdrh2018-06-07
| | | | | optimization. FossilOrigin-Name: 522f1eacc20f11002cad58232a7c2610f369568653510e54f46088f579f778dc
* Add the OP_IfNoHope and OP_SeekHit opcodes used to reduce the number ofdrh2018-06-05
| | | | | | unnecessary sqlite3BtreeMovetoUnpacked() calls when checking for an early exit on IN-operator loops. Futher optimizations are likely possible here. FossilOrigin-Name: 6bf251af4347165a470d39457d61ab6d2a06c206db8f30bd8be5dbb388ae8a5b
* Use an OP_NotFound opcode to cancel futile IN operators early. The currentdrh2018-06-05
| | | | | | | 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. FossilOrigin-Name: 87a9fc504f9a78caf7a7949cc7ada0a19d61bfab51bb49a00a1607194c116212
* Demonstration code on a possible technique for optimizing the use of INdrh2018-05-30
| | | | | | | | 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. FossilOrigin-Name: 92f0fe155d5546fc7f4a443d0630613dabe149061966308e5420fad652278f16
* Make the internal dynamic string interface available to extensions usingdrh2018-05-09
| | | | | | | 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. FossilOrigin-Name: 87f261f0cb800b06ad786f6df16f2c4dddd0d93dfdcc77b4a4eaa22920b56bf1
* Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic.drh2018-05-07
| | | FossilOrigin-Name: 374d8e264487b0437a8d995ced1bc026a92d495a2d0568f65f033e9ebe11d0e2
* Make a separate limb in the EXPLAIN QUERY PLAN output for the various linesdrh2018-05-04
| | | | | associated with the OR-optimization. FossilOrigin-Name: 75ac7b4e4fd0811ca80c719badacff207e0bbd00ac64dde3b3d4ec676fad472d
* Fix a dangling-else problem that was causing recursive CTEs to malfunction.drh2018-05-02
| | | | | Begin fixing test cases to work with the new EQP output. FossilOrigin-Name: 82ca44b82fed6814c84440ba8bfaa019488ab956e84ac165180e2fcece6facb2
* Begin reengineering the EXPLAIN QUERY PLAN function to provide moredrh2018-05-02
| | | | | intuitive output. FossilOrigin-Name: 70b48a7972dfbb44af3ccd8ccd830e984bec88d80a78b3566a5de86a16e7fc14
* Fix a problem with processing "LEFT JOIN tbl ON tbl.a = ? AND (tbl.b=? ORdan2018-04-24
| | | | | tbl.c=?)" in cases where there are indexes on both tbl(a, b) and tbl(a, c). FossilOrigin-Name: ce35e39c5cc2b00dd6b4a9ffaa9d5eb7d9b862759e87d5f053729de7643eee9c
* Add a hyperlink to the ticket on the code comment for the fix todrh2018-04-24
| | | | | ticket [7fa8049685b50b5aeb0c2]. FossilOrigin-Name: 45247c7f291bc0cc42600a4aa4ff7cdcd0a703fdfadcb0e12174c5250e70d503
* Do not attempt to read values from indexes-on-expressions if the index is ondan2018-04-24
| | | | | | the RHS of a LEFT JOIN. This won't work if the index cursor points at a null-row. Fix for [7fa80496]. FossilOrigin-Name: b8ef967ab1bebf2846c06c4f7200d6fa1c60e52e55711ea171c25ef1331f8a24
* Better solution to the LIKE problem from the previous check-in that worksdrh2018-04-02
| | | | | even if the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option is used. FossilOrigin-Name: b850dd159918af568c55c00ff146ba9c9c04d33ff384fe1eb0ad74164bc401bb
* Fix a logic error discovered by OSSFuzz.drh2018-03-31
| | | FossilOrigin-Name: fc06ddd458fc1028b33b3927cc3b113b7106caa67136993de2e57926a8a19623
* Fix an incorrect table lookup used to find the appropriate search operatordrh2018-02-13
| | | | | | | 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] FossilOrigin-Name: f3112e67cdb27c1aec8d2cee3cb91ade061d093e13505894698e26336898b336
* Fix a bug causing spurious "sub-select returns N columns expected 1" errorsdan2018-01-23
| | | | | in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause. FossilOrigin-Name: 14dfd96f9bca2df5033b2d894bf63cc8bf450a45ca11df5e3bbb814fdf96b656
* Fix SQLITE_DBCONFIG_TRIGGER_EQP so that it works even if SQLITE_DEBUG isdrh2017-12-21
| | | | | not defined. FossilOrigin-Name: afbbfff72002089fa73b5473cc98360df14288d489e93e667332d6e884ef60da
* Correctly invalidate a column cache line when it is overwritten with NULL.drh2017-12-13
| | | | | Fix for ticket [123c9ba32130a6c9d432]. FossilOrigin-Name: 65754dc3b830ef9482655d2e93c2cd4acaa7a8715a58d8309955d04378541f89
* Improved fix for ticket [da78413751863] that does not require disabling thedrh2017-11-17
| | | | | | query flattener as was done in [005d5b870625]. This also makes the code generator for vector IN operators a little easier to understand. FossilOrigin-Name: 723f1be3d4a905a6a16333f8ef3e1067dcd4944497b303033c49946fc37c780f
* New assert() statements in the rowvalue IN expression processing.drh2017-11-17
| | | FossilOrigin-Name: 00c328317473cee8fd7bd92c58409a356337b727cfa562bd8de59350d978769c
* Remove unnecessary NEVER() and ALWAYS() conditionals.drh2017-10-31
| | | FossilOrigin-Name: 1c80c75d4be2f3d44fb18bb4c07eccac2aba79b688215a741317dfc47dc7c2ce
* Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULLdan2017-09-09
| | | | | constraints. FossilOrigin-Name: 34c8e952616013deb6fffec701ac5989afac9bef1bf92458a2e4ba92c7ee924f
* Fix a few over-length source code lines. No functional changes.drh2017-08-25
| | | FossilOrigin-Name: 1783c54ce9dcb4b2c4f2a66f6d3315e646b71b54a8899fc32a7bf0f935a21f7f
* Enhance the like optimization so that it works with an ESCAPE clause.drh2017-07-27
| | | FossilOrigin-Name: f5d330f495d07a704e115595bbdf5422ddb68fd8191114c5a12c9c873d983f7c
* Additional debugging Noop-comment in the constraint generator whendrh2017-07-10
| | | | | wheretrace is enabled. FossilOrigin-Name: 0ca7474f05e9f27f53f8c71f5a3ff99963ffef9be9c147869e096246d552d6f1
* Fix another problem on this branch.dan2017-07-10
| | | FossilOrigin-Name: a4fc98113aeb10860834f68a2fdcef690ea15d8303d23b6dd416994a4b7edab6
* Fix a problem causing non-covered WHERE terms to be evaluated before covereddan2017-07-10
| | | | | WHERE terms. FossilOrigin-Name: 7d3cb39f60951dcec1ff87da2c4ec998f993de5edf49ee5e5f480c6fe4e5a052
* When testing non-indexed WHERE constraints, test those that involvedan2017-07-10
| | | | | | correlated sub-queries last of all. This increases the chances of not having to run the sub-query at all. FossilOrigin-Name: 1f9c1f359e4693954ba7e2bc7b172ef34eb046e4ca2796df8336975b9d6aa92b
* Consider the values bound to SQL variables when determining whether or not adan2017-06-24
| | | | | partial index may be used. FossilOrigin-Name: 7b59c353b805c64689b4ae9df347705acbb5f116346ad77af8ce087da7893747
* Change the name of the OP_Seek opcode into OP_DeferredSeek for betterdrh2017-06-02
| | | | | clarity of function. No functional code changes. FossilOrigin-Name: ab33d299c7dab52703d06f3441c8a98c6c809b2612ec65d71aab2919bd2b1540
* Minor size and performance improvements to the push-down optimization.drh2017-04-29
| | | FossilOrigin-Name: 91dfb61a1a25763bb0b5c1e353a9d584bc6de3f6eb445f54202ffe7f6fee6e8d
* Within a loop that uses a non-covering index test, test non-indexed terms thatdan2017-04-28
| | | | | can be tested without seeking the main table cursor before those that cannot. FossilOrigin-Name: afe68f0a8060dc5c92cb1fb32a9f22bd36140cd2c0bb5b6cea853e169c5ed444
* Improved comments. Fix a problem when an indexed expression is used in andrh2017-04-11
| | | | | ORDER BY clause. FossilOrigin-Name: c59eaf2b7cd2596733f349fc0fe979f71fd29bd73152a0c57066e0b69d5b7a4a
* Proof of concept for the ability to use the expression columns in an indexdrh2017-04-07
| | | | | | on expressions in place of equivalent expressions in the result set or in the WHERE clause. This check-in compiles but is mostly untested. FossilOrigin-Name: a52ef2ad7c0e14b78b801f16a1f6ea8d8fa9ae5d7d810e18dd24c600b662a312
* Query planner optimization to detect empty tables in a join early and bail outdrh2017-02-15
| | | | | without doing excess work. FossilOrigin-Name: 58797e9bafa95709e0f706a15f42f93b409e2db5
* Avoid redundant table b-tree cursor seeks in UPDATE statements that use thedan2017-01-28
| | | | | two-pass strategy. FossilOrigin-Name: dc555b1039c6930f6d15355c698ff917a85e8056
* The use P4_DYNAMIC in place of the P4_MPRINTF operand type.drh2016-12-07
| | | FossilOrigin-Name: 3954f83798ed78527280c9db6360c62a5134b9ec
* Performance improvement and size reduction in the Expr node allocatordrh2016-12-06
| | | | | function sqlite3PExpr(). FossilOrigin-Name: 2a81763e68cdf9b8c46389b1e1a87bc2084b53e7
* Disable the query flattener optimization for SELECT statements that are ondrh2016-11-17
| | | | | | | | 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. FossilOrigin-Name: 005d5b870625d175fdf3c0e87d974006c569d9e1
* Enhance the OP_IdxInsert opcode to optionally accept unpacked key material.drh2016-11-09
| | | FossilOrigin-Name: 89d958abbac45f2ca5954080cd9e74ec9a07ebb2
* Make sure indexes on expressions skip over initial NULL values in thedrh2016-10-10
| | | | | index. Fix for ticket [4baa464912129477f3c9] FossilOrigin-Name: 71797ba431085f9ae381ed5ea6471967926f4043
* Fix harmless compiler warnings.drh2016-10-05
| | | FossilOrigin-Name: 2dde3375124198560c8ff15f87aadde2afd722c5
* Allocate Parse objects off of the stack where appropriate for a substantialdrh2016-10-03
| | | | | performance increase and a size reduction. FossilOrigin-Name: ea8affa9e453b201b479162f621b591e7a65a489
* Fix a problem causing incorrect code to be generated for IN constraints like ↵dan2016-09-16
| | | | | "a IN (1, 2, 3)" where column "a" is a rowid column with an extra UNIQUE index created on it. Ticket [0eab1ac759]. FossilOrigin-Name: a92aee5520cfaf85ae896365a7e42bdd981f828d
* Replace a faulty assert() with a testcase() to assure the condition isdrh2016-09-16
| | | | | tested. FossilOrigin-Name: a49bc0a8244feb08b83e716d81c2a9512c184539
* Fix a problem handling expressions like "(a, b) IN (SELECT ... ORDER BY 1, ↵dan2016-09-07
| | | | | 2)" when there is an index on "a" but not "b". FossilOrigin-Name: 7f2c5c9ee3628c968306a5ab2e5a9a761f1b8055
* Simplify the affinity handling logic in codeAllEqualityTerms(). Logicallydrh2016-09-07
| | | | | the same, just a little easier to read and understand. FossilOrigin-Name: bbab9621f512b04684163b98b6fc669c68038044
* Avoid unnecessary memory allocations for aiMap in codeEqualityConstraints.drh2016-09-06
| | | FossilOrigin-Name: 70319c3d76abd1e403fcf2a62668736b92a5f3d5