Load data intelligently

When you add an index to your tables, MySQL needs to do a lot more work whenever it modifies that table - it needs to write the new value, as well as updating the index. As a result, you should be careful how you choose to load your data when you are creating a table and inserting lots of values.

If you find yourself in this situation, it is much faster to create the table without any indexing, add all the fields, then add the indexes.

 

Next chapter: Consider splitting off variable-length fields >>

Previous chapter: Declare fields NOT NULL

Jump to:

 

Home: Table of Contents

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar