dan [Wed, 27 Aug 2014 17:37:20 +0000 (17:37 +0000)]
When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5].
drh [Wed, 27 Aug 2014 14:14:06 +0000 (14:14 +0000)]
In the sqlite3_context object, keep a pointer to the result value rather
than storing the result value in the sqlite3_context object and using
memcpy() to move the value back into its register
after the function returns. This runs faster and saves over 500 bytes
of code space.
drh [Wed, 27 Aug 2014 03:28:50 +0000 (03:28 +0000)]
Factor out the exception paths from sqlite3ValueToText() into a separate
function so that the main routine is much faster for the common case of
no required type or encoding conversions.
drh [Tue, 26 Aug 2014 15:06:49 +0000 (15:06 +0000)]
Change the page cache so that a new sqlite3_pcache object is allocated as
soon as the page cache is opened, not delayed until the first fetch request.
This give a noticable performance boost. The interface between pager and
the page cache has changed slightly, which might break ZIPVFS.
drh [Mon, 25 Aug 2014 20:11:52 +0000 (20:11 +0000)]
Allow CAST expressions and unary "+" operators to be used in the DEFAULT
argument of an ALTER TABLE ADD COLUMN and to be understand on the RHS of
range constraints interpreted by STAT3/4. This involves a rewrite of the
implementation of the CAST operator.
dan [Mon, 25 Aug 2014 18:29:38 +0000 (18:29 +0000)]
In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned.
drh [Mon, 25 Aug 2014 11:20:27 +0000 (11:20 +0000)]
Change the name of the VdbeMemRelease() macro to VdbeMemReleaseExtern() to
more accurately reflect what it does. Performance enhancement to the
sqlite3VdbeMemRelease() function.
drh [Sat, 23 Aug 2014 18:17:19 +0000 (18:17 +0000)]
Make the implementation of the sqlite3_aggregate_context() interface faster
for second an subsequent invocations. This helps all aggregate functions to
perform better.
drh [Fri, 22 Aug 2014 23:33:03 +0000 (23:33 +0000)]
Another performance tweak: Split the sqlite3BtreeCursorHasMoved() routine
into two with the second routine named sqlite3BtreeCursorRestore(). The first
now only reports whether or not the cursor has moved and the second tries to
restore the cursor. This allows the sqlite3VdbeCursorMoveto() routine to be
refactored to avoid stack pointer movements, for a noticable performance gain.
drh [Fri, 22 Aug 2014 20:35:29 +0000 (20:35 +0000)]
Combine the pcacheAddToDirtyList() and pcacheRemoveFromDirtyList() routines
into a single pcacheManageDirtyList() routine. The resulting binary code is
slightly faster and a few bytes smaller.
drh [Thu, 21 Aug 2014 14:10:23 +0000 (14:10 +0000)]
Fix a faulty assert() statement. Add comments to clarify the behavior of
the sqlite3OpenTableAndIndices() routine in insert.c. Add test cases to
verify that the assert() statement is not firing inappropriately.
Ticket [369d57fb8e5ccdff06f1].
drh [Wed, 20 Aug 2014 23:38:07 +0000 (23:38 +0000)]
Enhancements to skip-scan such that it is operable when a middle column of
an index is skipped while the left-most column is constrained in the WHERE
clause.
drh [Tue, 19 Aug 2014 20:27:40 +0000 (20:27 +0000)]
Make sure the sqlite3_trace() callback is invoked, even if the prepared
statement was marked "expired" before it ever entered sqlite3_step().
Ticket [11d5aa455e0d98f3c1e6a08].
dan [Tue, 12 Aug 2014 13:38:52 +0000 (13:38 +0000)]
If SQLITE_TEST_REALLOC_STRESS is defined, extend the op-code array used by virtual-machine programs by one element at a time, instead of doubling its size with each realloc().
dan [Fri, 8 Aug 2014 16:52:28 +0000 (16:52 +0000)]
Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the same problem as addressed by [2af630c572].
drh [Fri, 8 Aug 2014 15:38:11 +0000 (15:38 +0000)]
The SQLITE_IOERR_BLOCKED extended error code is not longer used, so remove
assert() statements and documentation for that error code. Also make other
documentation improvements.
drh [Thu, 7 Aug 2014 20:42:33 +0000 (20:42 +0000)]
When the estimated sorting cost overwhelms the estimated lookup cost, ensure
that lookup costs are still taken into account when selecting a lookup
algorithm.
drh [Thu, 7 Aug 2014 16:50:00 +0000 (16:50 +0000)]
When the estimated cost to do a sort overwhelms the estimated cost to do
individual table lookups, make sure that the table lookup costs are still
taken into consideration when selecting the lookup algorithm.
drh [Wed, 6 Aug 2014 00:29:06 +0000 (00:29 +0000)]
A simpler fix for ticket [3a88d85f36704eebe1] - one that uses less code.
The error message is not quite as good, but as this error has apparently
not previously occurred in over 8 years of heavy use, that is not seen as
a serious problem.
drh [Tue, 5 Aug 2014 19:16:22 +0000 (19:16 +0000)]
Add the ability to evaluate IN operators as a sequence of comparisons as
an alternative to the long-standing algorithm of building a lookup table.
Use the new implementation in circumstances where it is likely to be faster,
such as when the RHS of the IN changes between successive evaluations.