Skip site navigation (1) Skip section navigation (2)

Re: Transitive Closure and 'pg_inherits'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transitive Closure and 'pg_inherits'
Date: 2005-04-03 17:13:09
Message-ID: 11594.1112548389@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Ioannis Theoharis <theohari(at)ics(dot)forth(dot)gr> 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

In response to

pgsql-hackers by date

Next:From: Jim C. NasbyDate: 2005-04-04 00:41:51
Subject: Re: [HACKERS] plPHP in core?
Previous:From: Ioannis TheoharisDate: 2005-04-03 17:02:27
Subject: Recursive SQL

pgsql-patches by date

Next:From: Jim C. NasbyDate: 2005-04-04 00:59:21
Subject: Re: HEAD \df doesn't show functions with no arguments
Previous:From: Ioannis TheoharisDate: 2005-04-03 17:02:27
Subject: Recursive SQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group