On czw, 2007-01-04 at 10:44 -0500, Tom Lane wrote: > Grzegorz Nowakowski <krecik@xxxxxxxxx> writes: > > But I have another question: why can't be > > inheritance implemented as implicit JOIN? > > Interesting thought, but joins are expensive --- this would be quite a > lot slower than the current way, I fear, especially when you consider > more than one level of inheritance. Also, switching over to this would > destroy the current usefulness of inheritance for partitioning. Well, I never used partitioning and I don't know what it's worth but just after sending my original mail I got another variant of the idea: to duplicate columns (parent(p), child(p,c)), so inserts into child update both parent's and child's index. This way we trade space (common columns are replicated along inheritance hierarchy) and some speed (inserts into child are slower because they also have to update parent) for some other speed (selects work without join penalty). Yet still we have the primary benefit: parent's constraints and indexes work as expected. I'm well aware that even if my idea has some merit, it won't be soon when it goes into code, if ever. I expect it would take small revolution to make it. Anyway, I tried. :) Best regards. -- Grzegorz Nowakowski