"V S P" <toreason(at)fastmail(dot)fm> writes:
> The application typicall goes like this
> select id, child_tb_key_id, <fields with parms> from tb1
> then for each selected row above
> select from the child table do a select (like the above)
> and so on -- many levels deep
Seems like you need to fix your data representation so that this
operation can be collapsed into one query. The main problem looks
to be a bogus decision to have separate child tables rather than
one big table with an extra key column.
regards, tom lane