Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

how to tell if using unnamed paramaterized queries?


  • From: Gene <genekhart(at)gmail(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: how to tell if using unnamed paramaterized queries?
  • Date: Sat, 24 Feb 2007 00:46:47 -0500
  • Message-id: <430d92a20702232146y7d94e675g48b5042f80344157(at)mail(dot)gmail(dot)com>

I'm using version 8.2.3 and noticed that certain queries take a very
long time even though I have partial indexes that it should be using.
It uses them and performs very quickly if I hard code the constants
and do an explain.

I noticed this in the changelog and figured it was the problem but
wanted to make sure I wasn't on a wild goose chase:

"Protocol-level unnamed prepared statements are re-planned for each
set of BIND values (Tom) This improves performance because the exact
parameter values can be used in the plan."

I'm using hibernate and can't determine from the docs if what they use
are considered named/unnamed as stated in the docs above but i'm
guessing by the results they are (S_123/C_124).

LOG:  duration: 23926.439 ms  execute S_123/C_124: select ... PIV1 = ?
OR PIV2 = ? ...
DETAIL:  parameters: $1 = 'PARTIALINDEXVALUE1', $2 = 'PARTIALINDEXVALUE2'

Is there any other way to force postgres to do a replan?

thanks for any help,
Gene



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group