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

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: James Pang <jamespang886(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: sql statement not using all primary key values and poor performance
Date: 2024-02-23 11:48:55
Message-ID: b35f429c57756a151f5b1bbc73b80f24249d75e7.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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
> plan_cache_mode=force_custom_plan    or 2) some other parameters can workaround this issue?

You can set "prepareThreshold" to 0 to keep the JDBC driver from using
prepared statements in PostgreSQL. I am not sure if that is enough to
fix the problem.

Yours,
Laurenz Albe

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message James Pang 2024-02-26 06:01:57 Re: FW: huge SubtransSLRU and SubtransBuffer wait_event
Previous Message James Pang 2024-02-23 10:21:05 Re: sql statement not using all primary key values and poor performance