I was just looking at the database .sql file (from dump) of a few existing sites and noticed that the modx_site_content table follows an odd indexing pattern. What I mean is that in all of the other tables the rows are in order 1,2,3,4,5... but in the content table the order jumps all over the place 1,2,3,98,4,5,132,7.. Why is this? Is MySql using the space from deleted rows or something like that? is there a way to reindex them to get them in order again?
I believe your right, I’ve seen this in the TV table. If you delete a document say, then create one it will use use the deleted row for the new doc with its id field auto incremented of course hence the id’s seem jumbled. I’m not sure what algorithm MYSQL uses here maybe try the MYSQL site. I think you can re-index/repair a table using phpMyAdmin or the MYSQL cli client but I’ve never done this so I’m not sure, google is your friend.
Use MODx, or the cat gets it!
-
MODX Staff
- 10,725 Posts
Right, natural order does not equal primary key order in MySQL. You can go to phpMyAdmin, select the table and under the Operations tab there is an interface to reorder the table by specific columns.