Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.
|Comment:||Fix a couple of typos in comments in analyze.c.|
|Downloads:||Tarball | ZIP archive | SQL archive|
|Timelines:||family | ancestors | descendants | both | stat3-enhancement|
|Files:||files | file ages | folders|
|User & Date:||dan 2011-08-15 12:02:21|
|12:58||Update some test cases to work with sqlite_stat3 instead of sqlite_stat2. check-in: 2504bcfb user: drh tags: stat3-enhancement|
|12:02||Fix a couple of typos in comments in analyze.c. check-in: ae31dc67 user: dan tags: stat3-enhancement|
|19:35||Further testing and bug fixing for sqlite_stat3. Added the Index.avgEq field to index statistics. Fixed several problems in the query planner associated with stat3. check-in: 89b2f708 user: drh tags: stat3-enhancement|
Changes to src/analyze.c.
61 61 ** with SQLITE_ENABLE_STAT2 and if the SQLite version number is between 62 62 ** 3.6.18 and 3.7.7. The "stat2" table contains additional information 63 63 ** about the distribution of keys within an index. The index is identified by 64 64 ** the "idx" column and the "tbl" column is the name of the table to which 65 65 ** the index belongs. There are usually 10 rows in the sqlite_stat2 66 66 ** table for each index. 67 67 ** 68 -** The sqlite_stat2 entires for an index that have sampleno between 0 and 9 68 +** The sqlite_stat2 entries for an index that have sampleno between 0 and 9 69 69 ** inclusive are samples of the left-most key value in the index taken at 70 70 ** evenly spaced points along the index. Let the number of samples be S 71 71 ** (10 in the standard build) and let C be the number of rows in the index. 72 72 ** Then the sampled rows are given by: 73 73 ** 74 74 ** rownumber = (i*C*2 + C)/(S*2) 75 75 ** ................................................................................ 88 88 ** 89 89 ** The format of the sqlite_stat3 table is similar to the format for 90 90 ** the sqlite_stat2 table, with the following changes: (1) 91 91 ** The sampleno column is removed. (2) Every sample has nEq, nLt, and nDLt 92 92 ** columns which hold the approximate number of rows in the table that 93 93 ** exactly match the sample, the approximate number of rows with values 94 94 ** less than the sample, and the approximate number of distinct key values 95 -** less than the sample, respectively. (3) The number of samples can very 95 +** less than the sample, respectively. (3) The number of samples can vary 96 96 ** from one table to the next; the sample count does not have to be 97 97 ** exactly 10 as it is with sqlite_stat2. 98 98 ** 99 99 ** The ANALYZE command will typically generate sqlite_stat3 tables 100 100 ** that contain between 10 and 40 samples which are distributed across 101 101 ** the key space, though not uniformly, and which include samples with 102 102 ** largest possible nEq values.