Received: from smtprtp.ntcom.nortel.net (smtprtp.ntcom.nortel.net [137.118.22.15]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA28813 for ; Thu, 3 Feb 2000 12:45:58 -0500 (EST) (envelope-from mhh@nortelnetworks.com) Received: from zrtpd004.us.nortel.com (actually zrtpd004) by smtprtp.ntcom.nortel.net; Thu, 3 Feb 2000 12:45:28 -0500 Received: from zrtpd003.us.nortel.com ([47.140.224.137]) by zrtpd004.us.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id 1D5VBTGR; Thu, 3 Feb 2000 12:45:25 -0500 Received: from americasm01.nt.com (hrtpp28d.us.nortel.com [47.190.110.250]) by zrtpd003.us.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id DJLAH671; Thu, 3 Feb 2000 12:45:24 -0500 Message-ID: <3899BF26.61CACD40@americasm01.nt.com> Date: Thu, 03 Feb 2000 12:47:18 -0500 From: "Mark Hollomon" Reply-To: "Mark Hollomon" Organization: Nortel Networks X-Mailer: Mozilla 4.04 [en] (Win95; U) MIME-Version: 1.0 To: Tom Lane CC: Bruce Momjian , pgsql-hackers@postgreSQL.org Subject: Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL References: <200002031237.HAA21220@candle.pha.pa.us> <38997D1C.9F353FED@bitmead.com> <27991.949595171@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote: > > Chris 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@nortelnetworks.com ESN 451-9008 (302)454-9008