drh
eb9b884c2d
Improved ".selecttrace" output.
...
FossilOrigin-Name: c0b61f7092a7fd2c5f51db26ce7a7a5c75c227fe
2014-09-21 00:27:26 +00:00
dan
7c0a4720ca
Candidate fix for [d11a6e908f].
...
FossilOrigin-Name: 89398880bcfff96e91d2a9c45774f5fb3209ffc1
2014-09-20 20:38:48 +00:00
drh
9300adbc79
Fix the SELECTTRACE_ENABLE macro so that it doesn't cause problems for
...
testfixture. Add new SELECTTRACE() calls.
FossilOrigin-Name: f1ba68f131d2f03e4a7bc50cde23a7609d384279
2014-09-20 20:24:49 +00:00
drh
abd4c72357
Enable SELECT query planning tracing when compiled with
...
SQLITE_ENABLE_SELECTTRACE and either SQLITE_DEBUG or SQLITE_TEST.
FossilOrigin-Name: cbe0cf9ddf46f0a678c85d49bfa74e3b7712e1a1
2014-09-20 18:18:33 +00:00
drh
9588ad95c1
Do not flatten aggregate subqueries that contain min() or max() functions
...
so that if the min()/max() are discarded by the outer query, they still
function and cause non-aggregate expression to be evaluated on the minimal
or maximal row.
FossilOrigin-Name: 0bdf1a086b3946722f4d4b328e25917f61c14713
2014-09-15 14:46:02 +00:00
drh
6092d2bcfe
Adjust comments to show that subquery flattening restriction (10) was
...
removed from the code back in 2005. This is a comment change only.
FossilOrigin-Name: 4ff0eb96bc364baed2d8005c69291ca9240b99dd
2014-09-15 11:14:50 +00:00
drh
236241aeb0
Simplify the way the column cache is managed around OP_Move instructions.
...
FossilOrigin-Name: 320556233e19cdd9d590a09655c3465754700d39
2014-09-12 17:41:30 +00:00
peter.d.reid
60ec914c74
Fix typos in comments. No code changes.
...
FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69
2014-09-06 16:39:46 +00:00
drh
503ae86508
Merge recent performance enhancements from trunk onto the threads branch.
...
FossilOrigin-Name: 35c44a3c73e2e8b14ff194c41986f4bdb9dfe737
2014-08-29 14:40:07 +00:00
drh
53932ce8fa
Avoid an unnecessary OP_Move operation for expression subqueries.
...
FossilOrigin-Name: 462f42af52f146fd328ddcbbe78c8444ef7bd2c3
2014-08-29 12:29:39 +00:00
drh
83b25d32d7
Merge the pre-3.8.6 changes into the threads branch.
...
FossilOrigin-Name: a608fd1d52606a009c3acc7f1d184b86a7df3c82
2014-08-14 14:02:48 +00:00
drh
fcf2a7757e
Fix an assert() statement in the SELECT code generator that was
...
incorrect following an OOM error.
FossilOrigin-Name: a179e41e40dba4c19a488985f77777acd27b689d
2014-08-12 01:23:07 +00:00
drh
da2e5862d1
Merge all recent changes from trunk.
...
FossilOrigin-Name: a353a8515fb2eff86042d0c33e39772f4d04e0b3
2014-08-06 02:03:35 +00:00
drh
4336b0e64a
Improved VdbeCoverage() macros. A few minor simplifications to generated
...
VDBE code.
FossilOrigin-Name: 01f60027ad1841051fa493a646141445f8971357
2014-08-05 00:53:51 +00:00
drh
d0dc5d4984
Avoid closing a pseudo-table associated with sorting in a co-routine since
...
that pseudo-table might be used again in an outer loop.
FossilOrigin-Name: 6d81805298ea882f5fee99504d5a95f1a762a90b
2014-06-03 14:42:34 +00:00
drh
ff14013496
Merge changes from the trunk into the threads branch.
...
FossilOrigin-Name: 416cb091267de91b9cadee9f7453b8627570b7d3
2014-05-29 20:24:20 +00:00
drh
48dd1d8e28
Change the name of the Index.autoIndex field to Index.idxType and provide
...
symbolic names for the various values of that field rather than using
magic numbers.
FossilOrigin-Name: d16e575dacc811de0f7b58a0d1cd243678dce6c5
2014-05-27 18:18:58 +00:00
drh
79045882c9
Merge recent trunk changes into the threads branch.
...
FossilOrigin-Name: 8215202759dbd863edf20aa26ff21da20bc35d73
2014-05-26 20:15:21 +00:00
dan
e96f2df3dd
Changes to the output of EXPLAIN QUERY PLAN to make it clearer when a query uses the PRIMARY KEY index of a WITHOUT ROWID table.
...
FossilOrigin-Name: 9268df305b90ac11e44b3107bbab5becf38860b7
2014-05-23 17:17:06 +00:00
drh
fb0d6e56d6
Merge latest trunk enhancements and fixes into the orderby-planning branch.
...
FossilOrigin-Name: 84862d3a095629d20c8e7b8a16f4dc26cd41ab6d
2014-05-02 13:09:06 +00:00
dan
3852413246
Fix an obscure problem to do with temp register allocation that could occur if more than one simple SELECT within a compound SELECT uses a partial sort.
...
FossilOrigin-Name: 427409ae106cdab7892a6b50fe30c5f52de5addc
2014-05-01 20:26:48 +00:00
dan
cfc9df76e1
Store values loaded from the stat1 table as logarithmic values in memory.
...
FossilOrigin-Name: 1bd74c49ddab6f53bb6eaa57907eff44c2580dd6
2014-04-25 15:01:01 +00:00
drh
0ff435a782
Reopen the orderby-planning branch and merge in the latest trunk enhancements
...
and fixes.
FossilOrigin-Name: 6077ddcd93318e24b9756adaaf293ba9fb3cedf7
2014-04-24 15:06:25 +00:00
dan
374cd78c1d
Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0].
...
FossilOrigin-Name: de9a490f594183f337a2ec9e0f87792eac83548b
2014-04-21 13:21:56 +00:00
dan
78d5843245
Remove the sequence values from sorter records used by ORDER BY as well.
...
FossilOrigin-Name: c3ae3697832a00d4d5758988a8766bdbb691e6b8
2014-03-25 15:04:07 +00:00
dan
dd23c6bfb4
Omit the sequence value from sorter records used by GROUP BY queries that cannot use an index.
...
FossilOrigin-Name: 3f90abddc31ac20739778c235a834c33f7057997
2014-03-24 20:19:07 +00:00
drh
fd0a2f9756
Avoid unnecessary moving of content between registers during an ORDER BY.
...
FossilOrigin-Name: 4f472accf072d9cb64f209923924b26f21b13d27
2014-03-24 18:08:15 +00:00
dan
3f802ebce2
Remove an unnecessary temporary register allocation.
...
FossilOrigin-Name: 5d506743f541b022cde04a9606baa4680cdfd70b
2014-03-24 09:34:58 +00:00
drh
83553eefaf
Remove a pointless OP_Once operation in ORDER BY clauses with LIMIT.
...
FossilOrigin-Name: e6c59d23316c83b318b1a94d9b28a5d321737fa5
2014-03-24 02:20:53 +00:00
drh
70f624c3a9
Further enhancements to geneverated VDBE code for ORDER BY.
...
FossilOrigin-Name: e7188fad87ec82d36a39b80ccaf8006bf45a9bcd
2014-03-24 01:43:50 +00:00
drh
d345a66428
merge fixes from trunk
...
FossilOrigin-Name: faf7f9caf526ab33a6fdb9c89b45a0483510db21
2014-03-23 18:47:00 +00:00
drh
f45f2326a2
Use only a single OP_MakeRecord instead of two when constructing entries
...
to go onto a sorter.
FossilOrigin-Name: d696cdedacd39075aa7fc407ab7c7e50f01d9f39
2014-03-23 17:45:03 +00:00
drh
dbfca2b7f8
Clear the sort-order flags on the KeyInfo object associated with the
...
OP_Compare/OP_Jump of the block-sort logic, in order to make the OP_Jump
fully testable.
FossilOrigin-Name: 9b2838f23e5f52369eeb078f60bd231cc54362f8
2014-03-22 02:19:53 +00:00
drh
59b8f2e108
Fix the ORDER BY optimization logic so that it will do a block-sort on
...
a partial DESC ORDER BY. This enhancement uncovered a memory leak in
pushUntoSorter() which is also fixed.
FossilOrigin-Name: c36f74611cf17ad2ff198a2ac2054d7ab451a72c
2014-03-22 00:27:14 +00:00
drh
9a4444778f
Add the ability to use indices for the first few terms of an ORDER BY clause,
...
then sort in batches to handle the later terms.
FossilOrigin-Name: fa06a6fed9f48322d9b89721799ba12c46efa898
2014-03-21 20:58:42 +00:00
drh
8e1ee88c88
Change the names of SRT_DistTable and SRT_Table used by CTE to more
...
meaningful SRT_DistFifo and SRT_Fifo, respectively. Simplify the
IgnorableOrderby() macro in the process.
FossilOrigin-Name: 45d8cc678d128f1dda6469864215a8ed9de4366a
2014-03-21 19:56:09 +00:00
dan
9afccba269
Avoid leaking memory in an obscure case where the flattener adds an ORDER BY clause to the recursive part of a recursive query.
...
FossilOrigin-Name: 1f413aca00015100224273480e1ce39a76bf93ab
2014-03-21 19:27:54 +00:00
drh
cc08fa48b8
Merge the OFFSET-on-query-without-FROM fix from trunk.
...
FossilOrigin-Name: 71e9ae72c272dc86720b2bfe719f57de437c400b
2014-03-21 18:45:19 +00:00
drh
a22a75e5ca
Fix the OFFSET clause so that it works correctly on queries that lack
...
a FROM clause. Ticket [07d6a0453d4ed8].
FossilOrigin-Name: 179ef81648b0ad557df78b7712f216b876b6fb65
2014-03-21 18:16:23 +00:00
drh
6284db908a
Fix query planner weights associated with choosing block-sorting. Fix
...
block sorting of tables with collating functions. Fix various test cases.
All "veryquick" tests are now passing, though more tests need to be added.
FossilOrigin-Name: 01afbf97c0ff29667806e9a7c4d74ca717819de5
2014-03-19 23:24:49 +00:00
drh
65ea12cb4a
Make it possible for block-sort to use the OP_SorterOpen sorter in addition
...
to a generic OP_OpenEphemeral.
FossilOrigin-Name: 7ce2daafd39a117041bfdd0a7132e2764fe7a74b
2014-03-19 17:41:36 +00:00
drh
26d7e7c6b7
Fix a problem in the block-sort logic that can arise if the VDBE opcode
...
array is resized while the block-sort logic is being coded. "make test"
now runs to completion, though there are still 17 failures.
FossilOrigin-Name: 62f3a22050e0f11c789374f8a3785df0a84c24cb
2014-03-19 16:56:58 +00:00
drh
ba194369ad
Avoid reusing temporary registers in co-routines when doing
...
block-sorting.
FossilOrigin-Name: 463d921b519b08648a715e987c430f06b06bae84
2014-03-19 15:17:24 +00:00
drh
079a307259
First attempt at getting block-sort to work. This is an incremental check-in.
...
There are many problems still to be worked out.
FossilOrigin-Name: 59742dd4c5259883850044d0938248b009ebd045
2014-03-19 14:10:55 +00:00
drh
ddba0c227e
Make the partial-ORDER-BY information in the query planner available to the
...
SELECT code generator. Still doesn't make a difference in the generated code.
FossilOrigin-Name: e258df236b7de70087c8227cb209080e55b9bf9c
2014-03-18 20:33:42 +00:00
drh
19c6d96aec
Avoid indexing off the front end of an array when creating a view with
...
two or more blank column names in the SELECT statement that defines the view.
FossilOrigin-Name: 554501f158534f9c27fd51900589c2ab7cf300d8
2014-03-04 21:19:51 +00:00
drh
6295524e3d
Change an OP_SCopy into an OP_Copy in a case where the destination might be
...
used after the source has changed.
FossilOrigin-Name: c0fa0c0e2de50d7eda19ab8862496b18eff93538
2014-03-03 17:36:39 +00:00
drh
7e4efaecad
More efficient removal of duplicates in recursive queries using the UNION
...
compound operator.
FossilOrigin-Name: 06c2db875e6cabd81c2a153b2fa4aba03eaed268
2014-02-26 21:35:31 +00:00
drh
7d1761059b
Add VdbeCoverage() and VdbeCoverageIf() macros for improved VDBE coverage
...
testing.
FossilOrigin-Name: b92d31a97d5fe4606d9ae1393c7f3e052f46bf5a
2014-02-18 03:07:12 +00:00
drh
688852ab15
Add logic to do test coverage measurements on the VDBE code.
...
FossilOrigin-Name: ce184c7bb16988641d37c908d9b3042456d4be3d
2014-02-17 22:40:43 +00:00