diff --git a/manifest b/manifest index f6d23dbca6..7f7797b145 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sin\sall\schanges\sthrough\sthe\s3.7.8\srelease. -D 2011-09-19T20:36:42.908 +C Pull\sin\sthe\slatest\schanges\sfrom\strunk.\s\sUpdate\sthe\sSTAT3\sdocumentation. +D 2011-09-21T00:09:41.245 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in d314143fa6be24828021d3f583ad37d9afdce505 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -118,7 +118,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad F src/alter.c ac80a0f31189f8b4a524ebf661e47e84536ee7f5 -F src/analyze.c 3fbffcfbc606d73fa996ded1f874eddffbb06d09 +F src/analyze.c 002e085428c9b2dda5b25f43539178d31c124525 F src/attach.c 12c6957996908edc31c96d7c68d4942c2474405f F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c 28a4fe55327ff708bfaf9d4326d02686f7a553c3 @@ -183,7 +183,7 @@ F src/select.c d9b7d20b0365f80761846f00ef3638d4b33eeaf2 F src/shell.c 13fe2aeddc3cc90d6a273831d1f63736d1596f81 F src/sqlite.h.in 3f531daa04457e83bc13765c98c06c7d71c27fa5 F src/sqlite3ext.h 1a1a4f784aa9c3b00edd287940197de52487cd93 -F src/sqliteInt.h dea1be7eccbc4c4e28fffebae19ab5e2af2b3a26 +F src/sqliteInt.h 6cb04e5216d68becf18fd4a4a6d47ec07f33219c F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -251,7 +251,7 @@ F src/vtab.c 901791a47318c0562cd0c676a2c6ff1bc530e582 F src/wal.c 3154756177d6219e233d84291d5b05f4e06ff5e9 F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f -F src/where.c 4d7321662f1d23c73fce7245470f4a41c18665df +F src/where.c da04df6f003024bd217da9afb369e751417e07da F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 @@ -965,7 +965,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5 F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 51908c8f2bc6c086570f7493a29b096f0a40ce34 3e0da808d2f5b4d12046e05980ca04578f581177 -R 33df24e64f9adc713ca6be5c23008117 +P 9607600b6ca9b546dd248982fd8e8d64f708be5c 36be31ff0af7f811fe2c6f7e26f058cffb7257e1 +R bd162fa2b501bed3d79b1607f9710e81 U drh -Z 7823e3ddec646924dd88293936a2470a +Z 642a2c81deaec7b7de912d100473111b diff --git a/manifest.uuid b/manifest.uuid index e67d380b7d..d79b87d27f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9607600b6ca9b546dd248982fd8e8d64f708be5c \ No newline at end of file +63fc3e4bea6a7f5dc34b2af83f30458eb10b8fe0 \ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index 316f0ecad9..6e33db8c9b 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -23,10 +23,10 @@ ** ** Additional tables might be added in future releases of SQLite. ** The sqlite_stat2 table is not created or used unless the SQLite version -** is between 3.6.18 and 3.7.7, inclusive, and unless SQLite is compiled +** is between 3.6.18 and 3.7.8, inclusive, and unless SQLite is compiled ** with SQLITE_ENABLE_STAT2. The sqlite_stat2 table is deprecated. ** The sqlite_stat2 table is superceded by sqlite_stat3, which is only -** created and used by SQLite versions after 2011-08-09 with +** created and used by SQLite versions 3.7.9 and later and with ** SQLITE_ENABLE_STAT3 defined. The fucntionality of sqlite_stat3 ** is a superset of sqlite_stat2. ** @@ -59,7 +59,7 @@ ** ** The sqlite_stat2 is only created and is only used if SQLite is compiled ** with SQLITE_ENABLE_STAT2 and if the SQLite version number is between -** 3.6.18 and 3.7.7. The "stat2" table contains additional information +** 3.6.18 and 3.7.8. The "stat2" table contains additional information ** about the distribution of keys within an index. The index is identified by ** the "idx" column and the "tbl" column is the name of the table to which ** the index belongs. There are usually 10 rows in the sqlite_stat2 @@ -86,16 +86,28 @@ ** The sqlite_stat3 is an enhancement to sqlite_stat2. A new name is ** used to avoid compatibility problems. ** -** The format of the sqlite_stat3 table is similar to the format for -** the sqlite_stat2 table, with the following changes: (1) -** The sampleno column is removed. (2) Every sample has nEq, nLt, and nDLt -** columns which hold the approximate number of rows in the table that -** exactly match the sample, the approximate number of rows with values -** less than the sample, and the approximate number of distinct key values -** less than the sample, respectively. (3) The number of samples can vary -** from one table to the next; the sample count does not have to be -** exactly 10 as it is with sqlite_stat2. +** The format of the sqlite_stat3 table is similar to the format of +** the sqlite_stat2 table. There are multiple entries for each index. +** The idx column names the index and the tbl column is the table of the +** index. If the idx and tbl columns are the same, then the sample is +** of the INTEGER PRIMARY KEY. The sample column is a value taken from +** the left-most column of the index. The nEq column is the approximate +** number of entires in the index whose left-most column exactly matches +** the sample. nLt is the approximate number of entires whose left-most +** column is less than the same. The nDLt column is the approximate +** number of distinct left-most entries in the index that are less than +** the same. ** +** Future versions of SQLite might change to store a string containing +** multiple integers values in the nDLt column of sqlite_stat3. The first +** integer will be the number of prior index entires that are distinct in +** the left-most column. The second integer will be the number of prior index +** entries that are distinct in the first two columns. The third integer +** will be the number of prior index entries that are distinct in the first +** three columns. And so forth. With that extension, the nDLt field is +** similar in function to the sqlite_stat1.stat field. +** +** There can be an arbitrary number of sqlite_stat3 entries per index. ** The ANALYZE command will typically generate sqlite_stat3 tables ** that contain between 10 and 40 samples which are distributed across ** the key space, though not uniformly, and which include samples with diff --git a/src/sqliteInt.h b/src/sqliteInt.h index cb9ce2fee1..75bafe81a6 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -156,7 +156,7 @@ ** assertion will be triggered. ** ** (Historical note: There used to be several other options, but we've -** pared it down to just these two.) +** pared it down to just these three.) ** ** If none of the above are defined, then set SQLITE_SYSTEM_MALLOC as ** the default. diff --git a/src/where.c b/src/where.c index e673ab620c..962a9dbf7e 100644 --- a/src/where.c +++ b/src/where.c @@ -121,7 +121,7 @@ struct WhereTerm { #ifdef SQLITE_ENABLE_STAT3 # define TERM_VNULL 0x80 /* Manufactured x>NULL or x<=NULL term */ #else -# define TERM_VNULL 0x00 /* Disabled if not using stat2 */ +# define TERM_VNULL 0x00 /* Disabled if not using stat3 */ #endif /* @@ -1341,7 +1341,7 @@ static void exprAnalyze( #endif /* SQLITE_OMIT_VIRTUALTABLE */ #ifdef SQLITE_ENABLE_STAT3 - /* When sqlite_stat2 histogram data is available an operator of the + /* When sqlite_stat3 histogram data is available an operator of the ** form "x IS NOT NULL" can sometimes be evaluated more efficiently ** as "x>NULL" if x is not an INTEGER PRIMARY KEY. So construct a ** virtual term of that form.