Re: Allow pooled connections to list all prepared queries - Mailing list pgsql-patches

From Christopher Kings-Lynne
Subject Re: Allow pooled connections to list all prepared queries
Date
Msg-id 41CE2B0B.50601@familyhealth.com.au
Whole thread Raw
In response to Re: Allow pooled connections to list all prepared queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> The usefulness of this seems pretty dubious.  You aren't going to have a
> bunch of random bits of code sharing a connection; it's going to be a
> single application that probably knows perfectly well exactly which
> queries it needs prepared.  So I don't think the stats will pay for
> themselves.

Not true.  Personally, I was looking for something like this, before I
decided to go with stored sql procs instead.

The problem is a website that uses persistent connections.

Say we have a query that takes 350ms to get threads in a forum, and half
of that is planning time.  Any particular PHP process does not know if a
previous process has already prepared that query or not.  So I have to
prepare it every time, deal with errors, etc.

However, I now use sql stored procs as basically 'cached prepared
queries', so it's no longer a problem for me.

Chris

pgsql-patches by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Allow pooled connections to list all prepared queries
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Allow pooled connections to list all prepared queries