drh
40c3941cfa
Add the cache_spill pragma.
...
FossilOrigin-Name: cdb181c04fa99c6c29f23eb68ccb5475e7f6bf9c
2013-08-16 20:42:20 +00:00
drh
d94f512f58
Merge recent trunk changes into the STAT4 branch.
...
FossilOrigin-Name: c69b512af276a438399747af22659415af3a5d4d
2013-08-16 12:26:33 +00:00
drh
e35463b312
Bare identifiers in ORDER BY clauses bind more tightly to output column name,
...
but identifiers in expressions bind more tightly to input column names.
This is a compromise between SQL92 and SQL99 behavior and is what
PostgreSQL and MS-SQL do. Ticket [f617ea3125e9c].
FossilOrigin-Name: c78b357c00a35ed48ce2ffbc041de8d22570d1e2
2013-08-15 20:24:27 +00:00
drh
26080d9241
Clarification and typo fixes in comments related to name resolution.
...
No changes to code.
FossilOrigin-Name: f30abdf9d814d6c75bf1c803054737c737ad636f
2013-08-15 14:27:42 +00:00
dan
8ad169abb4
If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4.
...
FossilOrigin-Name: cca8bf4372ab7a0258aa5c9397818415c6cf0abf
2013-08-12 20:14:04 +00:00
dan
0106e378f1
Re-enable reading from the sqlite_stat3 table (as well as sqlite_stat4).
...
FossilOrigin-Name: 6d45078e621526fc2bac0eaefbb0f9602b9a8ec5
2013-08-12 16:34:32 +00:00
dan
eea568d68e
Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq.
...
FossilOrigin-Name: 7b70b419c43b2c3b2daf11d833a1d60245bfaef5
2013-08-07 19:46:15 +00:00
dan
3d40759803
Merge latest trunk changes with this branch.
...
FossilOrigin-Name: 08f74c45ecf711a2373af578d44470add9082377
2013-08-07 18:42:27 +00:00
drh
4bfd4ad9a7
Remove the unused sqlite3Utf8to16() utility function.
...
FossilOrigin-Name: 9159b43eb2cb5d6ed18a5ad168fa27134fec2553
2013-08-07 15:57:24 +00:00
dan
87cd93215e
When estimating the number of rows scanned using data from the sqlite_stat4 table, avoid allocating UnpackedRecord and KeyInfo structures until they are definitely required.
...
FossilOrigin-Name: 353950a5269fa439cc3e57b62e16558a84ea2557
2013-08-07 15:52:41 +00:00
dan
7a4192358a
When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan.
...
FossilOrigin-Name: 2973f5ca736c4a6f13c653d54b6a29d7cae8d0ed
2013-08-06 20:01:43 +00:00
drh
d58d3278cb
Performance optimization: Avoid calling convertCompoundSelecctToSubquery()
...
on queries that do not use the UNION, EXCEPT, or INTERSECT operators.
FossilOrigin-Name: c589b2fed7beabc2337d701094c22635914d9c23
2013-08-05 22:05:02 +00:00
drh
323df7907e
Factor all KeyInfo object allocations into a single function:
...
sqlite3KeyInfoAlloc(). Always allocate enough space so that
sqlite3VdbeRecordCompare() can avoid checking boundaries and hence
run faster.
FossilOrigin-Name: 7301bedd94c8610568349953b18ff3575203e1b2
2013-08-05 19:11:29 +00:00
dan
f52bb8d385
Begin adding experimental sqlite_stat4 table. This commit is buggy.
...
FossilOrigin-Name: 2beea303a1d609cd2ff252412c50b966b9e5e8f1
2013-08-03 20:24:58 +00:00
drh
619a1305e7
Fill out an initial implementation of the sqlite3ExprImpliesExpr() function.
...
FossilOrigin-Name: 8e07aa2ad5579aeb82174ce5bd432ddb9c058bc1
2013-08-01 13:04:46 +00:00
drh
8a9789b6c1
Test cases and bug fixes for the partial index logic.
...
FossilOrigin-Name: 6b73ae7c123801787c8994113cbeb87ee96ba653
2013-08-01 03:36:59 +00:00
drh
b2b9d3d758
Add the logic to keep partial indices up to date through DML statements and
...
when new partial indices are created. This new logic is untested except to
verify that it does not interfere with full indices.
FossilOrigin-Name: fb9044d15ad4fd6ae4a38858c0c0e6fe9d4faa25
2013-08-01 01:14:43 +00:00
drh
4bd5f73fa0
Add logic to the query planner to only use partial indices if the WHERE clause
...
constrains the search to rows covered by the partial index. This is just
infrastructure. The key routine, sqlite3ExprImpliesExpr(), is currently a
no-op so that partial indices will never be used.
FossilOrigin-Name: 8ca3eac111e06a1854f878a74bffe8f20eb47f1b
2013-07-31 23:22:39 +00:00
drh
3780be115a
Resolve names in CREATE INDEX WHERE clauses and detect errors. Disallow
...
expressions that contain variables, subqueries, or functions.
The expression is still not used for anything, however.
still unused.
FossilOrigin-Name: f2aa7842c8b9df24294f09e2bde27b3f08c455c7
2013-07-31 19:05:22 +00:00
drh
1fe0537e51
Here begins an experimental branch for exploring the idea of a partial index.
...
This check-in is able to parse a WHERE clause on a CREATE INDEX statement, but
does not actually do anythingn with that WHERE clause yet.
FossilOrigin-Name: 6794b2dcb48b3507caccfc7867fc185818cf8291
2013-07-31 18:12:26 +00:00
drh
443dbcf5ae
Comment and preprocessor macro cleanup.
...
FossilOrigin-Name: c0809b5e32c2ca0600098447a573e718eaeb319f
2013-07-29 15:54:06 +00:00
drh
b1eaa718fd
Add the experimental "query_only" pragma.
...
FossilOrigin-Name: 6557c407983b067449deb76bc4c5248de64e07dc
2013-07-11 15:22:31 +00:00
drh
648e264342
Add the "defer_foreign_keys" pragma and the SQLITE_DBSTATUS_DEFERRED_FKS
...
value for sqlite3_db_status(). This is a cherry-pick of a sequence of five
checkins in the sessions branch between [1d44e5d3c2] and [d39e65fe70].
FossilOrigin-Name: 527121ac3cdc96ac33ad975c227a6685a2f7e999
2013-07-11 15:03:32 +00:00
drh
8f8c65f79b
Fix harmless compiler warnings in the progress callback logic.
...
FossilOrigin-Name: 908141d5bf7a9ad8f40c2332476847733eca7fdc
2013-07-10 18:14:29 +00:00
drh
13447bf6c7
Experimental "PRAGMA query_only=BOOLEAN" statement that is able to turn
...
write capabilities on and off.
FossilOrigin-Name: ece960c496717a3a6c25526ef77dd76b08d607bc
2013-07-10 13:33:49 +00:00
drh
40aa936f7f
Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS option for sqlite3_file_control()
...
that will disable the use of SQLITE_STAT3 information in the query planner.
FossilOrigin-Name: 60c19b86797fb8a37f175545929883ebeff7f307
2013-06-28 17:29:25 +00:00
drh
1713afb025
Refactor the Vdbe.noIO field as Vdbe.bIsReader. The meaning is inverted.
...
FossilOrigin-Name: 59f98c5c241e5a61cd5b6d0e69b55a6b44c5cafc
2013-06-28 01:24:57 +00:00
drh
4f7d3a5f06
Refactor names of fields in the sqlite3 object: "activeVdbeCnt" becomes
...
"nVdbeActive". Related fields becomes "nVdbeRead", "nVdbeWrite", and
"nVdbeExec".
FossilOrigin-Name: 14f796963474350e7aee8d3757acd3315fe78e4f
2013-06-27 23:54:02 +00:00
drh
9e92a47bdf
Make sure that sqlite3_stmt_readonly reports false for
...
PRAGMA journal_mode and PRAGMA wal_checkpoint. Ticket [a589ec069e3].
Also keep track of whether a prepared statement does no reading or
writing.
FossilOrigin-Name: 1937fd8eec2c1da95a782d9dc63926d846b06bdc
2013-06-27 17:40:30 +00:00
drh
1031bd9958
Add the ability to disable the omit-join-table optimization for testing
...
purposes.
FossilOrigin-Name: d929df9b1ba214c27d8c437099a53ee9b07aa169
2013-06-22 15:44:26 +00:00
drh
6457a353bc
Modify the query planner interface so that it always passes in the result set.
...
This is the first step toward adding an optimization that will omit tables
from a join that do not contribute to the result.
FossilOrigin-Name: 2c2577e69ccb47f1af674a755e71221e2ca0b322
2013-06-21 00:35:37 +00:00
drh
e1e2e9acd6
Make the MIN() and MAX() macros available in sqliteInt.h. Add TUNING
...
comments to the NGQP and adjust costs slightly.
FossilOrigin-Name: 3a72af2a95b04b8e195ef17cb3e9d9021a4f0915
2013-06-13 15:16:53 +00:00
drh
4f402f26b1
Improved processing of DISTINCT.
...
FossilOrigin-Name: ba897100fed291d2025f68d09334f9985312298b
2013-06-11 18:59:38 +00:00
drh
8e23daf372
Fix the Parse.nQueryLoop state variable to work with NGQP.
...
FossilOrigin-Name: f1cac24f06b9c71cfa472fdcf2da4cd8689a7cc3
2013-06-11 13:30:04 +00:00
drh
c63367ef68
Fix some minor issues with logarithmic cost in NGQP.
...
FossilOrigin-Name: 69cf877283d362915edddf1822fbf7a9f86278b3
2013-06-10 20:46:50 +00:00
drh
6f32848d61
Move the definitions of the WhereLevel and WhereInfo objects out of
...
sqliteInt.h and into where.c. This will facilitate future refactoring
of the internal query planner data structures.
FossilOrigin-Name: 1574653b9b4522b489d4c62d9cf70166bb3bddfd
2013-06-05 23:39:34 +00:00
drh
7699d1c4e5
Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain
...
and so that it can support optimizing out GROUP BY and DISTINCT clauses.
FossilOrigin-Name: e605c468e3a1163167831c4a6220825c0b5d083b
2013-06-04 12:42:29 +00:00
drh
8030dc7b1f
Remove the definitions of objects that are no longer used: WhereCost,
...
WherePlan, and WhereBestIdx.
FossilOrigin-Name: 816f8add7e60de2ef8df4fdac090c244f8dbda39
2013-05-31 15:50:39 +00:00
drh
7ba39a921a
Cut over the NGQP query planner. Remove lots of legacy code.
...
This check-in compiles but does not work. The test suite gets incorrect
answers and crashes.
FossilOrigin-Name: 001539df4b74dc1cbceb010a91407003ab4d8735
2013-05-30 17:43:19 +00:00
drh
e1e9766dee
Merge recent trunk changes into the NGQP branch.
...
FossilOrigin-Name: aebe1f2603ee04d792af73aaf59625bda99d5cd1
2013-05-30 11:48:36 +00:00
drh
4580d759fb
Remove the obsolete and unused sqlite3.inTrans field.
...
FossilOrigin-Name: c3381cd4957013d46075996c3b865177c888d2a8
2013-05-28 17:25:48 +00:00
drh
f7b5496e8e
Many small harmless comment changes. Removal of obsolete comments and
...
fixing misspelled words. No changes to code.
FossilOrigin-Name: a0d5cc9315dc6e9ef7dee4c3dfabf4e562d64376
2013-05-28 12:11:54 +00:00
drh
88da644f2c
Update the NGQP to record which loops need be run in reverse order to
...
satisfy ORDER BY clauses.
FossilOrigin-Name: 211f7a5374fe20a02535edc8b799a8a7136ff6b3
2013-05-27 17:59:37 +00:00
drh
7c4ac9860c
Merge the latest trunk changes into the NGQP branch.
...
FossilOrigin-Name: 7c8f992c04504a132686ad0652efdff19e43480d
2013-05-24 13:55:23 +00:00
drh
40b521f847
Set _XOPEN_SOURCE to 600 so that fchmod() will (hopefully) work on FreeBSD.
...
FossilOrigin-Name: 61a10452399db28cd5ea4ba9d416b87a34c2eddb
2013-05-24 12:47:26 +00:00
drh
23f98daabb
Work toward improving the NGQP's ability to optimize out ORDER BY clauses.
...
FossilOrigin-Name: 67367f1e1f0c3eb6be65eea9873910aa62b49884
2013-05-21 15:52:07 +00:00
drh
319f677d57
First attempt to get ORDER BY optimization working in NGQP.
...
FossilOrigin-Name: 9fe20292558bb9422de91e35648cb834cbf3b306
2013-05-14 15:31:07 +00:00
drh
2b344c7220
Merge in the latest trunk changes.
...
FossilOrigin-Name: 5ed31c8279a4f465b982df5dc20cefc286928b93
2013-05-10 02:11:40 +00:00
drh
6b7157bbd5
Free up bits of wsFlags for reuse. Install the ORDER BY optimization
...
infrastructure for the NGQP.
FossilOrigin-Name: 82d50e198025a2fdb8ee733edb8419d388ee5362
2013-05-10 02:00:35 +00:00
drh
a18f3d271e
Add the NGQP solver.
...
FossilOrigin-Name: 5d37587c50d8932b6357bfd03152a851510a4317
2013-05-08 03:05:41 +00:00