[wp-hackers] Consolidating database tables and other assorteditems

Brian Layman Brian at TheCodeCave.com
Mon Apr 9 14:19:27 GMT 2007


On 4/8/07, Robert Deaton <false.hopes at gmail.com> wrote:
> Really, logically, all the data we store in the database is the same.
> Its all WordPress data, that's why I suggest we consolidate all tables
> into one table, wp_data. This table could have a type column that
> allows you to choose whether you want
> posts,postmeta,categories,link_categories,post2cat,options,users,usermeta,
> etc.

Hey Robert, this is a great idea! In wp_data you'll have your `Want To Find`
column (hmm, have to abbreviate that to something shorter later).  It can be
a string 255 to make it "forward compatible".   Then you can just do "Select
* from wp_data where `Want To Find`='posts'".  What could be simpler?

And you can get rid of all of the "extra columns" and just store them in a
wp_metadata_stuff table, also keyed off of a string. Toss in a few many to
many tables to keep the old keys around to help optimize the upgrade process
and provide flexibility, and you've got yourself one sweet system with maybe
4 tables tops!

+100 on this puppy!

_______________________________________________
Brian Layman
http://www.TheCodeCave.com
 








More information about the wp-hackers mailing list