CREATE INDEX will populate the index with references to all of the rows in the table. Bulk loads may run considerably faster if no indices are present at load time (not yet created or dropped beforehand), but created right after the data has been inserted. If you run INSERT or UPDATE statements later, they will also update the available indices too.
ANALYZE does NOT "populate" an index. It attempts to deduce the "shape" of your data, so that a faster query plan may be selected for queries that require ordering and/or joining several tables. Running ANALYZE is only necessary if the "shape" of your data has changed, e.g. you have loaded a large dataset that is different from what you had before. Note that it is also possible to extract the results of ANALYZE from a "production sized" database and insert them into an empty database (with identical schema, of course), so that running ANALYZE is not required at all even after loading production data. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Nelson, Erik - 2 Gesendet: Mittwoch, 20. Dezember 2017 16:21 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: [EXTERNAL] [sqlite] create index implies analyze? If I am finished making inserts into a table, does the act of creating an index also populate the index? That is, do I need to separately run 'analyze'? My impression was that there was no need to call analyze unless rows had been inserted after index creation. ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users