4 ms·
Did anyone ever do something really interesting with table inheritance? This is one feature that looks like I might have use cases for all the time, but they ne
by mhd 8y ago
Did anyone ever do something really interesting with table inheritance? This is one feature that looks like I might have use cases for all the time, but they never quite fit or offer a good benefit.
Foreign data wrappers on the other hand are used by me all the time, as you can have a "common" stuff database and just inject that into all kinds of related ones (like per-tenant setups etc.). I've ran in some issues with joins and performance, but if need be you can just materialize them locally and work from that.
- VectorLock 8y agoI could see it being useful for a lot of situations where people might otherwise be looking for a 'schemaless' solution.
- nickpeterson 8y agoI looked into it for a bit, but it always felt like there were caveats that I didn't like. I think in the end, avoiding explicit hierarchies in modeling is better.
- btilly 8y agoThat is the one feature that you shouldn't use. At $work we use table inheritance - each client gets their own schema with their own copies of the table. The idea is cute, but the problem is that the structure of indexing doesn't cooperate with it. Therefore even the simplest query against a single parent table turns into thousands of index lookups on thousands of different tables. As you can imagine, this is not exactly a scalable situation. If they fixed the index structure, if need be only for a few index types, it would make a huge difference. But it doesn't sound like that is easy internally or will happen any time soon.
- deleted 8y ago[deleted]