Re: sql statement not using all primary key values and poor performance

2024-02-23 Thread Laurenz Albe
On Fri, 2024-02-23 at 18:21 +0800, James Pang wrote: > it's a third-party vendor application, not easy to change their code. Then the application is broken, and you should make the vendor fix it. > is it possible to   1) in Postgresql JDBC driver connection, set >

Re: sql statement not using all primary key values and poor performance

2024-02-23 Thread James Pang
it's a third-party vendor application, not easy to change their code. is it possible to 1) in Postgresql JDBC driver connection, set plan_cache_mode=force_custom_plan or 2) some other parameters can workaround this issue? Thanks, James Laurenz Albe 於 2024年2月23日週五 下午5:17寫道: > On Fri,

Re: sql statement not using all primary key values and poor performance

2024-02-23 Thread Laurenz Albe
On Fri, 2024-02-23 at 15:20 +0800, James Pang wrote: >    we have a SQL from Postgresql JDBC,  primary is based on > (bigint,varchar2,bigint), > but from sql plan, it convert to ::numeric so the plan just use one "varchar" > key column and use the other 2 bigint keys as filters. what's the cause

Re: sql statement not using all primary key values and poor performance

2024-02-22 Thread James Pang
Hi experts, we have a SQL from Postgresql JDBC, primary key is based on (bigint,varchar2,bigint), but from sql plan, it convert to ::numeric so the plan just use one "varchar" key column and use the other 2 bigint keys as filters. what's the cause about that ?

sql statement not using all primary key values and poor performance

2024-02-22 Thread James Pang
Hi experts, we have a SQL from Postgresql JDBC, primary is based on (bigint,varchar2,bigint), but from sql plan, it convert to ::numeric so the plan just use one "varchar" key column and use the other 2 bigint keys as filters. what's the cause about that ? Table