Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 9AB439FB259 for ; Wed, 10 Jan 2007 16:08:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 72076-04 for ; Wed, 10 Jan 2007 16:07:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id A03C99FB251 for ; Wed, 10 Jan 2007 16:08:00 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id B2C4156445; Wed, 10 Jan 2007 14:07:59 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Wed, 10 Jan 2007 14:07:54 -0600 Date: Wed, 10 Jan 2007 14:07:54 -0600 From: "Jim C. Nasby" To: Tom Lane Cc: Erik Jones , pgsql-performance@postgresql.org Subject: Re: More 8.2 client issues (Was: [Slow dump?) Message-ID: <20070110200753.GR12217@nasby.net> References: <459AD5A8.7030102@myemma.com> <22512.1167779361@sss.pgh.pa.us> <459BD61C.3030202@myemma.com> <11617.1167841479@sss.pgh.pa.us> <459BDC98.8030008@myemma.com> <12515.1167843380@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12515.1167843380@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070110:tgl@sss.pgh.pa.us::GANInyXFLIGmuFGT:00000000000000000000 0000000000000000000000003J+U X-Hashcash: 1:20:070110:erik@myemma.com::iunKVRuVi1dtyRhA:00EwZO X-Hashcash: 1:20:070110:pgsql-performance@postgresql.org::6YAA508k+/KMLRnE:00000 000000000000000000000000AXK1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/141 X-Sequence-Number: 22742 On Wed, Jan 03, 2007 at 11:56:20AM -0500, Tom Lane wrote: > Erik Jones writes: > > Tom Lane wrote: > >> I could see this taking an unreasonable amount of time if you had a huge > >> number of pg_class rows or a very long search_path --- is your database > >> at all out of the ordinary in those ways? > >> > > Well, running "select count(*) from pg_class;" returns 524699 rows > > Ouch. > > > our search path is the default. I'd also like to reiterate that \d > > pg_class returns instantly when run from the 8.1.4 psql client connected > > to the 8.2 db. > > I think I know where the problem is: would you compare timing of > > select * from pg_class where c.relname ~ '^(pg_class)$'; > > select * from pg_class where c.relname ~ '^pg_class$'; > > Recent versions of psql put parentheses into the regex pattern for > safety in case it's got "|", but I just realized that that probably > confuses the optimizer's check for an indexable regex :-( > > However, this only explains slowdown in psql's \d commands, which > wasn't your original complaint ... On the other hand, with 500k relations pg_dump is presumably going to be doing a lot of querying of the catalog tables, so if it uses similar queries... -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)