Question/Comment on Table structure of WordPress Multisite 3.0

I just installed MultiSite the other day and was pretty shocked to see that it creates a NEW set content tables for each blog. Coming from a background as a database engineer, this practice is an abomination in my opinion. I would have expected the “blog id” to have simply been added to the post ID for a site-wide unique ID.

I have spent the past year developing apps and tools that manipulate the database content at the back end-level. I have a nice system (for my prior single sites) where I could automate most content management without ever going thru the front door.

Here is my question: Has anyone heard of a way to “virtualizing” the WP_XX_Posts (xx=site id) back into a single object? for example:

select (

Select * from WP_1_Posts

union all

Select * from WP_2_Posts

union all

Select * from WP_2_Posts

) as WP_POSTS

One of the challenges of the above scenario is not knowing how many blogs may exist, thus need to dynamically generate the union query.

In order for my content management apps to work without major mod’s I would need to do something like this. Sorry if I am not making send, I just started using WPMS

  • Barry
    • DEV MAN’s Mascot

    I just installed MultiSite the other day and was pretty shocked to see that it creates a NEW set content tables for each blog. Coming from a background as a database engineer, this practice is an abomination in my opinion. I would have expected the “blog id” to have simply been added to the post ID for a site-wide unique ID.

    I believe pretty much everyone who came to WP Multi-site from a database background had the same reaction. It does scale easily though.

    Has anyone heard of a way to “virtualizing” the WP_XX_Posts (xx=site id) back into a single object?

    There was one competing version of WP-MU that did something along those lines I believe – http://lyceum.ibiblio.org/ but with a static large table.

    Unioning all the tables together is v.costly database processing wise, and with an ever increasing number of tables (and blogs), tricky to keep up to date.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.