On 8/29/19 10:56 AM, dirdi wrote: > On 8/29/19 6:10 PM, Keith Medcalf wrote: >> Do you have sqlite_stat1 or sqlite_stat4 tables present (that is, have you >> ever run analyze)? > No. > >> If the sqlite_stat1 or sqlite_stat4 tables are present, then if you run >> ANALYZE; rather than reindexing or dropping/recreating the index, what is >> the result? > If I run ... > >> ANALYZE; >> REINDEX; >> ANALYZE; > ... instead of ... > >> DROP INDEX `idx1`; >> CREATE INDEX `idx1` ON `tbl1` ( >> `int` >> ); > the UPDATE query remains being slow (~36m). > One thought, could there perhaps be something about the query that the ANALYZE gives bad information about how the structure of data in the table that dropping and recreating (which deletes the results of the last ANALYZE) makes the query planner chose a different plan which works better. Perhaps you could look at and compare the query plans of the two different scenarios.
-- Richard Damon _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users