drh [Tue, 4 Nov 2014 14:22:27 +0000 (14:22 +0000)]
Change the definition of SQLITE_CONFIG_SCRATCH so that at most one scratch
buffer is used per thread. Use the generic heap memory allocator for the
WalIterator object when running a checkpoint.
dan [Mon, 3 Nov 2014 16:56:43 +0000 (16:56 +0000)]
Add the experimental sqlite3_stmt_scanstatus() API. For comparing the number of rows actually visited by a loop with the estimate used by the query planner.
drh [Mon, 3 Nov 2014 14:46:29 +0000 (14:46 +0000)]
Use exponential buffer size growth in StrAccum, as long as the size does not
grow to large, to avoid excess memory allocation resize operations. Also,
document the fact that setting scratch memory causes SQLite to try to avoid
large memory allocations.
dan [Sat, 1 Nov 2014 20:38:06 +0000 (20:38 +0000)]
If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand.
drh [Fri, 31 Oct 2014 14:46:51 +0000 (14:46 +0000)]
Change the command-line shell man-page to use the ".tr" troff directive
instead of ".cc" for escaping the initial "." characters in the ".help"
output.
drh [Fri, 31 Oct 2014 14:26:36 +0000 (14:26 +0000)]
Simplify the logic in the cell redistribution loop of balance_nonroot().
Enhance and clarify comments and add assert() statements for additional
verification of correctness.
drh [Fri, 31 Oct 2014 00:05:23 +0000 (00:05 +0000)]
In the balance_nonroot() routine, protect the values in aPgno[] array from
change during the page sort, so that aPgno[] can be used to avoid unnecessary
pointer-map updates for auto_vacuum databases.
drh [Thu, 30 Oct 2014 23:14:56 +0000 (23:14 +0000)]
Improvements to the wording of some comments. Reinstate an assert() that
is only true for non-corrupt database files by adding an "|| CORRUPT_DB" term.
drh [Wed, 29 Oct 2014 00:58:38 +0000 (00:58 +0000)]
In the OP_Column opcode, when extracting a field that is past the end of
a short record (because the row was originally inserted prior to ALTER TABLE
ADD COLUMN) then make sure the output register is fully NULL and does not
contain leftover flags (such as MEM_Ephem) from its previous use.
Fix for ticket [43107840f1c02].
dan [Tue, 28 Oct 2014 16:50:10 +0000 (16:50 +0000)]
Fix a crash that could occur if the WHERE clause of an UPDATE statement on a view that does not feature a column named "rowid" contains a term such as "rowid=?".
drh [Mon, 27 Oct 2014 18:34:07 +0000 (18:34 +0000)]
Add the SQLITE_ENABLE_API_ARMOR compile-time option for extra API parameter
validation. Enhance sqlite3_stricmp(), sqlite3_strnicmp(), and
sqlite3_uri_parameter() for improved NULL parameter handling.
dan [Mon, 27 Oct 2014 08:02:16 +0000 (08:02 +0000)]
If a free-slot is found within a page, but using that free-slot would fragment the page further and there are already at least 60 fragmented bytes, degragment the page. This matches the behaviour of the trunk.
drh [Sat, 25 Oct 2014 13:42:16 +0000 (13:42 +0000)]
Increase the resolution of the second parameter to the likelihood() SQL
function (the probability value) so that it can handle probabilities
as small as 0.00000001. Formerly, it ran out of precision at 0.001.
drh [Sat, 25 Oct 2014 12:28:25 +0000 (12:28 +0000)]
Do not use virtual (and hence redundant) WHERE-clause terms to restrict the
content of a automatic partial index. Show when an automatic partial index
is used in the EXPLAIN QUERY PLAN output.
dan [Fri, 24 Oct 2014 20:57:03 +0000 (20:57 +0000)]
Ensure that the "Any prior cache entry associated with newKey is guaranteed not to be pinned" guarantee made to xRekey implementations is not violated.
drh [Wed, 22 Oct 2014 19:57:16 +0000 (19:57 +0000)]
Change the 0x800 bit of SQLITE_TESTCTRL_OPTIMIZATIONS so that it disables
the loading of STAT3 and STAT4 content, not just the using of that content.
Change the internal name of that bit to SQLITE_Stat34.
drh [Wed, 22 Oct 2014 15:27:05 +0000 (15:27 +0000)]
Take steps to avoid misestimating range query costs based on STAT4 data
due to the roundoff error of converting from integers to LogEst and back
to integers.
drh [Tue, 21 Oct 2014 21:56:06 +0000 (21:56 +0000)]
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and
when synchronous=FULL in order to ensure that transactions are durable
across a power loss that happens moments after the commit. Proposed
fix for [https://bugzilla.mozilla.org/show_bug.cgi?id=1072773].
drh [Tue, 21 Oct 2014 01:05:09 +0000 (01:05 +0000)]
If a skip-scan is a proper subset of some other scan, then adjust the
cost of the skip-scan upward so that it is more costly than the other scan.
Such a cost imbalance can arise under STAT4 because of difficulties in getting
an accurate estimate for skip-scans.
dan [Thu, 16 Oct 2014 11:45:14 +0000 (11:45 +0000)]
Update the vdbe-compress.tcl script to account for expressions of the form (123>var), where "var" should be replaced with a reference to a union member.
drh [Mon, 13 Oct 2014 20:12:47 +0000 (20:12 +0000)]
Use the padding word in the Mem object as temporary storage for
serial_type value in OP_Record, and thus avoid a redundant computation of
the serial_type for each column.
drh [Mon, 13 Oct 2014 13:00:58 +0000 (13:00 +0000)]
Remove the OPFLAG_CLEARCACHE flag from OP_Column. In its place, change the
P3 parameter of OP_SorterData to be the index of the pseudo-table cursor whose
record header cache is to be cleared. This gives a small size reduction
and performance increase.
drh [Sun, 12 Oct 2014 22:37:22 +0000 (22:37 +0000)]
Remove the VdbeCursor.lastRowid cache of the current rowid, since maintaining
the correct cache value uses more CPU cycles than just recomputing the rowid
on the occasions when it is actually needed. Replace it with the
VdbeCursor.aOffset field which used to be computed from VdbeCursor.aType
when needed. Saves 100 bytes of code space and runs 0.2% faster.
drh [Sat, 11 Oct 2014 17:22:55 +0000 (17:22 +0000)]
Simplification to the insertCell() routine in btree.c, resulting in a
performance boost and a very small size decrease. It turns out that the
extra work involved in sometimes avoiding an memcpy() of the first four bytes
of a record takes more time than just unconditionally copying those
four bytes.
dan [Fri, 10 Oct 2014 19:10:59 +0000 (19:10 +0000)]
Fix a failing test case in index5.test. Also tweak the way cache memory is divided between read-only and dirty pages when using SQLITE_CONFIG_PAGECACHE to reduce IO in some cases.
drh [Fri, 10 Oct 2014 17:20:39 +0000 (17:20 +0000)]
Add the estimated number of output rows to the EXPLAIN QUERY PLAN output
if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS. This feature is off by
default for the time being.