(text/x-fossil-wiki)
The samples added to the sqlite_stat4 table by the ANALYZE command are
incorrect for WITHOUT ROWID tables. After the key columns, a BLOB that
is the record encoding of the key is added. This is contrary to the
file-format documentation which says that the sample should be an exact
copy of the index entry. Either the file-format document needs to be
fixed or else the samples need to be computed differently. Or both.
Note that the bug has been harmless up to now because the query planner
is unable to use columns in the sample past the key and so the incorrect
sample content was never accessed or used. However, if the query planner
is improved to make use of the extra sample content, older sqlite_stat4
tables might need to be recomputed.
|