[ruby-dbi-users] [dbd_pg] Prepared statement performance

Erik Hollensbe erik at hollensbe.org
Sun Sep 7 03:49:04 EDT 2008


On Sunday 07 September 2008 00:29:05 Erik Hollensbe wrote:
> On Saturday 06 September 2008 19:05:34 KUBO Takehiro wrote:
> > But postgresql's SQL statements are not cached automatically. Database
> > client application must manage it explicitly by a name of the
> > statement, and it is reused only when the name is reused explicitly.
>
> Sounds great, makes perfect sense. Thank you for pointing this out.
> Performance issues aren't my focus at this point, and if you're willing to
> tackle them I'm happy to accept patches.

Oh, I just realized... This may butt heads with the pg_native_binds option, 
which uses server-side bound parameters as well as the prepared statements 
(when it's off, it uses the DBI quoter, which is a little more flexible), so 
if you do end up patching this, you may need to be aware that depending on the 
situation, these options may need to be co-dependent. The majority of the 
relevant code is in lib/dbd/pg/statement.rb.

Thanks again,

-Erik


More information about the ruby-dbi-users mailing list