Re: performance of sql and plpgsql functions

2024-06-18 Thread Julius Tuskenis
On 2024-06-17 17:24, Tom Lane wrote: Julius Tuskenis writes: EXPLAIN (ANALYZE, BUFFERS, VERBOSE)   SELECT     COALESCE(sum(mok_nepadengta), 0)   FROM     public.b_pardavimai     JOIN public.b_mokejimai ON (mok_pardavimas = pard_id)   WHERE     (pard_tipas = ANY('{1, 2,

Re: performance of sql and plpgsql functions

2024-06-17 Thread Julius Tuskenis
On 2024-06-17 15:59, Philip Semanchuk wrote: On Jun 17, 2024, at 5:35 AM, Julius Tuskenis wrote: Isn't PosgreSQL supposed to inline simple SQL functions that are stable or immutable? Postgres inlines SQL functions under certain conditions: https://wiki.postgresql.org

Re: performance of sql and plpgsql functions

2024-06-17 Thread Julius Tuskenis
Thank you Pavel for your input. You wrote: no, PLpgSQL functions are not inlined Yes, I understand that. I was referring to SQL functions (not plpgsql). Regards, Julius Tuskenis On 2024-06-17 12:44, Pavel Stehule wrote: po 17. 6. 2024 v 11:35 odesílatel Julius Tuskenis napsal

performance of sql and plpgsql functions

2024-06-17 Thread Julius Tuskenis
this "anomaly" is highly appreciated? I've tried executing the same query on different server and different database - I could not reproduce the behavior. Using SQL function produces results faster. I'd be gratefull to receive some insights of how to investigate the behavior. I'm not keen on changing the language or the function not knowing why it is required or how it helps... Regards, Julius Tuskenis

Re: PG 12 slow selects from pg_settings

2021-10-08 Thread Julius Tuskenis
> The history is long, but if you want to read. > https://www.postgresql.org/message-id/flat/7ff352d4-4879-5181-eb89-8a2046f928e6%40dunslane.net Thank you, Ranier. It's amazing how much effort and work that issue caused! Thank You and all involved! Regards, Julius Tuskenis 2021-10

Re: PG 12 slow selects from pg_settings

2021-10-08 Thread Julius Tuskenis
x27;::text) Rows Removed by Filter: 313 Planning Time: 0.083 ms Execution Time: 7.204 ms ``` Would you please direct me to the change log or some bug report to read in detail what was causing the problem and how it was fixed? Regards, Julius Tuskenis 2021-10-08, pn, 14:01 Ranier Vilela rašė: >

PG 12 slow selects from pg_settings

2021-10-08 Thread Julius Tuskenis
ease in performance. I've testet different versions and it seems the problem appeared on PG12, earlier versions up to PG11 work ok. PG13 also suffers from low reading speed of pg_settings. The behaviour is reproduced on 3 different machines (2 virtual and one physical, different hardwar