We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    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?
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don't know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 26903
      • 1,336 Posts
      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!
        • 22303 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.
          • 7231
          • 4,205 Posts
          You can go to phpMyAdmin, select the table and under the Operations tab there is an interface to reorder the table by specific columns.
          Thanks, that is good to know. Are there any potential problems/benefits with doing this?
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: dev_cw at Dec 02, 2008, 01:16 PM

            You can go to phpMyAdmin, select the table and under the Operations tab there is an interface to reorder the table by specific columns.
            Thanks, that is good to know. Are there any potential problems/benefits with doing this?
            Not that I am aware of, though I do it just so I don’t have to order things after clicking Browse on a table in phpMyAdmin everytime. Someone with more in-depth knowledge of the MyISAM engine than I might be able to provide some...