Re: High Planning Time

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Phil S *EXTERN*'" <pjsanders(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: High Planning Time
Date: 2016-01-22 07:59:59
Message-ID: A737B7A37273E048B164557ADEF4A58B537D51D9@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Phil S wrote:
> I am running Postgresql on a Windows Server 2008 server. I have noticed that queries have very high
> planning times now and then. Planning times go down for the same query immediately after the query
> runs the first time, but then go up again after if the query is not re-run for 5 minutes or so.
>
> I am not able to find any specific information in the documentation that would explain the issue or
> explains how to address it, so am asking for advice here.
>
> Here is an example.
>
> explain analyze
> select * from message
> limit 1
>
> "Limit (cost=0.00..0.44 rows=1 width=1517) (actual time=0.009..0.009 rows=1 loops=1)"
> " -> Seq Scan on message (cost=0.00..28205.48 rows=64448 width=1517) (actual time=0.007..0.007
> rows=1 loops=1)"
> "Planning time: 3667.361 ms"
> "Execution time: 1.652 ms"
>
> As you can see the query is simple and does not justify 3 seconds of planning time. It would appear
> that there is an issue with my configuration but I am not able to find anything that looks out of
> sorts in the query planning configuration variables. Any advice about what I should be looking for to
> fix this would be appreciated.

This is odd.

Could you profile the backend during such a statement to see where the time is spent?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vitalii Tymchyshyn 2016-01-22 14:11:11 Re: High Planning Time
Previous Message Jinhua Luo 2016-01-22 05:54:48 Re: insert performance