Split WP_POST table based on post types

You could filter 'query' (you get the complete SQL here) and search for the post type in that. Then switch the database depending on what you found.

But I don’t think this would work well:

  • You might end up with the same post ID used multiple times (in each DB) and some strange side effects (comments, taxonomies).
  • Some queries include multiple post types; you would have to rewrite the query to search in all tables.
  • Some queries ask just for a post status or a date … again, you have to go to both databases.