Re: Transitive Closure and 'pg_inherits'

From: Tom Lane
Subject: Re: Transitive Closure and 'pg_inherits'
Date: ,
Msg-id: 11594.1112548389@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Transitive Closure and 'pg_inherits'  (Ioannis Theoharis)
List: pgsql-hackers

Tree view

contrib/pg_buffercache  ("Andrew Dunstan", )
 Re: contrib/pg_buffercache  (Mark Kirkwood, )
 Re: contrib/pg_buffercache  (Mark Kirkwood, )
  Re: contrib/pg_buffercache  (Andrew Dunstan, )
   Re: contrib/pg_buffercache  (Mark Kirkwood, )
    Re: contrib/pg_buffercache  (Andrew Dunstan, )
     Re: contrib/pg_buffercache  (Mark Kirkwood, )
 Transitive Closure and 'pg_inherits'  (Ioannis Theoharis, )
  Re: Transitive Closure and 'pg_inherits'  (Tom Lane, )
 Recursive SQL  (Ioannis Theoharis, )
  Re: Recursive SQL  (Euler Taveira de Oliveira, )

Ioannis Theoharis <> writes:
> My question is whether the way, in wich postgresql do this task, is a
> transitive closure on table 'pg_inherits' or there is a better approach
> implemented (like numbering scheme techniques etc.) ?

It's a transitive closure, and not a very bright one at that; see
find_all_inheritors(), find_inheritance_children(), and particularly
the comments to the latter.  However, we've not heard reports indicating
that this is a serious bottleneck in any real-world situation, so
no one has spent time to improve it.  (I'd expect the per-table planning
costs to vastly outweigh the cost of finding those tables, anyway.)
        regards, tom lane



pgsql-hackers by date:

From: Tom Lane
Date:
Subject: Re: Transitive Closure and 'pg_inherits'
From: "Jim C. Nasby"
Date:
Subject: Re: [GENERAL] plPHP in core?