Re: Posgresql Log: lots of parse statements

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Vikas Sharma <shavikas(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Posgresql Log: lots of parse statements
Date: 2018-03-01 17:28:23
Message-ID: CAKFQuwbLaXQt3fpvaehjdsCYhAd1xxNcfx7iWMVnZ-HR5j_OHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, March 1, 2018, Vikas Sharma <shavikas(at)gmail(dot)com> wrote:

> Thanks David,
>
> But why are there so many parse statement occurances for one query? Does
> postgres parse the statement everytime before execution or parse the query
> only first time it is loaded in memory and reuse the same parsed plan until
> it ages out of memory?.
>
> In the log I can see these parse statement occurances about 400 times in a
> day and everytime taking longer than 15 secs.
>

Please don't top-post replies.

Normally "parse unnamed" happens when client interfaces execute prepared
statements using parse-bind-execute protocol. If you want to reduce the
number you will need to change your application. As for the time it takes
its impossible to say without knowing more about the environment and query.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2018-03-01 17:28:51 Re: Version upgrade: is restoring the postgres database needed?
Previous Message Tom Lane 2018-03-01 17:26:43 Re: Posgresql Log: lots of parse statements