aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
Commit message (Collapse)AuthorAge
* Fix a minor typo in a code comment.drh2025-04-15
| | | FossilOrigin-Name: 158e8c4fd7bdfc1cd4c0135abecd0d00994cd4027cf74ce6e5cf73d76475ae95
* Remove unnecessary "www." prefixes on domain names in URLs.drh2025-04-10
| | | FossilOrigin-Name: 20acd630b91609725794ce84f9eda01d5f3c898407f0948264830851d25ccaa6
* Make use of the flexible-array feature of C99, when available, to try todrh2025-03-14
| | | | | | pacify -fsanitize=strict-bounds. This check-in fixes the core. There is more yet to do in FTS3, RTREE, and in FTS5. FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
* Fix comments on the Parse.nMaxArgs field so that they are correct. Adddrh2025-02-07
| | | | | | assert()s to ensure they are correct. Other Parse changes to reduce the amount of memset() needed to initialize it. FossilOrigin-Name: c56092507c96723030589ddd9121bc993d615a7acd453305fc3b1dbb9e30554c
* Bug fix in the SubrtnSig logic from [c9a3498113074bbc], if a subquery isdrh2024-11-20
| | | | | | | | copied and then changes are made to the copy, be sure to give the copy a unique Select.selId value so that the original will not be substituted in place of the modified copy. [forum:/forumpost/0b9ded2f8428ac00|Forum post 0b9ded2f8428ac00]. FossilOrigin-Name: 19d1bede5654bcfa9f7a151b9b2616a3d10873b8e3f8cf54a3a7e810da08f844
* Fix harmless compiler warnings in wherecode.c. One such warning wasdrh2024-10-23
| | | | | | identified by [forum:/forumpost/721675f007|forum post 721675f007] and the other was found by tool/warnings.sh. FossilOrigin-Name: 987b96aa636c1801f87d3e1c75d34d45c5b6f437bcc6d150298675447ed16b5d
* Experimental change to explain query plan to identify covering indexes on ↵dan2024-10-11
| | | | | expressions. FossilOrigin-Name: 3bb03a2891e30c58b66e3665a8877a8eab4a8bac57ee153d8d31358caeaf4b7c
* Add the SQLITE_INDEX_SCAN_HEX bit to the sqlite3_index_info.idxFlags bitmask.drh2024-08-22
| | | | | | 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. FossilOrigin-Name: 6c00e88ebdb41d6317bb8758825521614dedc2e6e6289ff415c5f0406eed815b
* Refactor the SrcItem object so that information about subqueries is storeddrh2024-08-19
| | | | | | | | | in a separately allocated Subquery object. This reduces the memory requirements for SrcItem and makes the code run faster. It also provides an expansion path for subquery processing that does not burden simple queries. The current checking mostly works, but there are still issues that need to be tracked down and fixed. FossilOrigin-Name: 8ff5dda8448d7e1a533d7f27db2573ce68fa9956b9d9847ced45e83c1f06bab0
* Give unique names to fields in the SrcItem object, to facilitate analysis ofdrh2024-08-17
| | | | | how those fields are used using "grep". FossilOrigin-Name: 9f5aeef3cbc2c95267c8f7bf60d5c66971a76789669fb0e8f853273ff6f616f2
* Small performance optimization in the codeEqualityTerm() routine of thedrh2024-06-05
| | | | | code generator. FossilOrigin-Name: 8080c6eafd1280ea870a6ab1ba715ac5af67387e69771be6cbd46dda77c3eaa8
* Document the OP_Explain opcode. Add the WhereLoop.rRun value as P3 indrh2024-05-31
| | | | | OP_Explain opcodes associated with WhereLoops, for testing purposes. FossilOrigin-Name: 996c46e61d9a53a54018672dd407b8ba8c480dd6795393428f9d5fcb81b47ab5
* When omitting result columns for the vector-IN optimization, make sure thatdrh2024-05-24
| | | | | | any result-set column references in both the ORDER BY clause and the GROUP BY clause are updated appropriately. FossilOrigin-Name: f890812df0a57fcd201647640d8b9ee26047cd93cd7171bc6fd050f574649345
* Improvements to a VDBE comment. No changes to anything that affects queries.drh2024-05-17
| | | FossilOrigin-Name: c2188da860a1debd7c5d28b223deeef15035c33c2c5aefae9d9b620b6a2b4677
* Fix a problem with queries that use "IN(...) ORDER BY ... NULLS LAST" or ↵dan2024-05-02
| | | | | similar introduced by [d7648e21605a0b38]. FossilOrigin-Name: 26b2d9390f1273ee0e3f3c96f6bc5bf0e9c1dcfd0d9ecd993dba487ef5a07f7e
* Avoid an OP_Next in cases where an IN(...) query against a UNIQUE index may ↵dan2024-05-01
| | | | | return at most 1 row. FossilOrigin-Name: 560f64157d2fe40e107582eebb6526185c9c43305e364f4132e182dbec5b210a
* Extra robustness in the code that causes cursors to return NULL when theydrh2024-04-22
| | | | | are participating in an OUTER JOIN. FossilOrigin-Name: 672c2869ef48e08447d37b0d76a1850cdafbe30ca1906ec98c55e3ab496fd9a6
* Continuation of the fix at [8c0f69e0e4ae0a44]: If a viaCoroutine FROM clausedrh2024-04-22
| | | | | | | term is participating in a RIGHT or FULL JOIN, we have to create an always-NULL pseudo-cursor for that term when processing the RIGHT join. dbsqlfuzz 6fd1ff3a64bef4a6c092e8d757548e95698b0df5. FossilOrigin-Name: e1040e51ebd04f2a076f477b6f240f849afb10f543ebe518e09d6842cc3cb38e
* Correct handling of OUTER JOIN when on or the other operand is a subquerydrh2024-04-18
| | | | | | implemented using the VALUES-as-coroutine optimization. dbsqlfuzz bde3bf80aedf25afa56e2997a0545a314765d3f8. FossilOrigin-Name: 8c0f69e0e4ae0a446838cc193bfd4395fd251f3c7659b35ac388e5a0a7650a66
* Add comments to note the name abiguity between the MySQL push-downdrh2024-04-07
| | | | | optimization and the WHERE-clause push-down optimization. FossilOrigin-Name: 3d5fb1ec7a0440072d6e3b957903c85d0f32b8b07207a1ef22d1a69cf5e664d1
* Improve support for sqlite3_stmt_scanstatus_v2() profiling of sub-queries ↵dan2023-06-30
| | | | | implemented as co-routines. FossilOrigin-Name: 4e8718dc35dbbaf75f17265a88d14acd9750dc75efbadf41377f9c97e732009c
* Add a C-source spell-checking facility. make misspell (on Nix)larrybr2023-06-07
| | | FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8
* Simplification, performance improvement, and size reduction in thedrh2023-05-17
| | | | | codeAllEqualityTerms() function of the code generator. FossilOrigin-Name: 4fbe02651e877e442d62308d7f607e503695104cd71c5565132fcd1398c120df
* Fix a bug in cursor hints that can cause references to tables that have notdrh2023-05-04
| | | | | | | been opened. Cursor hints are intended for use by COMDB2 only and should not appear in production builds, so this should not be a factor for the vast majority of users. FossilOrigin-Name: d3370d59cffb7ab982d6c620c93d22aa6a9dc786e1c4af95ca8d45ff0b9b7d6f
* Better handling of OOM errors in the cursor-hint logic.drh2023-04-11
| | | | | dbsqlfuzz 60cd5fff91974af91c2c3692beb4a2d7fdafef46 FossilOrigin-Name: 68fcfb58df837b40e401dfa4e505f4f0b87554b9cfeb2c527f3558348b73c1be
* New assert() statements to validate the parameters todrh2023-04-10
| | | | | | | sqlite3BtreeCursorHint(). Fix a problem with the construction of those parameters discovered by [forum:/forumpost/0b53708c95|forum post 0b53708c95]. FossilOrigin-Name: 4c5a3c5fb351cc1c2ce16c33314ce19c53531f09263f87456283d9d756002f9d
* Omit a branch that is no longer needed following [c9c4f287652933eb].drh2023-03-30
| | | FossilOrigin-Name: 960a488a2db92f5437bc8171cdbed44618d9381c57fd41b2f0e357b6012c80b5
* Avoid having OP_SeekScan jump over an OP_IdxGT or OP_IdxGE that follows the ↵dan2023-03-29
| | | | | OP_SeekGE opcode. Fix for [b50528af4468237c]. FossilOrigin-Name: c9c4f287652933eb6262a3419efe7e7288f55d3db7e2ac032eeae025f665d306
* Add an sqlite3_db_config() option - SQLITE_DBCONFIG_STMT_SCANSTATS - for ↵dan2023-02-28
| | | | | enabling and disabling the collection of sqlite3_stmt_scanstats() statistics in SQLITE_ENABLE_STMT_SCANSTATUS builds. Collection of statistics is disabled by default. FossilOrigin-Name: 0f5579bef27b84ee855065cfe87703c51e1f9773906a9e0d4e4dafc90bd0e553
* Allow vector-IN expressions like "(a, b) IN ( (?,?), (?,?) )" to use an index.dan2023-02-13
| | | FossilOrigin-Name: 1815b15ddb8785a25b7617aab19e13c2410b9377389c16a85176025b3d9400e8
* Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not ↵dan2022-12-06
| | | | | just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop. FossilOrigin-Name: 9499b2f51e8174c6b8a67840c92ba23b7dd1dc8dc2b91fca0c5dc07b71662149
* Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.dan2022-12-03
| | | FossilOrigin-Name: 622d8eb3724bee617b55d6fb71f1a2d683db6858065adced6bf3ce9525bcd6b5
* Enhance the sqlite3_stmt_scanstatus() API and add ↵dan2022-12-02
| | | | | sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports. FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
* Attempt to rationalize the bits associated with ".wheretrace". Providedrh2022-11-30
| | | | | a decoder key in sqliteInt.h for what each bit is intended to do. FossilOrigin-Name: 8ec361695a107a94f2cf6a7fe509656a99d85d49bd7c74133c69903f059a2675
* This branch attempts to improve the detection of covering indexes. Thisdrh2022-10-22
| | | | | | | 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. FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244
* The generalized indexed expression optimization of [2435112867fbd7b6] makesdrh2022-10-20
| | | | | | the prior [a47efb7c8520a011] enhancement from 2017 obsolete. This check-in removes the older optimization. FossilOrigin-Name: 56442c9bdd7844454c79acf83323380ea3509cb2e0b9a3d538a6b51726ae6d07
* Remove a use of alloca() that does more harm than good.drh2022-10-17
| | | FossilOrigin-Name: 2ab3cf4d71b23a4c0b69f977828d82df7bbc080c29ae189e0d78d38efee50c96
* Fix a problem causing the seek-scan optimization to skip over valid rows ↵dan2022-10-07
| | | | | that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520. FossilOrigin-Name: 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633
* Fix a problem that occurred when using a bloom filter to optimize an (ipk = ↵dan2022-10-06
| | | | | ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by [forum:/forumpost/f61a8b7053|forum post f61a8b7053]. FossilOrigin-Name: 8e14c351b29bb434ac4e2510681e95716424a73e340d39feff4919f0431c2e00
* Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both thedrh2022-08-22
| | | | | | | db and ptr parameters are guaranteed to be non-NULL. Use this where appropriate to save more than 2 million CPU cycles on the standard performance test. FossilOrigin-Name: e5eaa80e81fdf86f2875a912b880272b8d099b82b08e945a7988c5dd0fe9d6b5
* Improvement on the previous check-in.drh2022-08-03
| | | FossilOrigin-Name: c1ab0ea2959259cbd29f624bfd5e7366035f2dbcaab72c0bf55723c0919b7a79
* For an IN operator used with a RIGHT JOIN, use the number of terms in thedrh2022-08-03
| | | | | | vector, not the number of equality terms, to size the column map. dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657. FossilOrigin-Name: b184c8d9222da6b420b5d7c439bbe4b737d92ffa27f5e933f4e1a9c8117b0ee5
* Small performance increase and size reduction by splitting out thedrh2022-07-25
| | | | | sqlite3VdbeGetLastOp() from sqlite3VdbeGetOp(). FossilOrigin-Name: 92ac01d41d46ab73e189b1e5596ea63e5edb5b15639c5d7bdb981b95366c069b
* Candidate fix for the problem with row-value WHERE clause constraints ondrh2022-06-01
| | | | | a RIGHT JOIN. FossilOrigin-Name: fdd782a7bb217e2aceda97a588c0d7874ee19885abfcf0658472d6c3387da6ee
* Add back in a test case for ON-clauses that was removed yesterday bydrh2022-05-31
| | | | | [3869fd9a2b9483cbf] but which turned out to be necessary after all. FossilOrigin-Name: aba52a90eef2a5d06e7c499fe84b2efcde7f01e67129058f8223a6a0272aacb9
* For an outer join, then ON-clause constraints need to be evaluated at justdrh2022-05-30
| | | | | | the right moment - not too early and not too late. Fix for the problem reported by [forum:/forumpost/3902c7b833|forum post 3902c7b833]. FossilOrigin-Name: 3869fd9a2b9483cbbf83d8f369c1744abc42f12e63abba402be35dd7e136161c
* Improvements to the decision of when to check ON constraints for an innerdrh2022-05-14
| | | | | | join that is an operand to a RIGHT JOIN. Fix for issue identify by [forum:/forumpost/c06b10ad7e|forum post c06b10ad7e]. FossilOrigin-Name: 9d17233c7d98bf25c1a518d067e778708b3db6d6302edd8d7e376ba0ba4f1c30
* Transitive equality constriants do not work on a RIGHT JOIN, since thedrh2022-05-13
| | | | | right-hand side might be a non-matched row. FossilOrigin-Name: 0f96810b840dd6f209562635b21f55a7ed6210c01336fcfeb3b79e08a615a28d
* Walk back the optimization from check-in [cc458317bd77046c] that tries todrh2022-05-13
| | | | | | | reuse the same ephemeral cursor of a list subquery when that subquery is reused, as it does not work in cases where the list subquery is used both for lookups and for scans. FossilOrigin-Name: 12ee29d632ae4b585ef6bc07d3289d00c121268945dffd5673b251d95874e3f8
* Defer generating WHERE clause constraints for a RIGHT JOIN until after thedrh2022-05-13
| | | | | | | ON-clause processing for the RIGHT JOIN has done its own row elimination. This fixes and incorrect output from some RIGHT JOINs that was identified by [forum:/forumpost/41cc3851d864c5e6|forum post 41cc3851d864c5e6]. FossilOrigin-Name: 238d9c247cf69cc77fdb1af9d42ebe258610a533ac4204e2ddf8af17f24d18c4