Our system uses inheritance on two levels:
- master
- child_level_1
- child_level_2
- child_level_2
- child_level_2
- child_level_1
- child_level_2
- child_level_2
- child_level_1
- child_level_2
- child_level_1
The idea was to aggregate data by using the parent tables. But we realized that accessing the parent tables was way too slow to be useful.
We have around 500.000 tables right now and it would be nice if we could drop the parent tables to reduce that number a bit.
Is it possible to drop the inheritance from the master table? Or do we have to do it for every child?
The ideal solution would be one query that leaves us with only child_level_2 tables. They would still have all the columns that they inherited before.
Is that possible?