I have several tables that are 10's of millions of rows, and have multiple indexes. When dumping and reloading the data it takes quite a while to reinsert because of the indexes, or to insert without indexes then re-index.
I understand that an index gives a database engine a quick way to locate a record on disk, and since a database dump and reload would or could effectively change the location of data on the disk, the index could potentially be invalidated. However, it still seems like you should be able to optimize a table by contiguously and sequentially locating all it's records on disk, then just have the index refer to a start location plus offset. Has anyone anywhere done any work on this type of thing?
Desired functionality: I could dump the data raw, load it in a sequential uninterrupted disk area, then just load in the indexes and tell the engine to update with the new table start position. After googling around on this, I see nothing...