Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 64DBD9FA238 for ; Wed, 3 Jan 2007 12:56:32 -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 70803-10 for ; Wed, 3 Jan 2007 12:56:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A906A9FA18F for ; Wed, 3 Jan 2007 12:56:21 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l03GuKld012516; Wed, 3 Jan 2007 11:56:20 -0500 (EST) To: Erik Jones cc: pgsql-performance@postgresql.org Subject: Re: More 8.2 client issues (Was: [Slow dump?) In-reply-to: <459BDC98.8030008@myemma.com> 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> Comments: In-reply-to Erik Jones message dated "Wed, 03 Jan 2007 10:40:56 -0600" Date: Wed, 03 Jan 2007 11:56:20 -0500 Message-ID: <12515.1167843380@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/37 X-Sequence-Number: 22638 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 ... regards, tom lane