Re: A way to optimize sql about the last temporary-related row

2024-06-28 Thread aghart...@gmail.com
2024, 3:20 am aghart...@gmail.com, wrote: Now the query: explain (verbose, buffers, analyze) with last_table_ids as materialized(    select xx from (    select LAST_VALUE(pk_id) over (partition by integer_field_2 order by datetime_field_1 RANGE BETWEEN UNBOUNDED PRE

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
temctl start postgresql-16). Many thanks for your support. Agharta Il 27/06/24 5:33 PM, David G. Johnston ha scritto: On Thursday, June 27, 2024, aghart...@gmail.com wrote: Now the query: explain (verbose, buffers, analyze) with last_table_ids as materialized(   sele

Re: A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
t postgresql-16 I need to get a performance result even if data is not in cache. My best regards, Agharta Il 27/06/24 5:27 PM, Ron Johnson ha scritto: On Thu, Jun 27, 2024 at 11:20 AM aghart...@gmail.com wrote: [snip] -- insert 4M records insert into test_table(pk_id) select

A way to optimize sql about the last temporary-related row

2024-06-27 Thread aghart...@gmail.com
Hello everyone, Sorry to bother you but I have a query that is driving me crazy. I need to have the last valid record at a temporal level according to a specific parameter. First some data: Linux Rocky 8.10 environment, minimal installation (on VM KVM with Fedora 40). Postgresql 16.3, instal