From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris <chris@bitmead.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL
Date: Thu, 03 Feb 2000 11:26:11 -0500
Message-ID: <27991.949595171@sss.pgh.pa.us> (raw)
In-Reply-To: <38997D1C.9F353FED@bitmead.com>
References: <200002031237.HAA21220@candle.pha.pa.us>
<38997D1C.9F353FED@bitmead.com>
Chris <chris@bitmead.com> writes:
> Why not change that to a relnumindexes as well? Easier to maintain and
> more useful information.
Maintaining an accurate count of descendants (or indexes for that
matter) would be expensive; in particular, it'd create severe
concurrency problems. If one transaction is in the middle of creating
or dropping a child C of table P, then all other transactions would be
blocked from creating or dropping any other children of P until the C
transaction commits or aborts. They'd have to wait or they wouldn't
know what to set relnumchildren to.
For the purpose at hand, I think it would be OK to have a
"relhaschildren" field that is set true when the first child is created
and then never changed. If you have a table that once had children but
has none at the moment, then you pay the price of looking through
pg_inherits; but the case that we're really concerned about (a pure SQL,
no-inheritance table) would still win.
Not sure whether we can concurrently create/delete indexes on a rel,
but I'd be inclined to leave relhasindexes alone: again its main
function in life is to let you short-circuit looking for indexes on
a table that's never had and never will have any.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, chris@bitmead.com, pgman@candle.pha.pa.us, pgsql-hackers@postgreSQL.org
Subject: Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL
In-Reply-To: <27991.949595171@sss.pgh.pa.us>
References: <200002031237.HAA21220@candle.pha.pa.us> <38997D1C.9F353FED@bitmead.com> <27991.949595171@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox