PostgreSQL partitioning explained
This is quite a good informal high-level explanation.<p>A thing I can't understand is why this isn't made automatic.<p>If there are 100 companies, you don't want to create 100 tables, then add 100 FOREIGN KEY constrains, and then again each time a new company appears, do you? Wouldn't a "syntactic sugar" like "PARTITION BY company_id" that does all this automatically be possible?<p>Just asking if there is a reason something like this is not implemented.