drh [Tue, 22 Oct 2013 18:01:40 +0000 (18:01 +0000)]
The Index object now has nKeyCol and nColumn. nColumn is the total number
of columns and nKeyCol is the number of key columns. Currently these always
differ by one. Refactor aiColumn[] to be of type i16 instead of int.
drh [Tue, 22 Oct 2013 10:23:26 +0000 (10:23 +0000)]
Extra backwards-compatibility tests verify that UNIQUE and PRIMARY KEY
indices are created in the correct order. Other backwards-compatibility
tests already cover this, but it does not hurt to double up.
drh [Tue, 22 Oct 2013 01:18:17 +0000 (01:18 +0000)]
Previous refactor is not going to be helpful because implied indices must be
created in the same order that they appear in the CREATE TABLE statement
for backwards compatibility. This is a much smaller change to clean up a
few loose ends.
drh [Sat, 19 Oct 2013 23:31:56 +0000 (23:31 +0000)]
Experimental changes toward "index only" tables. Add the ability to specify
options on CREATE TABLE statements using the WITH clause modeled after
PostgreSQL and SQL Server. Only the "omit_rowid" option is currently
recognized and that option is currently a no-op.
dan [Sat, 19 Oct 2013 15:07:49 +0000 (15:07 +0000)]
Fix a bug causing an "malformed database schema error" error if a temp table with the same name as an existing table that has at least one temp trigger attached to it is created.
drh [Fri, 18 Oct 2013 20:03:43 +0000 (20:03 +0000)]
Add the SQLITE_FCNTL_TRACE file control and generate it for OP_Trace
when compiled with SQLITE_USE_FCNTL_TRACE. Update vfslog.c to make
use of the new file control. Also update vfslog.c to log UNLOCK events
before the fact, rather than afterwards.
mistachkin [Mon, 14 Oct 2013 22:35:40 +0000 (22:35 +0000)]
Fix harmless compiler warning in the totype extension. Include all standard whitespace characters in totypeIsspace. Minor adjustments to style and comments.
drh [Fri, 11 Oct 2013 23:37:57 +0000 (23:37 +0000)]
Identify requirements text in the SQLITE_CONFIG_ documentation. Fix a typo
(a duplicated word) in part of that documentation. Add some requirements
marks for DETACH to the test scripts. No code changes.
drh [Thu, 10 Oct 2013 12:38:11 +0000 (12:38 +0000)]
Estimate row sizes for tables and indices and use those estimates during
query planning. Enhance the index_info pragma to show the estimated row
sizes and to show the estimated row size for the main table as well. Allow
an alternative row size estimate to be specified in the sqlite_stat1 table.
drh [Mon, 7 Oct 2013 17:32:15 +0000 (17:32 +0000)]
Multiply all cursor step cost estimates by the estimated size of the row in
bytes, in order to get the query planner ot make use of estimated row sizes.
This check-in uses magic numbers in a few places (for example, estimates of
the size of output rows) and needs lots of refinement. Consider this a
proof-of-concept only.
drh [Mon, 7 Oct 2013 00:36:01 +0000 (00:36 +0000)]
Restore the hexrekey pragma which was accidently deleted during the
pragma refactoring. Make sure the hexkey and hexrekey pragmas do not
overflow buffers with a over-length key.
drh [Sat, 5 Oct 2013 19:18:00 +0000 (19:18 +0000)]
Completely remove the iScanRatio field. The PRAGMA index_list(TABLE) command
shows the estimated row size in the forth column. It also generates a row
for the table with an index name of NULL. The query planner still does not
take row size estimates into account - that is the next step.
drh [Sat, 5 Oct 2013 18:16:02 +0000 (18:16 +0000)]
Begin an experimental refactoring to estimate the average number of bytes
in table and index rows and to use that information in query planner.
Begin by renaming WhereCost to LogEst and making that type and its
conversion routines available outside of where.c.
dan [Fri, 4 Oct 2013 18:17:18 +0000 (18:17 +0000)]
If an "INSERT INTO ... SELECT" can use the xfer optimization, pass the OPFLAG_BULKCSR hint to btree cursors used to update indices. This results in a tighter key packing.
drh [Fri, 4 Oct 2013 15:30:21 +0000 (15:30 +0000)]
Improved estimates of the relative speed of index scans based on declared
datatypes of columns in the table. Add "r" column to PRAGMA index_info,
showing the estimated relative scan rate.
dan [Thu, 3 Oct 2013 20:41:18 +0000 (20:41 +0000)]
Have FTS take advantage of "docid<?" constraints when they are present. Extend the FTS "incremental doclist" optimization so that it is used for tokens within multi-token phrases.
dan [Thu, 3 Oct 2013 19:27:14 +0000 (19:27 +0000)]
Allow FTS4 multi-token phrases to use a combination of in-memory and incrementally loaded doclists. This allows phrases to (partially) benefit from incremental doclists without disabling the deferred token optimization.
drh [Thu, 3 Oct 2013 14:08:07 +0000 (14:08 +0000)]
Rework the PRAGMA implementation to only call sqlite3ReadSchema() from a single
place, based on a flag in the pragma table, rather than separately from each
case which needs the schema.
dan [Thu, 3 Oct 2013 12:29:38 +0000 (12:29 +0000)]
Return an error if an attempt is made to create a trigger with an SQL variable embedded within it. If such a variable reference is found within a trigger definition loaded from the sqlite_master table, silently replace it with a NULL.
dan [Tue, 1 Oct 2013 20:02:32 +0000 (20:02 +0000)]
Allow multi-token phrases to load doclists from the database incrementally. This allows queries that feature such phrases to benefit from the "docid<?" optimization.
drh [Tue, 1 Oct 2013 15:30:05 +0000 (15:30 +0000)]
Change the ".dump" command in the command-line shell so that it COMMITs
if there are database corruption errors but invokes ROLLBACK on any other
kind of error.