6f654a40e8
Within a loop that uses a non-covering index test, test non-indexed terms that
...
can be tested without seeking the main table cursor before those that cannot.
FossilOrigin-Name: afe68f0a8060dc5c92cb1fb32a9f22bd36140cd2c0bb5b6cea853e169c5ed444
2017-04-28 19:59:55 +00:00
eac5fc0476
Improved comments. Fix a problem when an indexed expression is used in an
...
ORDER BY clause.
FossilOrigin-Name: c59eaf2b7cd2596733f349fc0fe979f71fd29bd73152a0c57066e0b69d5b7a4a
2017-04-11 01:01:27 +00:00
aca19e19a8
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.
FossilOrigin-Name: a52ef2ad7c0e14b78b801f16a1f6ea8d8fa9ae5d7d810e18dd24c600b662a312
2017-04-07 19:41:31 +00:00
3a3b420abb
Query planner optimization to detect empty tables in a join early and bail out
...
without doing excess work.
FossilOrigin-Name: 58797e9bafa95709e0f706a15f42f93b409e2db5
2017-02-15 22:36:15 +00:00
f64ece143c
Avoid redundant table b-tree cursor seeks in UPDATE statements that use the
...
two-pass strategy.
FossilOrigin-Name: dc555b1039c6930f6d15355c698ff917a85e8056
2017-01-28 19:45:34 +00:00
861b1307cb
The use P4_DYNAMIC in place of the P4_MPRINTF operand type.
...
FossilOrigin-Name: 3954f83798ed78527280c9db6360c62a5134b9ec
2016-12-07 20:22:31 +00:00
abfd35ea03
Performance improvement and size reduction in the Expr node allocator
...
function sqlite3PExpr().
FossilOrigin-Name: 2a81763e68cdf9b8c46389b1e1a87bc2084b53e7
2016-12-06 22:47:23 +00:00
54cda4edbe
Disable the query flattener optimization for SELECT statements that are on
...
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
2016-11-17 13:13:25 +00:00
9b4eaebc68
Enhance the OP_IdxInsert opcode to optionally accept unpacked key material.
...
FossilOrigin-Name: 89d958abbac45f2ca5954080cd9e74ec9a07ebb2
2016-11-09 00:10:33 +00:00
48590fcb37
Make sure indexes on expressions skip over initial NULL values in the
...
index. Fix for ticket [4baa464912129477f3c9]
FossilOrigin-Name: 71797ba431085f9ae381ed5ea6471967926f4043
2016-10-10 13:29:15 +00:00
e3c6b61cee
Fix harmless compiler warnings.
...
FossilOrigin-Name: 2dde3375124198560c8ff15f87aadde2afd722c5
2016-10-05 20:10:32 +00:00
cb43a937e5
Allocate Parse objects off of the stack where appropriate for a substantial
...
performance increase and a size reduction.
FossilOrigin-Name: ea8affa9e453b201b479162f621b591e7a65a489
2016-10-03 01:21:51 +00:00
edc3537c61
Fix a problem causing incorrect code to be generated for IN constraints like "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
2016-09-16 16:30:57 +00:00
72d5003ed8
Replace a faulty assert() with a testcase() to assure the condition is
...
tested.
FossilOrigin-Name: a49bc0a8244feb08b83e716d81c2a9512c184539
2016-09-16 15:42:17 +00:00
26c8d0ca21
Fix a problem handling expressions like "(a, b) IN (SELECT ... ORDER BY 1, 2)" when there is an index on "a" but not "b".
...
FossilOrigin-Name: 7f2c5c9ee3628c968306a5ab2e5a9a761f1b8055
2016-09-07 19:37:20 +00:00
c097e122b9
Simplify the affinity handling logic in codeAllEqualityTerms(). Logically
...
the same, just a little easier to read and understand.
FossilOrigin-Name: bbab9621f512b04684163b98b6fc669c68038044
2016-09-07 13:30:40 +00:00
c7a77ae1c6
Avoid unnecessary memory allocations for aiMap in codeEqualityConstraints.
...
FossilOrigin-Name: 70319c3d76abd1e403fcf2a62668736b92a5f3d5
2016-09-06 17:13:40 +00:00
aaf8a0643e
Avoid a NULL pointer deref in codeAllEqualityConstraints() following an OOM.
...
FossilOrigin-Name: c6e528c1c0f17c69c7745b018afa36694118258f
2016-09-06 16:53:53 +00:00
1c12657f9a
Simplify the fix in commit [7d9bd22c].
...
FossilOrigin-Name: bd5a342008575bf66f63881a0bebf43741f2a67b
2016-09-06 16:33:24 +00:00
099a0f5f54
Fix the header comment on codeEqualityTerm().
...
FossilOrigin-Name: b7e710e406ed22bcc316099b5e200b6bb2d9c872
2016-09-06 15:25:53 +00:00
83c434e68d
Fix a problem handling (a, b) IN (SELECT ...) expressions when there is an index on just one of "a" or "b".
...
FossilOrigin-Name: 231c72d9f651f3a70d5c8af080f3ff181b89d939
2016-09-06 14:58:15 +00:00
2718960316
Consider the affinity of "b" when using an "a IN (SELECT b ...)" expression with an index on "a". Fix for [199df416].
...
FossilOrigin-Name: f5e49855412e389a8a410db5d7ffb2e3634c5fa3
2016-09-03 15:31:20 +00:00
0c36fca004
Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS()
...
macros on unreachable branches.
FossilOrigin-Name: 87d40195ae5cc2abd9bae45073a615db81263285
2016-08-26 18:17:08 +00:00
b7ca2177d7
Fix a problem with affinity changes and vector range comparisons.
...
FossilOrigin-Name: b34413ac7e34369b4420e57b0132249dca68a7b0
2016-08-26 17:54:46 +00:00
7887d7f24d
Fix a buffer overrun in the code for handling IN(...) operators when the LHS of the operator contains indexed columns or expressions.
...
FossilOrigin-Name: f41a0391b732a8c4ad188163f34a0f4a22237bb5
2016-08-24 12:22:17 +00:00
ac6b47d164
The previous OOM fix was bad. Back it out and replace it with a better one.
...
FossilOrigin-Name: 1e3bc3698a4b779e6af8e3c727929c4dbddf3edb
2016-08-24 00:51:48 +00:00
fc7f27b9d2
Change the way TK_SELECT_COLUMN is handled so that the subquery is only
...
generated once even if part of the vector comparison is used for indexing
and the other part is now. This change also is a pathway to vector assignment
in UPDATE statements.
FossilOrigin-Name: d8feea7dcde83179bff303072426561cfe825e58
2016-08-20 00:07:01 +00:00
4602b8e89d
Fix an obsolete comment on codeEqualityTerm(). No changes to code.
...
FossilOrigin-Name: d07be5afb0a915769382dfd815403f8832cb3eec
2016-08-19 18:28:00 +00:00
03181c8c27
Fix a SQL NULL handling bug in the vector IN operator code generation.
...
FossilOrigin-Name: 936146b12e27784f15a68fe65732c6d92c3a12f3
2016-08-18 19:04:57 +00:00
6256c1c242
Fix some cases involving row values and virtual tables.
...
FossilOrigin-Name: 156a41f30a0afd9a70e6c26470dcc468a11bd402
2016-08-08 20:15:41 +00:00
1d9bc9b7a0
Fix the EXPLAIN QUERY PLAN output for row value range constaints that use an index.
...
FossilOrigin-Name: bb60651163553c5e46bf7b2805490570cea647b8
2016-08-08 18:42:08 +00:00
f9b2e05c75
Fix SQLITE_OMIT_SUBQUERY builds.
...
FossilOrigin-Name: 339f85f414a484e44d2502d1ff7281caf9b7c838
2016-08-02 17:45:00 +00:00
553168c706
Fix a problem with vector range constraints involving the rowid column. And other issues.
...
FossilOrigin-Name: 3ef75d45ebcd8ede91596d69e55fe7d685008a60
2016-08-01 20:14:31 +00:00
625015e0c9
Remove the EP_Vector expression flag.
...
FossilOrigin-Name: e9d9c6d46b46160fad6aa6e3441a65a09157515f
2016-07-30 16:39:28 +00:00
19ff12dd76
Fix some issues with vector range constraints and the column cache. Also vector range constraints and rowid columns.
...
FossilOrigin-Name: 42607366bfc2dceb1013797a973b3b8df75dcb4d
2016-07-29 20:58:19 +00:00
145b4ea519
Change the way "(a, b) = (SELECT *)" expressions are handled in where.c if there is an index on one of the columns only.
...
FossilOrigin-Name: 4dfebff2924f46284d5b9cda69175f79b29d6028
2016-07-29 18:12:12 +00:00
d9ed09d47b
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: d4f3d52c5a11fc7ad7e8cad76361edbcef13a12f
2016-07-26 18:15:35 +00:00
8da209b169
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.
...
FossilOrigin-Name: 061b8006034f06a0311b4304c8b14d2c8b0153df
2016-07-26 18:06:08 +00:00
426f4ab009
Make sure affinity is applied correctly on lower-bound range constraints
...
in the min() optimization. Fix for ticket [a0bac8b3c3d1bb].
FossilOrigin-Name: b819bace9c2a0b0159122b26db96a8f50a6f0eac
2016-07-26 04:31:14 +00:00
ba00e30a3a
Allow vector IN(SELECT ...) expressions to use an index if either all the indexed columns are declared NOT NULL or if there is no difference between the expression evaluating to 0 and NULL (as in a WHERE clause).
...
FossilOrigin-Name: e2fd6f49b1b145bec09c581cc982b89429643ae9
2016-07-23 20:24:06 +00:00
709947a315
Merge comment typo fixes from trunk.
...
FossilOrigin-Name: 728c5aa436a5f55c86b019c415a2b71d1b0a8fd6
2016-07-10 19:35:45 +00:00
e234cfd11f
Fix typos in comments. No changes to code.
...
FossilOrigin-Name: 77c692a6704cd877ba35d0afb774ab9b46364d59
2016-07-10 19:35:10 +00:00
71c57db099
Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch.
...
FossilOrigin-Name: b2204215b231202aef7a218411cc2ddaecf28f35
2016-07-09 20:23:55 +00:00
2b693d63e4
Allow LIKE operators that appear in a WHERE clause to be included in the cursor-hint for a cursor on the rhs of a LEFT JOIN.
...
FossilOrigin-Name: 7455d932f5079ffe40462a8c119fc22b8a9bcbcc
2016-06-20 17:22:06 +00:00
e6912fd819
Include WHERE terms in the cursor-hint passed to a cursor opened for the rhs of a LEFT JOIN iff we can be sure that those terms will not evaluate to true if the LEFT JOIN generates a row of NULLs.
...
FossilOrigin-Name: 998095aba01b75f685ed981b377e1dfe650d9bbf
2016-06-17 19:27:13 +00:00
b324cf756e
If a table is on the rhs of a LEFT JOIN, include only terms from the joins ON(...) clause in the cursor-hint passed via OP_CursorHint.
...
FossilOrigin-Name: 2a2346b04235c6d0b7a8e64c92ee31018285c29f
2016-06-17 14:33:32 +00:00
eeb9565a3e
Add a new OP_SeekRowid opcode, that combines the functions of OP_MustBeInt
...
and OP_NotExists. This makes the code slightly smaller and faster.
FossilOrigin-Name: ffe80a1bfa014943a614fc6993c1749b9bfec4c1
2016-05-26 20:56:38 +00:00
ce943bc834
Clean up the WHERE_* macros used for the wctrlFlags parameter on the
...
sqlite3WhereBegin() interface, freeing up some bits to be used for other things.
FossilOrigin-Name: d01305841da94b2d47e32744802f69525bf590df
2016-05-19 18:56:33 +00:00
a72a15e45a
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface.
...
FossilOrigin-Name: da94a6e0ebacad8f235dcd653a25474327f26137
2016-05-09 19:58:56 +00:00
f09c48233a
Simplification to the logic used to decide between OP_Seek and OP_NotExists.
...
Use OP_NotExists for both DELETE and UPDATE.
FossilOrigin-Name: 3a695263183303e3f64eb2320752d0fdef53eaf2
2016-05-06 20:23:12 +00:00