.optimize() no longer cleans up _docsize

This isn't necessary any more since the new .rebuild_fts()
method can achieve the same thing.

Refs #155, #153
This commit is contained in:
Simon Willison 2020-09-08 15:18:12 -07:00
commit 64799df78b
4 changed files with 22 additions and 38 deletions

View file

@ -1228,6 +1228,10 @@ This method can be called on a table that has been configured for full-text sear
db["dogs_fts"].rebuild_fts()
This runs the following SQL::
INSERT INTO dogs_fts (dogs_fts) VALUES ("rebuild");
Optimizing a full-text search table
===================================
@ -1240,10 +1244,6 @@ Once you have populated a FTS table you can optimize it to dramatically reduce i
This runs the following SQL::
INSERT INTO dogs_fts (dogs_fts) VALUES ("optimize");
DELETE FROM [dogs_fts_docsize] WHERE id NOT IN (
SELECT rowid FROM [dogs_fts]);
That ``DELETE`` statement cleans up rows that may have been created by `an obscure bug <https://github.com/simonw/sqlite-utils/issues/153>`__ in previous versions of ``sqlite-utils``.
Creating indexes
================