RE: indexing on existing DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> In MySQL, is there any difference between creating an index at table
> creation time, and creating an index on an existing table?  Does an
index
> created on an existing table re-index itself after each insert/update,
or
> does it only index itself once - when you create the index?

In the end, it's the same. Indexes are constantly being built (or added
to) with each insert or update. 

Where it's helpful to create an index after the table is loaded with
data, is if you are loading a bunch of data into a table. Indexes will
slow down INSERTs because it also has to update the index when it
inserts the data. So, it'll be quicker overall to insert all of your
data, and then create an index on the table. This is only applicable if
you're inserting a large amount of data.

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux