aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
Commit message (Collapse)AuthorAge
...
* 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
* Improved byte-code comments for the OP_Column opcodes used by thedrh2022-10-18
| | | | | indexed expression optimization. FossilOrigin-Name: bf6d837fddbf74d5b3f40ad01ea4564edfac00b651d6f3f0e996cc5dc18bb06c
* Fix the indexed expression resolver for generated columns so that it picksdrh2022-10-18
| | | | | the correct table in a self-join. FossilOrigin-Name: 54c3eb085aca92da2b819f3532ee4750b377265f7e1e914600ea3c3d535efe51
* Improved comments and function names. No logic changes.drh2022-10-17
| | | FossilOrigin-Name: 8f460b3b15bf4b88a224907d2f83e4ed6bf84d6b3f480008a1b187ea49c6ce1d
* Enable the index-on-expression optimization even when the expression isdrh2022-10-15
| | | | | used as an argument to an aggregate function. FossilOrigin-Name: 462b3c7f39724dc814f55e7a225e7d0c48f81c524cdda797a66e9e198c35ce58
* Only extract an expression from an index when the index is not a null rowdrh2022-10-15
| | | | | in an outer join. FossilOrigin-Name: 08b033c737d1a84859291f50e2985c9dad8d660a50185d55d3171165a8e08d4c
* This experimental branch attempts to use columns for an index-on-expressiondrh2022-10-13
| | | | | | in place of the expression that is being indexed. This particular check-in mostly works, but there are still issues. FossilOrigin-Name: 2e8d4fd4cfd9e82f33c707ba246fe2bb3ca01762cf5ac5905058fbc7adf0abe7
* Proposed optimization to the IS NULL and NOT NULL operators that avoidsdrh2022-10-13
| | | | | | loading the entire content of larges strings and BLOBs. Response to [forum:/info/3c08d4715dc05b00|forum post 3c08d4715dc05b00]. FossilOrigin-Name: 45f171565442f9fd6574fb93ae7abe83c168b20be68af42531bc55571450d3ab
* Modify the OP_IfNotOpen opcode so that the jump is taken if the cursor is opendrh2022-09-20
| | | | | but was previously set to a NULL row using OP_NullRow. FossilOrigin-Name: 1292d68caa7086610ddda343f3852e63de8da1eb66536ee4716b6529f5a31bc6
* Is the query flattener restriction 29 (do not allow both EP_InnerON anddrh2022-09-20
| | | | | | | | | EP_OuterON constraints on the same FROM clause term) really necessary? This branch explores what happens if we omit that restriction. This is an effort to address the performance regression reported by [forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda] that is caused by flattener restriction 29. FossilOrigin-Name: 19270577ad1d08c9e6e5f0600396b8a1ccda9df1e67a0df845aee6b60437f379
* 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
* Make sure IF_NULL_ROW expressions receive a separate slot in the sorter useddrh2022-07-26
| | | | | to implement GROUP BY. FossilOrigin-Name: 2bda4fca06ab6be5ad02377a7d1fd9fb9586e3181f1052e4b4937958bdd45efe
* Improved AggInfo.aCol debugging output, intended to debug a problem withdrh2022-07-26
| | | | | LEFT JOIN flattening into an aggregate query with GROUP BY. FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c
* Fix an assert() that was made out-of-date by [b52393ac28debe98].drh2022-07-25
| | | FossilOrigin-Name: db8230e80ed894fc2801cdbb53c2cd9de00192d7f4d8328c29cc214e2e0adde9
* Performance optimization in computing the Expr.nHeight field.drh2022-07-25
| | | FossilOrigin-Name: 1798ce97c8763d75315e1716d10f6c5be301042c174f41ee8c1fb8d9db99d52b
* Small performance increase and size reduction by splitting out thedrh2022-07-25
| | | | | sqlite3VdbeGetLastOp() from sqlite3VdbeGetOp(). FossilOrigin-Name: 92ac01d41d46ab73e189b1e5596ea63e5edb5b15639c5d7bdb981b95366c069b
* Allow subqueries on the right-hand side of a LEFT JOIN to be flattened evendrh2022-07-25
| | | | | if they contain a GROUP BY clause. FossilOrigin-Name: 816da9a893ae97a21463562479edb419a8b511ae731d86eccee3fa6e3e7dc96e
* TK_IF_NULL_ROW expressions must be accumulated in the same way as TK_COLUMNdrh2022-07-25
| | | | | | expressions in an aggregate query. Proposed fix for the problem identifyed by dbsqlfuzz 8e17857db2c5a9294c975123ac807156a6559f13. FossilOrigin-Name: 40d08807209638aad728be2cedbc904e342e76c8e486c364bd571b55dd2e1e87
* Use sqlite3ParserAddCleanup() rather than pParse->pConstExpr to implementdrh2022-07-23
| | | | | | sqlite3ExprDeferredDelete(). This is a better solution than check-in [c538d07535092722]. FossilOrigin-Name: 2a6f6971fa010219323b976ff53b2606e39fb43fd36c394837c3a8528bf3c425
* Omit the EP_MemToken flag that was made obsolete by [e1f1cfe7f4387b60], fordrh2022-07-22
| | | | | a size reduction and performance increase. FossilOrigin-Name: 28934a9d92d5e5ac862a0dc7169f071f39047f98dc79441db697cf353a4b9433
* In a TK_BLOB Expr node, the Expr.zToken might not be a well-formeddrh2022-07-22
| | | | | | BLOB literal if there has been a prior OOM. dbsqlfuzz 23871e5805d6c45b392f9b7aa1e8a2b98f3c27cd. FossilOrigin-Name: c538d075350927222ab0a6598b844f7b15153c5dc008d71b921a2b73c4f4a7a4
* Make use of the sqlite3ExprDeferredDelete() interface in the previousdrh2022-07-20
| | | | | check-in, and in another place where it might be helpful. FossilOrigin-Name: 22f90e9683d5cd6619ccdb06a02e9dde9f4b7457391c0dbb4c3216c22fc0db47
* The subtype of a value should not propagate across a subquery boundary.drh2022-06-09
| | | | | | | Proposed fix for the problem reported by [forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78]. Additional works is needed as not all cases are covered. FossilOrigin-Name: 08af1fe27ebd0edf6e0f1ac477deea033e7f7c813f1016b75196836daf02d2e4
* Only include the code for sqlite_offset() if compiled withdrh2022-06-01
| | | | | -DSQLITE_ENABLE_OFFSET_SQL_FUNC. FossilOrigin-Name: 382cd7e10b2df4216da8f25b55546bc74a963d9834af240f75ec8b8321ba106e
* Move the sqlite_offset() function implementation to be an in-line function,drh2022-06-01
| | | | | | thereby avoiding special case code and freeing up a bit in the FuncDef.flags field. FossilOrigin-Name: 1c9812c458bd229c862efe5df1b64fae333da9871c8756b5ae4605a81bcda4b5
* Change an unreachable branch into an assert().drh2022-05-13
| | | FossilOrigin-Name: 778e57a558dc3f819ca57623bcb85f58c8fbeb28bc12a1e2edbdd1244e9107c5
* 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
* Redefine the acccess rules for the Expr.w union so that the Expr.w.iJoindrh2022-05-13
| | | | | member is accessible on either EP_OuterON or EP_InnerON. FossilOrigin-Name: 6f741d6cfb8831a3ac966257ac4519bcc8156293447bf50323c2d9b170125974
* Improved names for flags on the Expr object: EP_FromJoin becamesdrh2022-05-13
| | | | | EP_OuterON and EP_InnerJoin becomes EP_InnerON. FossilOrigin-Name: 1ffea07ff98b894729c698b681cc7433df3bbfccd8a0529a706908602a636937
* Organize the various flag bits of the ExprList_item object into a substructuredrh2022-05-02
| | | | | so that the whole lot can be copied all at once. Faster and smaller code. FossilOrigin-Name: 5341d4bbe9a943f9cdbbdea829e18f108e98972ebb706396c50fc62fcc6a6328
* Name resolution and "*" wildcard expansion for parenthesized FROM clausesdrh2022-05-02
| | | | | | seems to work the same as PG. The code is chaos, however, and needs some cleanup. FossilOrigin-Name: 6f9c0b07aadc5189c65c3ee4e6938aac10fc0d98f1cb06980f5e5d7b0308f237
* Merge the latest trunk fixes and enhancements into the right-join branch.drh2022-05-02
|\ | | | | FossilOrigin-Name: afbcf075c1e09ae064c7b16e63501cd1d374711812664aef76bd35d02d64a2b6
| * Improvement on check-in [a193749730d6cfba] so that the subroutine call todrh2022-05-02
| | | | | | | | | | | | the IN operator right-hand side generator from the RIGHT JOIN no-match logic does not generate unreachable byte code. FossilOrigin-Name: cc458317bd77046c4328715ae9e3409f3f4cd422a01162cb33405ef3a142b0a3
| * Bring the comments on sqlite3FindInIndex() into closer alignment with whatdrh2022-05-02
| | | | | | | | | | that routine actually does. FossilOrigin-Name: 40f3274745b53bb72933c1052d0e85bc74be56d3a1068e9d54dc28763a2cfef9
* | Merge trunk enhancements into the right-join branch.drh2022-04-28
|\| | | | | FossilOrigin-Name: 3fd9706bba4a71cb5c7ce1341c3be0a7727941445820a073e7b2f0f32512e8ef
| * Fix a harmless typo in a comment.drh2022-04-27
| | | | | | FossilOrigin-Name: e1f4a115df34e45cf1bcf98961c699b582f564a58a979e95853b219bda06212c
| * Fix a problem with automatic indexes introduced bydrh2022-04-25
| | | | | | | | | | | | check-in [664b461bb5063d980] and reported by [forum:/forumpost/0d3200f4f3bcd3a3|forum post 0d3200f4f3bcd3a3]. FossilOrigin-Name: 7ca3456c00998a429418ff29cf251b381586b330b88344c94a40c5df0b71da85
* | Fix minor problems with the new join table name resolution logic.drh2022-04-23
|/ | | FossilOrigin-Name: 3a6b0db4519072dbd41b1c105bf1a0c6b4dd90380e94a5662645d8d41483c707
* Honor the MATERIALIZED keyword on a common table expression by not flatteningdrh2022-04-22
| | | | | the CTE into an outer query. FossilOrigin-Name: 8d631a6b9eb06b54b10eda595a4c588ca38f909b4afa653b24d1f720b55d72f7
* Avoid materializing columns of SF_NestedFrom subqueries that are never used.drh2022-04-21
| | | | | Other code improvements manually imported from the right-join-paren branch. FossilOrigin-Name: cd8272fc2a34d1b245fd95208b9b601266ee7d2ff0f5ce52d03752f2c4e852a2
* Improved comment field in the bytecode generated for OP_Column and OP_Rowid.drh2022-04-18
| | | FossilOrigin-Name: 009bbf8026106c5a74cced06cced48badb870a4b6e6a2f8104a544d2a8d79e45
* Change OP_Return such that if P3 is 1, the Return is a no-op when thedrh2022-04-17
| | | | | P1 register contains a NULL. FossilOrigin-Name: c90602328a4b26f06d76c5343d29ebb7a782186c86ea88f5965a41040cff5346
* Enhance the IdList object to exist in a single memory allocation (rather thandrh2022-04-15
| | | | | | a separate allocate for the base object and the array of IDs). Also permit an IdList object to store an Expr pointer together with each name. FossilOrigin-Name: 40f3c95871e6f40f287ef2756abafb8fc56dffdd0af69436e5c7d8e95022d94e
* Another instance of indenting a subroutine.drh2022-04-14
| | | FossilOrigin-Name: 73f4036b04798660b30e540cbab69420078df9fb62a6a39944e078c36272f905
* Rerun the subroutines that compute row-values if necessary from withindrh2022-04-14
| | | | | the RIGHT JOIN body subroutine. FossilOrigin-Name: 9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59
* Adjust the output formatting of bytecode listings so that subroutines useddrh2022-04-14
| | | | | to implement subqueries are indented one level. FossilOrigin-Name: 079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d
* Fix some comments that refer to LEFT JOIN that should refer to OUTER JOIN.drh2022-04-11
| | | | | No changes to code. FossilOrigin-Name: 5be5ede5cca1cd5ef863fe0feb2b4a990f4a42865281a6c2e4eb816f48847dc6
* Improved technique for parsing the ON and USING clauses of a join is fasterdrh2022-04-07
| | | | | and uses less memory. FossilOrigin-Name: 158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
* Add the new OP_BeginSubrtn opcode (which is really an alias for OP_Integer)drh2022-03-03
| | | | | | and make other changes so that the span of a subroutine that implements a subquery is more readily apparent in bytecode listings. FossilOrigin-Name: b8226748709de37cfc86414714c20567254e5b320b380e767c322dba69a79d49
* Faster computation of Expr.nHeight.drh2022-02-06
| | | FossilOrigin-Name: a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89