drh
a704400714
Clarify the documentation to better explain when an automatic re-prepare can
...
be induced by rebinding parameters. Add evidence marks to the automatic
re-prepare logic.
FossilOrigin-Name: 3e11f5155c5625ddf4300a9ef7e8bc20a190a752
2010-09-14 18:22:59 +00:00
drh
3bb9b93f1f
Change two automatic array variables into static constant arrays.
...
Update and reformat some comments for cleaner presentation.
FossilOrigin-Name: a7a15547cccb4aeb719aba19641f31390c316d8c
2010-08-06 02:10:00 +00:00
drh
aa0ba4345d
Fix the query planner so that when it has a choice of full-scan tables to
...
move to the outer loop, it chooses the one that is likely to give the fewest
output rows.
FossilOrigin-Name: 309bbedf9648c750d7b8aedbc15d4fd68f846824
2010-08-05 02:52:32 +00:00
drh
5e377d90ed
If the outer loop of a join must be a full table scan, make sure that an
...
incomplete ANALYZE does not trick the planner into use a table that might
be indexable in an inner loop. Ticket [13f033c865f878]
FossilOrigin-Name: e7a714b52c45af096af74049826d32c647abfe3f
2010-08-04 21:17:16 +00:00
drh
b975598ea0
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and
...
all memory from sqlite3_malloc() is freed by sqlite3_free().
FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
2010-07-24 16:34:37 +00:00
drh
e9cdceafab
Add evidence marks to the where.c source file. Comment only - no code changes.
...
FossilOrigin-Name: f3f9e8e5bb90cc36e0d63a7289a8acf534c5fa2a
2010-07-22 22:40:03 +00:00
drh
8342e49f62
Enhance the LIKE/GLOB query optimization so that it works as long as there
...
is an index with the appropriate collating sequence and even if the default
collating sequence of the column is different.
Ticket [4711020446da7d93d99].
FossilOrigin-Name: 9f932655f9eb9fdab16d7deed98b7cad414e0ca6
2010-07-22 17:49:52 +00:00
drh
93ee23cc03
Try to optimize LIKE and GLOB operators when RHS contains no wildcard.
...
Ticket [e090183531fc274747]
FossilOrigin-Name: 613a87d62fd1f8526d53136efae5adae91824bcf
2010-07-22 12:33:57 +00:00
drh
a7d2db175b
The expression list on the RHS of an IN operator can no longer be empty
...
because an empty expression list is now optimized out by changes in
check-in [c288ac644d0bf]. Therefore add ALWAYS() macros around tests
for the expression list being non-empty.
FossilOrigin-Name: fd130ae56c0e23f2d5b4a82f1a09e89ed7ae1e85
2010-07-14 20:23:52 +00:00
drh
0eb77d0568
Fix a buffer overrun in the where.c. Problem detected by valgrind.
...
FossilOrigin-Name: 15bb62330681a5b2aad95a1d1fc9ab8f6f1bd6b9
2010-07-03 01:44:27 +00:00
shaneh
5eba1f60fe
Fix some warnings when compiling under MSVC.
...
FossilOrigin-Name: 708338773919fa024abbba55180654beb60e6d84
2010-07-02 17:05:03 +00:00
dan
6ac4339439
Fix for ticket [f973c7ac31].
...
FossilOrigin-Name: 6eb058dda8d5f87b02378d8efd821fe64a525dcc
2010-06-09 15:47:11 +00:00
drh
be837bddad
Avoid assertion faults in queries using indices with redundant columns.
...
Ticket [3dbdcdb14e7f41].
FossilOrigin-Name: 946e06cd2a2cc209b0786b7e9d28c0746320d646
2010-04-30 21:03:24 +00:00
drh
ed808acd1b
The query planner fix of check-in [33b1f584ef] should have been on the trunk.
...
FossilOrigin-Name: f538d759beda67e042b66181b65bd432488f7650
2010-04-15 13:29:37 +00:00
drh
ed754ce2cc
Further refinements to table order selection on join query planning.
...
FossilOrigin-Name: defaf0d99a807027f8883bf821b6482025f9f54e
2010-04-15 01:04:54 +00:00
drh
1e0f4a83d6
The query planner uses non-indexable WHERE clause terms to reduce the
...
estimated number of output rows, then uses the estimated number of output
rows as a tie-breaker when choosing table order.
FossilOrigin-Name: b87cb0c2bd9c52a938795a974e101879b81210e3
2010-04-14 19:01:44 +00:00
drh
f12cde5637
Fix code coverage problems in where.c.
...
FossilOrigin-Name: b04a52824971e8880e4bf0d9862db4eef8b607ab
2010-04-08 17:28:00 +00:00
drh
8bd5412b90
Fix the computation of the number of rows in a table during automatic
...
index generation.
FossilOrigin-Name: edeab06a5010c82491a6cc9393cf2a35a7622ac5
2010-04-08 15:00:59 +00:00
drh
67ae0cb231
Fix an integer overflow bug in the automatic index logic. The bug was
...
detected by the testcase() macros added in the previous check-in. Also
add some more testcase() macros, since this issue points up their importance.
FossilOrigin-Name: af97b4881a8f010055cde672634141d7ed6898fc
2010-04-08 14:38:51 +00:00
drh
52ff8ea605
Add testcase() macros to the automatic index logic to insure that boundary
...
cases are tested.
FossilOrigin-Name: 7286547847721b8f5f64bc2e7dc236652b1ae985
2010-04-08 14:15:56 +00:00
drh
0013e72edf
When constructing automatic indices do not include the same column more than
...
once.
FossilOrigin-Name: d067d9f7a9138e026c1018361127e34385928657
2010-04-08 00:40:15 +00:00
drh
c633908199
Wrap all automatic index changes inside SQLITE_OMIT_AUTOMATIC_INDEX. Add
...
the automatic_index PRAGMA to turn it on and off.
FossilOrigin-Name: a811a47fbe4f757a7ab575ae5a0f65177a3f07c0
2010-04-07 16:54:58 +00:00
drh
4139c99eba
Make sure that all automatic indices are covering indices. Otherwise, the
...
table and index might be used together in a query but the table could get
out of sync with the automatic index through out-of-band changes.
FossilOrigin-Name: 2364313142668b3d0ad144447b4862709be929cd
2010-04-07 14:59:45 +00:00
drh
a21a64dd0c
Veryquick.test is now working. The SQLITE_STMTSTATUS_AUTOINDEX counter
...
added.
FossilOrigin-Name: abbf16e5e7895971710fb3a8fd9c782fc1218a77
2010-04-06 22:33:55 +00:00
drh
75bb9f5a5b
Runs quicktest without hitting an assert now. Some tests get unexpected
...
results still and there is a memory leak.
FossilOrigin-Name: a8224448cc305258a59a9023e6604783dda73e45
2010-04-06 18:51:42 +00:00
drh
424aab88ca
Progress toward getting automatic indices to work. Still failing in corner
...
cases.
FossilOrigin-Name: ac6d0fba78eb9dcd69372e128d4a039aaff4b417
2010-04-06 18:28:20 +00:00
drh
8b307fbfa0
Automatically generate transient indices for tables in joins that would
...
otherwise have to use a full table scan.
FossilOrigin-Name: 1b2a04125f964e14f3fb90171c5ab86a0641d1c9
2010-04-06 15:57:05 +00:00
drh
afc266a76a
Clarification of the implementation of SQLITE_STMTSTATUS_FULLSCAN_STEP.
...
No logical code changes - just commenting and layout changes to improve
readability.
FossilOrigin-Name: 06b9ca32255572a699dc51f46f848d0bf01255e1
2010-03-31 17:47:44 +00:00
dan
c26c00495f
Increase the estimated cost of using a virtual table as the outer loop of a join when there exists an ORDER BY clause that is not satisfied by the virtual table. Fix for [775b39dd3c].
...
FossilOrigin-Name: 9e075e70f0e2a1ad302d17150cd58f91669a97a6
2010-03-27 09:44:42 +00:00
drh
5e767c5793
Make sure the ON clause of a LEFT JOIN does not cause an index to be
...
used to speed access to a table to the left of the join.
Ticket [ebdbadade5]
FossilOrigin-Name: f0ae251abb9e8a8793f46a30b79b2ce541cf14d5
2010-02-25 04:15:47 +00:00
drh
9978c97ec5
Remove the obsolete sqlite3SafetyOn() mechanism. Add additional logging
...
output for CORRUPT, and CANTOPEN errors.
FossilOrigin-Name: 7c4cca6d1a23a6d1591b62f58c3716a944969947
2010-02-23 17:36:32 +00:00
drh
5cb7434c72
Fix a segfault that can occur when the LHS of a LIKE operator has an
...
undefined collating sequence. Ticket [1258875e07553].
FossilOrigin-Name: a82e6b4585b9ddba581204976cd5ea8704339185
2010-01-21 23:11:24 +00:00
shaneh
46aae3c0da
Changes to remove warnings in MSVC build.
...
FossilOrigin-Name: 6cf76c2ae25d6e58926637ecd42eed6b300b1a25
2009-12-31 19:06:23 +00:00
drh
f49f352320
Adjustments to column cache handling in order to restore 100% branch
...
test coverage.
FossilOrigin-Name: cc6b959bc1f968e08eea1afd387201d70a0c1e80
2009-12-30 14:12:38 +00:00
drh
b6da74ebd5
Immediately purge entries from the column cache when the associated register
...
undergoes an affinity change. Ticket [eb5548a849]. Enhance the
SQLITE_TESTCTRL_OPTIMIZATIONS setting of sqlite3_test_control so that it
can disable the column cache for testing purposes, in an effort to prevent
future problems of a similar nature to this one.
FossilOrigin-Name: ea4e57e1c1b6663ceb12872e31a8503f6c14e3d8
2009-12-24 16:00:28 +00:00
drh
b057e56f22
Remove unreachable code that was added by the fix to the "(xANDy)OR(z)" bug
...
in the previous check-in.
FossilOrigin-Name: 04915562a0c2cb377bc7baa0c06c5d9ac376563c
2009-12-16 23:43:55 +00:00
drh
c01a3c1775
Ensure WHERE clause terms involving tables on the right end of a join
...
are not prematurely evaluated when tables on the left end of the join
make use of the OR-clause optimization.
Fix for ticket [31338dca7e].
FossilOrigin-Name: 2c2de252666662f5459904fc33a9f2956cbff23c
2009-12-16 22:10:49 +00:00
drh
a62bb8d4d7
Make sure registers computed for the VFilter opcode are marked invalid
...
after the VFilter opcode finishes. Ticket [16fbf14cb2].
FossilOrigin-Name: 83dc7d38c2695d1b2a7d4866a4df9be9e41d1abe
2009-11-23 21:23:45 +00:00
drh
2f2855b638
Suppress more instances of unnecessary OP_IsNull and OP_Affinity opcodes.
...
FossilOrigin-Name: bf6c0bd1c5568c6292ea0a64c8a5071e1bd3079a
2009-11-18 01:25:26 +00:00
drh
039fc32e84
Code generator tries to avoid pointless OP_IsNull and OP_Affinity opcodes.
...
FossilOrigin-Name: ebb0c8a3e977dc741704e733b5a5d931d9b27028
2009-11-17 18:31:47 +00:00
drh
f6a82030a8
Fix a reference to freed memory that can occur following an OOM error in
...
where.c.
FossilOrigin-Name: 929b6047391411c6f539e47afe6b63d16e352ccb
2009-11-16 22:54:50 +00:00
drh
8cff69df11
Enhance the OP_Found and OP_NotFound opcodes so that they can accept an
...
array of registers as an unpacked record in addition to a record built
using OP_MakeRecord. Use this to avoid OP_MakeRecord calls during IN
expression processing.
FossilOrigin-Name: b9eab885cd2ca1a1633329e7036c125e8dba62c5
2009-11-12 19:59:44 +00:00
drh
35451c6acd
Suppress unnecessary OP_Noop instructions on when the right table of a
...
LEFT JOIN uses the index-only optimization.
FossilOrigin-Name: e8aec08bee1c8d593474561898037aed571e64ce
2009-11-12 04:26:39 +00:00
drh
c81c11f62c
Remove the obsolete "$Id:$" RCS identifier strings from the source code.
...
FossilOrigin-Name: f6c045f649036958078cb15cd9d5453680c82b0c
2009-11-10 01:30:52 +00:00
drh
1d452e1de0
Fix compiler warnings. Better comments on some variables associated with
...
LIKE/GLOB processing in the query planner.
FossilOrigin-Name: cfa2db0ff7a94e7f66c35f672ee41cadd45a6dd7
2009-11-01 19:26:59 +00:00
drh
d91ca49a4e
Add some sample requirement implementation comments to where.c.
...
FossilOrigin-Name: 9854ad00aed08793ae7ba3c2cfbab7a2dba4dcb8
2009-10-22 20:50:36 +00:00
drh
b4138de448
Remove an unreachable condition in the WHERE clause processing of bound
...
parameters and replace it with an assert(), for test coverage.
FossilOrigin-Name: 3bcd78a1d76897d1bd5ad4cea52c6a65612ce433
2009-10-19 22:41:06 +00:00
dan
1d2ce4f804
Remove the sqlite3_reoptimize() API. The same functionality is now provided automatically to queries prepared using prepare_v2().
...
FossilOrigin-Name: 2c50b3d5aab7cd8cc841d61f8c3b2b34d2f0b54b
2009-10-19 18:11:09 +00:00
dan
f7b0b0ad5f
When generating WHERE clause terms internally for NATURAL and USING joins, identify the table by its position in the FROM list, not by its name or alias. Fix for [b73fb0bd64].
...
FossilOrigin-Name: 6fe6371175482d38ac4aeea994c7b20c18b7de01
2009-10-19 15:52:32 +00:00
drh
bec451f8ad
Make sure the target register is allocated before adding the bogus
...
OP_Variable opcode in isLikeOrGlob(). Bugfix for the new
sqlite3_reoptimize() logic.
FossilOrigin-Name: e74f8dc436213b7ef754adcab5ef7554d774474c
2009-10-17 13:13:02 +00:00