Re: Very slow INFORMATION_SCHEMA

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ernesto <equistango(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Very slow INFORMATION_SCHEMA
Date: 2008-05-02 22:20:58
Message-ID: 26118.1209766858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ernesto <equistango(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2008-05-02 22:29:00 Re: two memory-consuming postgres processes
Previous Message Alexy Khrabrov 2008-05-02 22:03:12 Re: two memory-consuming postgres processes