Re: About PostgreSQL Query Plan

2025-01-14 Thread Eşref Halıcıoğlu
Hello, Okay, thank you very much, Mr. David, for your support and the information, Eşref To: Eşref Halıcıoğlu (esref.halicio...@primeit.com.tr);Cc: pgsql-general@lists.postgresql.org;Subject: About PostgreSQL Query Plan;14.01.2025, 13:09, "David Rowley" :On Tue, 14 Jan

Re: About PostgreSQL Query Plan

2025-01-14 Thread David Rowley
On Tue, 14 Jan 2025 at 03:45, Eşref Halıcıoğlu wrote: > I do not fully understand the logic of this issue. I would be very grateful > if you can share information on the subject. > > The query plan is as follows. > > Update on "test_table1" tt1 (cost=0.13..159112.84 rows=0 width=0) > Update on

Re: About PostgreSQL Query Plan

2025-01-13 Thread Eşref Halıcıoğlu
would be very grateful if you could help me. Thank you, Eşref Halıcıoğlu To: Eşref Halıcıoğlu (esref.halicio...@primeit.com.tr);Cc: pgsql-general@lists.postgresql.org;Subject: About PostgreSQL Query Plan;13.01.2025, 19:56, "hubert depesz lubaczewski" :On Mon, Jan 13, 2025 at

Re: About PostgreSQL Query Plan

2025-01-13 Thread Eşref Halıcıoğlu
;))  ->  Index Scan using partitiontable_2024_12_pkey on "PartitionTable_2024_12" t4  (cost=0.43..4.34 rows=1 width=38) (never executed)    Index Cond: (("Col1" = tmp."Col2") AND ("Col3" >= (CURRENT_DATE - '3 mons'::interval))

Re: About PostgreSQL Query Plan

2025-01-13 Thread hubert depesz lubaczewski
On Mon, Jan 13, 2025 at 08:01:56PM +0300, Eşref Halıcıoğlu wrote: > Yes, you are right; it seems that only 4 batches had data changes. However, > the query also accessed other batches and then removed > them again. What could be the reason for this and how can it be solved? >   > Obviously, I woul

Re: About PostgreSQL Query Plan

2025-01-13 Thread hubert depesz lubaczewski
On Mon, Jan 13, 2025 at 07:48:09PM +0300, Eşref Halıcıoğlu wrote: > Hello, >   > Yes, you are right; this query is not a SELECT, it is an UPDATE query, there > was a mistake in expressing it here. The columns I want > to update here only operate on data from the last 3 months time interval. >   >

Re: About PostgreSQL Query Plan

2025-01-13 Thread hubert depesz lubaczewski
On Mon, Jan 13, 2025 at 05:26:09PM +0300, Eşref Halıcıoğlu wrote: > Hello, >   > I have a query in PostgreSQL and I want this query to retrieve only data from > the last 3 months. However, when I examine the query > plan, I see that all partitions are listed. Please note that your explain is for

About PostgreSQL Query Plan

2025-01-13 Thread Eşref Halıcıoğlu
Hello, I have a query in PostgreSQL and I want this query to retrieve only data from the last 3 months. However, when I examine the query plan, I see that all partitions are listed. This raises a few questions in my mind:Are all partitions really being accessed, or only the partitions of the last 3