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.
dan [Thu, 9 Oct 2014 15:08:17 +0000 (15:08 +0000)]
Allow FTS tokenizers to choose whether or not to consider the "*" character part of tokens or not. This restores the pre-[e21bf7a2ad] behaviour. Also fix a problem causing FTS to interpret tokens beginning with "*" characters as EOF.
drh [Tue, 7 Oct 2014 23:02:24 +0000 (23:02 +0000)]
Make sure the sqlite3VdbeMemClearAndResize() routine is never called with a
zero size parameter, since a size of zero could lead to either a memory leak
or an assertion fault.
drh [Sat, 4 Oct 2014 00:07:44 +0000 (00:07 +0000)]
Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes
the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine
has a chance to run. Since the aiRowEst now might be deleted from freeIndex()
which does not always have a db pointer, make sure the aiRowEst memory is
not held in lookaside.
drh [Fri, 3 Oct 2014 16:00:51 +0000 (16:00 +0000)]
Add requirements marks on the sqlite3_db_status() interface implementation.
Fix a typo in the documentation. Fix the new sqlite3_result_text64() routine
so that it works correctly with an encoding parameter of SQLITE_UTF16.
drh [Fri, 3 Oct 2014 14:54:47 +0000 (14:54 +0000)]
Update to requirements marks related to changes in the memory allocation
interface and enhancement of the documentation regarding DEFAULT clauses
in CREATE TABLE.
drh [Thu, 2 Oct 2014 21:52:35 +0000 (21:52 +0000)]
Avoid a NULL pointer deference when processing the IS operator if the
right-hand side is an illegal "#ID" style variable.
Fix for ticket [8c32a33a53092c85a15b]
Improvements to the new syntax-tree output routines: Omit the "END SELECT"
mark and instead terminate the graph at the last item. Increase the maximum
tree depth to 100.
Enable the query planner to deal with WHERE clauses that have OR terms
nested within AND terms that are nested within OR terms. Also remove an
unused function declaration.
Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative
debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(),
and sqlite3TreeViewSelect().
Fix the "PRAGMA integrity_check" command so that it avoids formatting error
message context messages until it actually needs to generate an error message.
This avoids much formatting, and hence greatly improves the performance of
"PRAGMA integrity_check" in the common case when there are no errors. It also
makes the code a little smaller.
Have each open database allocate its pTmpSpace when the first write cursor
is opened, rather than on each insert or delete, for a small space savings
and performance boost.
Avoid calling btreeParseCellPtr() from within fillInCell() since most of
what btreeParseCellPtr() computes is ignored by fillInCell(). Instead, have
fillInCell() compute the values it needs inline. Performance improvement.
Tune the query planner to be more aggressive about using automatic indexes
on views and subqueries for which there is not opportunity to declare a
persistent schema index.
Correctly handle an ORDER BY clause on an outer query when applying
the compound-subquery flattening optimization. Ticket [89398880bcfff].
Also add the SQLITE_ENABLE_SELECTTRACE option for additional debugging
and analysis information about select statement processing.