Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 - Mailing list pgsql-jdbc

From Vladimir Sitnikov
Subject Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
Date
Msg-id CAB=Je-EqbGdaNauAgpzULSeEBQKw5c-b4GVp9C7k5W4cJGpUXg@mail.gmail.com
Whole thread Raw
In response to Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
Thomas, as far as I see, you have offending queries and bind values
for them, don't you?

Can you please perform the following dance in psql or pgadmin?

PREPARE prep1207(number,number,number,number,number,number) as -- <--
data types for the bind variables
select .. $1, ... where id=$2;  -- <-- your query here

EXPLAIN ANALYZE EXECUTE prep1207(1,2,3,42,100500); -- <-- values for
bind variables
EXPLAIN ANALYZE EXECUTE prep1207(1,2,3,42,100500); -- <-- values for
bind variables
EXPLAIN ANALYZE EXECUTE prep1207(1,2,3,42,100500); -- <-- values for
bind variables
EXPLAIN ANALYZE EXECUTE prep1207(1,2,3,42,100500); -- <-- values for
bind variables
EXPLAIN ANALYZE EXECUTE prep1207(1,2,3,42,100500); -- <-- values for
bind variables

Ideally, it should reproduce the issue. In other words, 5th or 6th
execution should flip to bad plan.

Then share the plan/query.
If table names cannot be made public, you might want try
http://explain.depesz.com/ to anonymize the plan.

Vladimir


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
Next
From: Thomas Kellerer
Date:
Subject: Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102