Analyze has to be run separately. Create Index doesn't gather any stats while 
it's running and doesn't update any of the sqlite_stat1-4 tables. Create Index 
is all you need to run for the index to be created, populated, and used. 
Analyze gives the query planner a more accurate view of how useful the index 
might be for whatever query it's planning.

I have often thought that a "create analyzed index" statement would be nice 
addition though to do the two at the same time.


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Nelson, Erik - 2
Sent: Wednesday, December 20, 2017 10:21 AM
To: SQLite mailing list
Subject: [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
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to