drh [Sat, 3 May 2014 12:00:01 +0000 (12:00 +0000)]
Add two new static mutexes, SQLITE_MUTEX_STATIC_APP1 and _APP2, for use by
the application program. First intended use is in test programs for the
memory allocation logic where one does not want to allocating a _FAST
or _RECURSIVE mutex since that would involve using the memory allocation
system under test.
drh [Fri, 2 May 2014 18:46:52 +0000 (18:46 +0000)]
Do not run the vdbeRecordCompareDebug() assert if pKeyInfo->db is NULL since
in that case there would be no way to check for a memory allocation failure.
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.
dan [Wed, 16 Apr 2014 16:43:05 +0000 (16:43 +0000)]
Rework the way trees of MergeEngine objects are built in vdbesort.c to make it easier to follow. Fix memory leaks that could follow an OOM or IO error. Add various comments to explain functions in vdbesort.c.
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].
Add a big introductory comment to vdbesort.c explaining its operation at a
high level. Also adjust some symbolic names and fix other comment issues in
that file.
dan [Tue, 1 Apr 2014 18:41:51 +0000 (18:41 +0000)]
When sorting data for a CREATE INDEX statement in single-threaded mode, assume that keys are delivered to the sorter in primary key order. Also fix various comments that had fallen out of date.
dan [Tue, 1 Apr 2014 15:38:44 +0000 (15:38 +0000)]
Even if compile time option SQLITE_MAX_WORKER_THREADS is set to one or greater, set the default number of worker threads to zero. Distribute data more evenly between threads in sqlite3VdbeSorterWrite() to improve performance when sorting large amounts of data. Add new test file sort2.test.