drh [Thu, 1 Aug 2013 01:14:43 +0000 (01:14 +0000)]
Add the logic to keep partial indices up to date through DML statements and
when new partial indices are created. This new logic is untested except to
verify that it does not interfere with full indices.
Add logic to the query planner to only use partial indices if the WHERE clause
constrains the search to rows covered by the partial index. This is just
infrastructure. The key routine, sqlite3ExprImpliesExpr(), is currently a
no-op so that partial indices will never be used.
Resolve names in CREATE INDEX WHERE clauses and detect errors. Disallow
expressions that contain variables, subqueries, or functions.
The expression is still not used for anything, however.
still unused.
Here begins an experimental branch for exploring the idea of a partial index.
This check-in is able to parse a WHERE clause on a CREATE INDEX statement, but
does not actually do anythingn with that WHERE clause yet.
In main.mk, always recompile vdbe.o and parse.o first, since changes to either
parse.y or vdbe.c will cause all files to be recompiled and if there are
syntax errors in vdbe.c or parse.y we want to hit them early in the compile
process.
Enhance the progress handler so that it keeps track of the number of VDBE
cycles across sqlite3_step() calls and issues callbacks when the cumulative
instruction count reaches threshold.
Documentation changes to warn that sqlite3_set_auxdata() might call the
destructor even before it returns. Also fix the regexp extension to deal
with that case. Ticket [406d3b2ef91c].
Change the description of how sqlite3_progress_handler() works so that
the N parameter is "approximate". This aligns with the current implementation.
This is a documentation change only. No changes to code.
Add the "defer_foreign_keys" pragma and the SQLITE_DBSTATUS_DEFERRED_FKS
value for sqlite3_db_status(). This is a cherry-pick of a sequence of five
checkins in the sessions branch between [1d44e5d3c2] and [d39e65fe70].
Run progress callback checks less frequently in the main VDBE evaluation
loop. This makes up for the extra CPU cycles used to increment the cycle
counter for SQLITE_STMTSTATUS_VM_STEP.
Fix an adverse interaction between the IS NOT NULL optimization (available
only with SQLITE_ENABLE_STAT3) and the transitive constraint processing.
Fix for ticket [d805526eae253]
dan [Sat, 6 Jul 2013 17:57:39 +0000 (17:57 +0000)]
Drop any existing mapping of the database file when exiting the pager "error state", as it may at this point be too large for the database file. Do not invoke file-control MMAP_LIMIT if the database file handle does not support xFetch and xUnfetch (on the grounds that xUnfetch(0) calls to invalidate the mapping cannot be made).
drh [Sat, 29 Jun 2013 15:40:22 +0000 (15:40 +0000)]
Fix the build of the command-line shell on windows. Windows uses "_pclose"
rather than "pclose" as the pointer to the function that closes a popen pipe.
drh [Fri, 28 Jun 2013 21:12:20 +0000 (21:12 +0000)]
Add the SQLITE_DEFAULT_AUTOMATIC_INDEX compile-time option, which if set to
zero turns automatic indices off by default. Increase the estimated cost
of an automatic index. Additional minor refactoring of the automatic
index code.
dan [Fri, 28 Jun 2013 19:41:43 +0000 (19:41 +0000)]
Allow read transactions to be freely opened and closed by SQL statements run from within the implementation of user-functions if the user-function is called by a SELECT statement that does not access any database tables (e.g. "SELECT user_function();").
drh [Fri, 28 Jun 2013 17:29:25 +0000 (17:29 +0000)]
Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS option for sqlite3_file_control()
that will disable the use of SQLITE_STAT3 information in the query planner.
drh [Thu, 27 Jun 2013 23:54:02 +0000 (23:54 +0000)]
Refactor names of fields in the sqlite3 object: "activeVdbeCnt" becomes
"nVdbeActive". Related fields becomes "nVdbeRead", "nVdbeWrite", and
"nVdbeExec".
drh [Thu, 27 Jun 2013 17:40:30 +0000 (17:40 +0000)]
Make sure that sqlite3_stmt_readonly reports false for
PRAGMA journal_mode and PRAGMA wal_checkpoint. Ticket [a589ec069e3].
Also keep track of whether a prepared statement does no reading or
writing.
dan [Thu, 27 Jun 2013 14:24:15 +0000 (14:24 +0000)]
Add a test to ensure that if BEGIN IMMEDIATE fails with SQLITE_BUSY, it does not leave the user with an open read transaction (unless one was already open).
drh [Thu, 27 Jun 2013 13:01:21 +0000 (13:01 +0000)]
The undocumented and unsupported ".selftest" command in the command-line
shell utility is now only available if compiled with SQLITE_DEBUG. Also
fix a windows compiler warning in that command.
dan [Thu, 27 Jun 2013 11:46:27 +0000 (11:46 +0000)]
Add extended error code SQLITE_BUSY_SNAPSHOT - returned in WAL mode when a read-transaction cannot be upgraded to a write-transaction because it is reading from a snapshot other than the most recently committed.
drh [Wed, 26 Jun 2013 22:46:00 +0000 (22:46 +0000)]
Update the ".import" command of the command-line shell so that it can
accept field values that span multiple lines and so that it issues
error messages if the input text does not strictly conform to RFC4180.
drh [Fri, 21 Jun 2013 02:15:48 +0000 (02:15 +0000)]
Only eliminate inner loops of a JOIN if they are the RHS of a LEFT JOIN
and if they give no more than a single result. This appears to give correct
answers in all cases.
drh [Fri, 21 Jun 2013 02:05:06 +0000 (02:05 +0000)]
Attempt to disable inner loops of a join that do not generate output.
This does not work, since the inner loops might run zero times and thus
inhibit all output. Needs to be enhanced to work only for LEFT JOINs
or when we know that the inner loop will always run at least once.
drh [Fri, 21 Jun 2013 00:35:37 +0000 (00:35 +0000)]
Modify the query planner interface so that it always passes in the result set.
This is the first step toward adding an optimization that will omit tables
from a join that do not contribute to the result.