Re: Slow query-plan generation (fast query) PG 9.2

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: jesper(at)krogh(dot)cc, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow query-plan generation (fast query) PG 9.2
Date: 2013-09-03 07:47:08
Message-ID: 522593FC.3010302@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 09/03/2013 03:46 PM, jesper(at)krogh(dot)cc wrote:
> Hi.
>
> I have a strange situation where generating the query plan takes 6s+ and
> executing it takes very little time.

How do you determine that it's planning time at fault here?

Please take separate timing for:

PREPARE testq AS select table.id from db.table left
join db.tablepro on db.id = tablepro.table_id where table.fts @@
to_tsquery('english','q12345') ;

and then:

EXPLAIN ANALYZE EXECUTE testq;

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Roberto Grandi 2013-09-03 16:16:13 COPY TO and VACUUM
Previous Message jesper 2013-09-03 07:46:02 Slow query-plan generation (fast query) PG 9.2