Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL

From: "Mark Hollomon" <mhh(at)nortelnetworks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL
Date: 2000-02-03 17:47:18
Message-ID: 3899BF26.61CACD40@americasm01.nt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

Tom Lane wrote:
>
> Chris <chris(at)bitmead(dot)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.
>

WOuld it be possible to consider this a 'statistic' and let
vacuum update it?

In other words, creating an index (or subtable) sets
relhasindex (relhaschild) but vacuum will set it to false
if it finds no children or indexes. or would this
run into concurrency problems as well?

--

Mark Hollomon
mhh(at)nortelnetworks(dot)com
ESN 451-9008 (302)454-9008

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hitesh Patel 2000-02-03 18:43:58 Need help creating a function
Previous Message Bertrand Bourdon 2000-02-03 17:32:55

Browse pgsql-hackers by date

  From Date Subject
Next Message Sevo Stille 2000-02-03 18:06:23 Re: [HACKERS] SERIAL type isn't listed...?
Previous Message Tom Lane 2000-02-03 17:32:39 Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-02-03 18:03:43 Re: [SQL] sql statements
Previous Message Tom Lane 2000-02-03 17:46:29 Re: [SQL] Question about SELECT and ORDER BY