Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
Date
Msg-id CAFj8pRC3PUgJC85YS1b4iskWT=VB4-wvU=PBF0TJRyLBWgPmGQ@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Responses Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
List pgsql-hackers


2016-01-12 17:01 GMT+01:00 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>:
VS>>Why doesn't backend reuse already existing good plan?
PS>this logic is driven by plan cost, not by plan execution time.

It do understand that currently PG replans with $1, $2 and uses
default selectivities for that.

What I am asking is to make PG aware of "previously used bind values",
so it would calculate proper selectivities for $1, $2.

the implementation is simply - but it hard to design some really general - it is task for UI

Pavel

 

PS. It is not the first time the problem bites me, so I hand-crafted a testcase.

 

Vladimir

pgsql-hackers by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
Next
From: Marko Tiikkaja
Date:
Subject: Re: count_nulls(VARIADIC "any")