Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id C56A32E003B for ; Fri, 2 May 2008 19:21:06 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 46708-02 for ; Fri, 2 May 2008 19:20:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id CA7282E0031 for ; Fri, 2 May 2008 19:21:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m42MKw6Q026119; Fri, 2 May 2008 18:20:58 -0400 (EDT) To: Ernesto cc: pgsql-performance@postgresql.org Subject: Re: Very slow INFORMATION_SCHEMA In-reply-to: <481B82AE.8050607@gmail.com> References: <481B82AE.8050607@gmail.com> Comments: In-reply-to Ernesto message dated "Fri, 02 May 2008 18:07:58 -0300" Date: Fri, 02 May 2008 18:20:58 -0400 Message-ID: <26118.1209766858@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/37 X-Sequence-Number: 30005 Ernesto writes: > I'm wondering why would this query take about 90 seconds to return 74 rows? EXPLAIN ANALYZE might tell you something. Is this really the query you're running? Because these two columns don't exist: > INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, > INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME Leaving those out, I get sub-second runtimes for 70-odd foreign key constraints, on much slower hardware than I think you are using. regards, tom lane