On 12/20/17, R Smith <ryansmit...@gmail.com> wrote: > I've never known Analyze to consume significant time
ANALYZE runs in O(N) steps, where N is the number of rows in the table. It does a single scan through each index being analyzed, from beginning to end. CREATE INDEX, on the other hand, requires O(NlogN) steps. ANALYZE is normally fast, but can take significant time on a large (terabyte-sized) database. Earlier this year, we worked on an experimental utility program that does a reasonable approximation of ANALYZE in constant time. See the "faststat1" utility on the "est_count_pragma" branch: https://www.sqlite.org/src/timeline?r=est_count_pragma -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users