drh
57a8c61501
The ORDER BY LIMIT optimization is not valid unless the inner-most IN operator
...
loop is actually used by the query plan.
Fix for ticket [0c4df46116e90f92].
FossilOrigin-Name: 820644b886f81e991fceb5f1c3290b8959b34528
2016-09-07 01:51:46 +00:00
drh
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
drh
0dfa4f6fcc
Allow ROWID values in indexed vector comparisons.
...
FossilOrigin-Name: b0cc6be4eb81f21b11796e1f14d4412bf21dea6e
2016-08-26 13:19:49 +00:00
drh
64bcb8cfbb
Comment improvements. Put ALWAYS and NEVER macros on three unreachable
...
branches.
FossilOrigin-Name: 397617009e07004596476d6f5644fdf84c376f54
2016-08-26 03:42:57 +00:00
drh
a15a8bc822
Show the WhereTerm.iField value on debugging output, when it is non-zero.
...
FossilOrigin-Name: 931c95358d8bc02f3e3d8ee4e545a07b2d2c97e8
2016-08-19 18:40:17 +00:00
dan
17994e3bca
Fix some problems with handling "no such collation sequence" errors.
...
FossilOrigin-Name: 8278be06fa69e3266866220bdaf5be45a5fcfa23
2016-08-11 12:01:52 +00:00
dan
6256c1c242
Fix some cases involving row values and virtual tables.
...
FossilOrigin-Name: 156a41f30a0afd9a70e6c26470dcc468a11bd402
2016-08-08 20:15:41 +00:00
dan
adeb970da2
Merge trunk changes with this branch.
...
FossilOrigin-Name: 0e927a7e0250a65fd8e97b322cd69e93fadd13f0
2016-08-08 16:52:11 +00:00
drh
dd545d3bf2
Make sure the ORDER BY LIMIT optimization is not applied if the inner-most
...
loop can only have a single iteration and is hence not really a loop.
FossilOrigin-Name: 13e3bd3de6b434b6182ef36be108d7ee0be8ca53
2016-08-04 09:09:44 +00:00
dan
3d1fb1dd75
Fix a problem with estimating the number of rows visited by a query that uses a multi-column IN(SELECT...) constraint.
...
FossilOrigin-Name: 3c2f908f5b7312570cfa74afcf4252a857cb5237
2016-08-03 18:00:49 +00:00
dan
2c628ea9d9
Fix another problem involving vector range constraints and mixed ASC/DESC indexes.
...
FossilOrigin-Name: 1559f4c43473e107f7196eea3ee91c53ede22999
2016-08-03 16:39:04 +00:00
dan
d66e5794d1
Fix stat4-based cost estimates for vector range constraints.
...
FossilOrigin-Name: 18af74abc8ceae47ab9fbee3e3e5bb37db8fcba5
2016-08-03 16:14:33 +00:00
dan
d05a7144cd
Fix a problem with vector range constraints and mixed ASC/DESC indexes.
...
FossilOrigin-Name: e2ad30c8b5366fd8e50f36c62345ed03ec613c47
2016-08-02 17:07:51 +00:00
dan
080508a186
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: d468101b421e073e9debd7381bde1d36af31369e
2016-08-02 16:24:10 +00:00
dan
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
mistachkin
19e76b2a7c
Fix harmless compiler warning seen with MSVC.
...
FossilOrigin-Name: 390a38a142d36d2c57b3f21aab72edcde450125d
2016-07-30 18:54:54 +00:00
dan
cb17ce9300
Merge latest trunk with this branch.
...
FossilOrigin-Name: 63ae02d084a332250ff6fd8d8c80e53bf5422a68
2016-07-30 17:59:39 +00:00
drh
99bbcc8287
Undo some unhelpful changes to skip-scan scoring that were added
...
by the check-in [9e2b2681] that improved scoring of index scan.
FossilOrigin-Name: c7d51934a4f30d096bb79fc509fc9dd0df5d89a4
2016-07-29 01:32:36 +00:00
dan
34c125747d
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: 9685880f7baeb670739fdcf2d9df08e22abaa699
2016-07-28 13:59:21 +00:00
dan
d49fd4e89a
Fix some problems with multi-column IN(SELECT...) processing.
...
FossilOrigin-Name: 719a3b2035a335ca8b9704646b1d641011e3ea0e
2016-07-27 19:33:04 +00:00
drh
5f26e00761
Enhance the query planner cost estimation for index scans to take into account
...
WHERE clause terms that can be computed using only the index and that do not
require looking up rows in the original table. This fixes an obscure
performance regression that arose when the ORDER BY LIMIT optimization was
added by check-in [bf46179d44843].
FossilOrigin-Name: 9e2b26811452a5011d0a97a689636fa4409da856
2016-07-27 19:30:53 +00:00
drh
e604ec0be0
Add test cases and fix a comment.
...
FossilOrigin-Name: 50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b
2016-07-27 19:20:58 +00:00
drh
2409f8a112
When estimating the cost of an index scan, factor in the cost savings of
...
being able to use the index to evaluate some WHERE clause terms without
having to do a table lookup.
FossilOrigin-Name: a59b5622f7cc6e502d71aabc12c053582cd03609
2016-07-27 18:27:02 +00:00
dan
d93ba6271b
Initialize a variable in where.c to avoid a valgrind warning.
...
FossilOrigin-Name: 4d59df02d3713b3e3804e1a88e676749b2794286
2016-07-27 16:03:54 +00:00
dan
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
dan
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
drh
05d1bad674
Prevent the WhereLoop.rSetup cost estimate from going negative on complex
...
queries.
FossilOrigin-Name: f81050859170c8708a1b296da8dd3ef0dd314a11
2016-06-26 04:06:28 +00:00
drh
ec5935924d
Fix the build for -DSQLITE_OMIT_VIRTUALTABLE
...
FossilOrigin-Name: 911131424857430d46784b167399ecf192584ca2
2016-06-23 12:35:04 +00:00
drh
8dc570b6af
Prefer to use partial indexes for full table scans when that is possible.
...
FossilOrigin-Name: fe1874321ba31cec9ae65387920c33d8d0178ed8
2016-06-08 18:07:21 +00:00
drh
c84a4020ef
Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and
...
show more details on WhereTerm traces.
FossilOrigin-Name: 71087c12bc75a82f5d1051600a442ef6efc5e899
2016-05-27 12:30:20 +00:00
drh
d711e52229
Appears to work now. Needs test cases, more comments, and code optimization.
...
FossilOrigin-Name: 990fe50c9182f74c9b54a12602c4c30d891273e6
2016-05-19 22:40:04 +00:00
drh
a536df4e7f
In a query with both ORDER BY and LIMIT, if the inner loop satisfies the
...
ORDER BY then try to cut short each invocation of the inner loop once the
LIMIT has been satisfied. This check-in is a partial implementation only.
FossilOrigin-Name: 852d1eda6ecca1171f6ed800b06f5b4854672002
2016-05-19 22:13:37 +00:00
drh
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
drh
a72a15e45a
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface.
...
FossilOrigin-Name: da94a6e0ebacad8f235dcd653a25474327f26137
2016-05-09 19:58:56 +00:00
drh
a3fd75d426
Corrections to comments on the whereScanInit() interface.
...
FossilOrigin-Name: ab7ab415d19524f6c3901e474d3a154f55d28530
2016-05-06 18:47:23 +00:00
drh
44aebff246
Improvements to the way the LIKE optimization is implemented, resulting in
...
slightly smaller and faster code that is easier to test.
FossilOrigin-Name: 54c63b329288729031f45b7778752552cd90e226
2016-05-02 10:25:42 +00:00
drh
f1b5ff73cb
Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what
...
it represents.
FossilOrigin-Name: 5317961411695e107e8cefdeaba62280429979ca
2016-04-14 13:35:26 +00:00
drh
53801efcdf
Limit the number of digits shown in the "prereq" mask for ".wheretrace"
...
debugging output.
FossilOrigin-Name: 3686ed7413ae6cdbc8020c0023205e0455e87467
2016-04-09 14:36:07 +00:00
drh
5996a77987
Enhance the query planner so that IS and IS NULL operators are able to drive
...
an index on a LEFT OUTER JOIN.
FossilOrigin-Name: c648539b52ca28c0b2cb61208e2c32b1d29626a1
2016-03-31 20:40:28 +00:00
drh
892ffcc7fc
Fix the query planner so that it is able to use the integer primary key
...
from an index as part of a multi-column constraint.
FossilOrigin-Name: 96ea9909429f0b3b4a67002e8340ae3f7dc0b73f
2016-03-16 18:26:54 +00:00
dan
ba22f84cc2
Update this branch with latest trunk changes.
...
FossilOrigin-Name: 249cd361b840913794b7cd2f2d42777dcd547a60
2016-03-15 09:42:39 +00:00
drh
bacbbccd16
In the query planner, make sure OOM errors are reported up into
...
whereLoopAddVirtual() so that it shuts down appropriately.
FossilOrigin-Name: a13c59d08bcbc6f26ce6ac761a892eff8f035201
2016-03-09 12:35:18 +00:00
dan
85a18faff9
Merge latest trunk changes with this branch.
...
FossilOrigin-Name: 59caca4387e97231834a3bffdbed8636be4e8e19
2016-03-09 08:08:51 +00:00
dan
94c67eca89
Fix a problem in the schemalint code that comes up when a sub-query uses one or more of the same tables as its parent.
...
FossilOrigin-Name: fc18cc9293fb0080b7152c16baac49f44e2db7b3
2016-03-09 08:07:31 +00:00
drh
d1cca3b721
Change an unreachable branch in the virtual table query planner into
...
an assert().
FossilOrigin-Name: 73b97b9ec3c39ab2828ae6353b5d7e04a27996c9
2016-03-08 23:44:48 +00:00
drh
3349d9bea9
Improved comments on virtual table query planning. Added many new
...
WHERETRACE() macros.
FossilOrigin-Name: 4c89c2534abcf67bc486d5a900a84a6c4f59537e
2016-03-08 23:18:51 +00:00
drh
6de32e7cdb
Simplified error detection in the xBestIndex processing.
...
FossilOrigin-Name: 82ca2131b670505578628687746135ac413d156b
2016-03-08 02:59:33 +00:00
drh
8426e36c8f
Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)".
...
FossilOrigin-Name: 91bd619d27e4d91510a187bbb88de961a31c8a2e
2016-03-08 01:32:30 +00:00
drh
599d576456
Add a NEVER() to the code generator. Change the parameter name "mExtra"
...
to "mPrereq" in the query planner, to more closely reflect its meaning.
FossilOrigin-Name: 721ae51e443647291f3a8f7f2128aa410fee2682
2016-03-08 01:11:51 +00:00
dan
104ead923e
Fix a problem in the previous commit affecting queries with three or more tables joined together to the right of a LEFT or CROSS JOIN operator.
...
FossilOrigin-Name: d8d89d69a490a708b83147945f74134ae0e4b387
2016-03-05 21:32:14 +00:00