RE: thousands of CachedPlan entry per backend

Поиск
Список
Период
Сортировка
От James Pang (chaolpan)
Тема RE: thousands of CachedPlan entry per backend
Дата
Msg-id PH0PR11MB5191926DF61A7E2F64A16F92D64EA@PH0PR11MB5191.namprd11.prod.outlook.com
обсуждение исходный текст
Ответ на Re: thousands of CachedPlan entry per backend  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: thousands of CachedPlan entry per backend  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-performance
these lines about "SPI Plan" are these PL/PGSQL functions related SPI_prepare plan entry, right?   Possible to set a
GUCto max(cached plan) per backend ? 
 

    SPI Plan: 1024 total in 1 blocks; 600 free (0 chunks); 424 used
    CachedPlan: 2048 total in 2 blocks; 304 free (1 chunks); 1744 used: xxxxxxx
    CachedPlanSource: 2048 total in 2 blocks; 200 free (0 chunks); 1848 used: xxxxxxx
      CachedPlanQuery: 2048 total in 2 blocks; 704 free (0 chunks); 1344 used

Thanks,

James

-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at> 
Sent: Thursday, June 1, 2023 8:48 PM
To: James Pang (chaolpan) <chaolpan@cisco.com>; Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: thousands of CachedPlan entry per backend

On Thu, 2023-06-01 at 08:50 +0000, James Pang (chaolpan) wrote:
> we found thousands of cached plan , since JDBC driver only allow max 
> 256 cached prepared statements, how backend cache so many sql plans. 
> If we have one function, when application call that function will make 
> backend to cache  every SQL statement plan in that function too?   and for table triggers, have similar caching
behavior?
 

Yes, as long as the functions are written in PL/pgSQL.
It only affects static SQL, that is, nothing that is run with EXECUTE.

Yours,
Laurenz Albe

В списке pgsql-performance по дате отправления:

Предыдущее
От: Sergio Rus
Дата:
Сообщение: Re: How to reduce latency with fast short queries in Postgresql 15.3 on a NUMA server
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: thousands of CachedPlan entry per backend