You all know I'm a bit odd from time to time... This is one of those days.
I was wondering if we shouldn't (couldn't) do something specific on each table row deletion.
Let's say we have a draft that we don't want to keep (or that doesn't need to remain on the server because we just saved the original post), so Wedge will delete it internally... So we go through Post2.php:904, and the draft is deleted. Along with the auto-incremented (likely) latest id_draft.
If we could simply call ALTER TABLE {db_prefix}drafts AUTO_INCREMENT=1, where the auto_increment value would be set to the earliest 'available' id, that means it would be much slower for the table to reach its maximum size. Granted, it's int in this case, but you get my point: by being too lazy about some tables, and not resetting the auto_increment when we could do it, we're basically wasting IDs.
So maybe we could have an optional feature in db_query that would check whether a table row is being deleted, and if it is, just set its auto_increment to 1, either by checking against a whitelist of tables with auto_increment fields, or just doing it automatically (I doubt MySQL would do anything else than ignore the request if it has no such field.)
Is it too crazy..? Too smart for its own good?
(Oh, did you notice how I changed the layout for the top of the post page? The icons are now inside the select box itself, and the select box was moved to the left of the title input... I like that. Hopefully you all do.)
I was wondering if we shouldn't (couldn't) do something specific on each table row deletion.
Let's say we have a draft that we don't want to keep (or that doesn't need to remain on the server because we just saved the original post), so Wedge will delete it internally... So we go through Post2.php:904, and the draft is deleted. Along with the auto-incremented (likely) latest id_draft.
If we could simply call ALTER TABLE {db_prefix}drafts AUTO_INCREMENT=1, where the auto_increment value would be set to the earliest 'available' id, that means it would be much slower for the table to reach its maximum size. Granted, it's int in this case, but you get my point: by being too lazy about some tables, and not resetting the auto_increment when we could do it, we're basically wasting IDs.
So maybe we could have an optional feature in db_query that would check whether a table row is being deleted, and if it is, just set its auto_increment to 1, either by checking against a whitelist of tables with auto_increment fields, or just doing it automatically (I doubt MySQL would do anything else than ignore the request if it has no such field.)
Is it too crazy..? Too smart for its own good?
(Oh, did you notice how I changed the layout for the top of the post page? The icons are now inside the select box itself, and the select box was moved to the left of the title input... I like that. Hopefully you all do.)



