drh [Mon, 5 May 2014 20:32:15 +0000 (20:32 +0000)]
Create new header file "os_setup.h" used to detect the operating system
at compile-time, and "os_win.h" that contains windows-specific header in
formation.
dan [Thu, 1 May 2014 20:26:48 +0000 (20:26 +0000)]
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.
dan [Thu, 1 May 2014 10:19:16 +0000 (10:19 +0000)]
Update a test case in wal2.test that explicitly corrupts a checksum in the wal file to account for the fact that the first byte of said checksum may initially be 0xFF.
dan [Wed, 30 Apr 2014 15:22:25 +0000 (15:22 +0000)]
Modify the way the costs of various query plans are estimated. If the user supplies a likelihood() value (or equivalent) on an indexed WHERE constraint, use it to estimate the number of index rows visited.
dan [Wed, 30 Apr 2014 14:53:21 +0000 (14:53 +0000)]
Update a couple of test cases to account for the fact that this branch prefers an index scan and partial sort over a full-table scan and full external sort.
dan [Mon, 28 Apr 2014 20:11:20 +0000 (20:11 +0000)]
Do not reduce the number of rows scanned at all for "IS NOT NULL" constraints. Fix a bug in calculating the number of rows visited by scans of partial indicies.
dan [Mon, 28 Apr 2014 19:34:06 +0000 (19:34 +0000)]
The trunk assumes that an open range constraint on an indexed term (col>?) term matches 1/4 of the indexed rows, and that a closed constraint (col BETWEEN ? AND ?) matches 1/64. Change this branch to do the same.
dan [Mon, 28 Apr 2014 15:11:25 +0000 (15:11 +0000)]
Update unordered.test to take into account for the fact that SQLite now prefers a full-table scan over a non-covering index scan that visits a large percentage of the table rows.
dan [Mon, 28 Apr 2014 10:00:59 +0000 (10:00 +0000)]
Update test script analyze3.test to account for the fact that SQLite now prefers a full-table scan over a non-covering index scan that visits a large percentage of the table rows.
dan [Mon, 28 Apr 2014 09:35:31 +0000 (09:35 +0000)]
Modify internal function whereLoopAdjustCost() so that it does not prefer a skip-scan over a regular index scan even if the regular scan uses a subset of the WHERE terms used by the skip-scan.
Allow the xfer optimization to proceed if the DEFAULT on the very first
column of the two tables is different. This is a refinement of the
fix for ticket [f67b41381a].
dan [Fri, 25 Apr 2014 20:22:45 +0000 (20:22 +0000)]
If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop.
Add test cases to ensure correct operation of joins with a virtual table
that include DISTINCT and ORDER BY clauses. Verification for ticket
[388d01d4bb8f9].
Make sure ORDER BY clauses on joins that involve virtual tables and that
have a DISTINCT clause work correctly. This is a candidate fix for
ticket [388d01d4bb8f9]. Test cases for that ticket will be checked in
separately.
dan [Mon, 21 Apr 2014 13:21:56 +0000 (13:21 +0000)]
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].
Clean up the proper-subset cost adjustment logic to make it more compact
and easier to read and so that full branch test coverage is more easily
obtained.
Add the SQLITE_RUNTIME_BYTEORDER compile-time option to force SQLite to check
the processor byte-order at run-time. Add additional compile-time byte order
checks for ARM, PPC, and SPARC.
Add the SQLITE_TESTCTRL_BYTEORDER test control to interrogate SQLite's notion
of the processor byte order and whether the byte order is known at compile-time
or determined at run-time.
Make sure column cache elements are cleared correctly when jumping over
code for key generation in a partial index.
Fix for ticket [2ea3e9fe6379fc3f6].
Merge changes to the query planner that strive to ensure that any index
usage that is a proper subset of some other index usage always has a slightly
higher cost.
Use OP_Copy instead of OP_SCopy when moving results out of a subquery,
to prevent the subquery results from changing out from under the outer
query. Fix for ticket [1e64dd782a126f48d78].
drh [Fri, 28 Mar 2014 03:12:48 +0000 (03:12 +0000)]
Enhance the sqlite3VdbeRecordCompare() routines so that if they encounter
database corruption, they will set the UnpackedRecord.isCorrupt field and
return 0. The sqlite3BtreeMovetoUnpacked() routine detects this and returns
SQLITE_CORRUPT, causing the corruption to be reported back to the top-level.
drh [Thu, 27 Mar 2014 18:36:34 +0000 (18:36 +0000)]
Minor cleanup of the code in the query planner that computes the costs
estimates for the various plans. There are no changes to the costs at this
time. But the code is slightly more readable now and that might facilitate
future enhancements.
drh [Tue, 25 Mar 2014 11:00:21 +0000 (11:00 +0000)]
Detect when a VdbeCursor is still pointing at a valid row but that row has
moved, and invalidated the return from prior sqlite3BtreeDataFetch() or
sqlite3BtreeKeyFetch() calls.
drh [Sat, 22 Mar 2014 02:19:53 +0000 (02:19 +0000)]
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.
drh [Sat, 22 Mar 2014 00:27:14 +0000 (00:27 +0000)]
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.
drh [Fri, 21 Mar 2014 19:56:09 +0000 (19:56 +0000)]
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.
drh [Thu, 20 Mar 2014 19:04:56 +0000 (19:04 +0000)]
Remove a testcase() that is now always true due to the "x IN (?)" optimization.
Add an ALWAYS() around a conditional in the parser that cannot be false.
drh [Thu, 20 Mar 2014 17:03:30 +0000 (17:03 +0000)]
The "x IN (?)" optimization in check-ins [2ff3b25f40] and [e68b427afb] is
incorrect, as demonstrated by the in4-5.1 test case in this check-in.
The "COLLATE binary" that was being added to the RHS of IN was overriding
the implicit collating sequence of the LHS. This change defines the EP_Generic
expression node property that blocks all affinity or collating sequence
information in the expression subtree and adds that property to the expression
taken from RHS of the IN operator.