Can I split a huge wp_postmeta table across different databases or servers?

[*]

No. This is not practically possible primarily because there is no single interface to this table where you could implement the functionality you need, and even if you could, it would introduce some extremely gnarly problems.

Why this is more or less impossible

What you’re asking can be simplified to a question about if you could easily shard the wp_postmeta table in WordPress. (This is relevant because if you could shard a table, it would be a much smaller step to the shards being on multiple databases / servers).

In sharding, some code has to be able to figure out where to look for the result according to some simple algorithm, and then be able to query only that place. For example, if you had 10 million people in a database, you could put them in different tables or different databases split by the first letter of their name*. This means every time the function to get all the information about a person ran, it would first find the right table according to the first letter of their name*.

The reason this is impossible is that there is no single interface to the posts and/or postsmeta table that would allow you to put this code in one place. To achieve what you want, every single place that touched the postmeta table, or did a join to the postmeta table would need altering to figure out which of your two places to look, according to some deterministic algorithm. You’d also have some extreme gnarly problems about figuring out joins (e.g. join across databases/servers is probably possible but sounds like it would quickly defeat any performance gain).

What are you really trying to do?

It sounds like you’ve got a problem and you think this is the solution, but this is almost definitely not a good solution to whatever your problem is (or any problem in a single WordPress installation). Probably there’s a simpler easier solution, or you’ve got some bad advice/information somewhere.

Why is it a problem that there’s 1M rows? Are you just trying to optimise queries to run faster? Are you running out of disk space somewhere? Do you have some assumptions/limitations you didn’t add to your question?

[*] Note you’d probably try to shard by something that created roughly equally sized pieces, and you might create some kind of index, but this is just an example, read the Wikipedia page for more info.

[*]