Re: Transient plans versus the SPI API - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Transient plans versus the SPI API
Date
Msg-id 21817.1312399151@sss.pgh.pa.us
Whole thread Raw
In response to Re: Transient plans versus the SPI API  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Transient plans versus the SPI API
Re: Transient plans versus the SPI API
Re: Transient plans versus the SPI API
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> This seems like a good design.  Now what would be really cool is if
> you could observe a stream of queries like this:

> SELECT a, b FROM foo WHERE c = 123
> SELECT a, b FROM foo WHERE c = 97
> SELECT a, b FROM foo WHERE c = 236

> ...and say, hey, I could just make a generic plan and use it every
> time I see one of these.  It's not too clear to me how you'd make
> recognition of such queries cheap enough to be practical, but maybe
> someone will think of a way...

Hm, you mean reverse-engineering the parameterization of the query?
Interesting thought, but I really don't see a way to make it practical.

In any case, it would amount to making up for a bad decision on the
application side, ie, not transmitting the query in the parameterized
form that presumably exists somewhere in the application.  I think
we'd be better served all around by encouraging app developers to rely
more heavily on parameterized queries ... but first we have to fix the
performance risks there.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: mosbench revisited
Next
From: "David E. Wheeler"
Date:
Subject: Re: Further news on Clang - spurious warnings