[wp-hackers] set/modify the auto-incrementing ID of the wp_postmeta.

Haluk Karamete halukkaramete at gmail.com
Fri Aug 10 23:25:17 UTC 2012


Is it possible to internally set/modify the auto-incrementing ID of a
mysql table, specifically the wp_postmeta?

First, let me tell, where is this need coming from?

I want to see how WP/mysql performs in a condition where wp_postmeta
has millions of records. My goal is to find out if there is an issue
as far as performance is concerned with an ever growing wp_postmeta or
not.

To test this, I will use the 70,000 posts in our current wp_posts
table ( of our non-live site ) and write a little PHP script that puts
1000 dummy records in the wp_postmeta for each every post in the
wp_posts, bringing the record count in the wp-postmeta somewhere in
the neighbourhood of  70M records. Then I will turn on the debug_bar
plugin and compare the SQL speed to the before values. With this test,
I am hoping to see enough info that will allow me to pass judgements
as to if I should use/abuse the wp_postmeta all the way ( the wp way )
or if I should explore the options of creating seperate tables for
various CPTs and CFs ( the pods way ).

Now back to the original question.. Once I put those records and done
with the test, I will need to delete them.

delete from wp_postmeta where meta_id > ? would do the job instantly.

but my next wp-postmeta id would be something like 70M+1. Is there a
way at that moment to tell mysql, hey forget about that 70m that was
temporarily put in and start from where you were?


More information about the wp-hackers mailing list