Postgres Query Plan using wrong index

2025-04-01 Thread Manikandan Swaminathan
Hello, I'm running on the docker postgres:17.0 image and trying to test out the behavior of adding a new index to a table. Specifically, I wanted to verify that my new index is actually used by looking at the output of "EXPLAIN ANALYZE". However, I found that my index is often not being used and w

Re: Postgres Query Plan using wrong index

2025-04-01 Thread Tom Lane
Manikandan Swaminathan writes: > 4. When running the following query, I would expect the index "idx_col_b_a" > to be used: select min(col_b) from test_table where col_a > 4996. > I have a range-based filter on col_a, and am aggregating the result with > min(col_b). Both columns are covered by "id

Re: [EXTERNAL] Re: RDS IO Read time

2025-04-01 Thread Eden Aharoni
First, thanks for the reply :) So, I do know which part is taking a lot of IO time and it's to be honest any node that reads from the disk.. of course, we're running EXPLAIN on our queries (to be more specific we use auto_explain) but we can't seem to find what could cause an index scan that rea

Re: [EXTERNAL] RDS IO Read time

2025-04-01 Thread Eden Aharoni
Can you please tell me what other data might help? Would you like an EXPLAIN output? Get Outlook for Android From: Christophe Pettus Sent: Monday, March 31, 2025 9:23:45 PM To: Eden Aharoni Cc: pgsql-general@lists.postgresql.org Subject:

Re: [EXTERNAL] RDS IO Read time

2025-04-01 Thread Eden Aharoni
Aggregate (cost=8581.22..8581.23 rows=1 width=4) (actual time=1209.498..1210.530 rows=1 loops=1) Buffers: shared hit=3108 read=4314 dirtied=1 I/O Timings: shared read=1169.977 -> Gather (cost=8580.80..8581.21 rows=4 width=8) (actual time=1209.371..1210.526 rows=5 loops=1) Worke

Re: [EXTERNAL] RDS IO Read time

2025-04-01 Thread Eden Aharoni
So you believe it's strictly an EBS issue? Get Outlook for Android From: Christophe Pettus Sent: Monday, March 31, 2025 8:43:19 PM To: Eden Aharoni Cc: pgsql-general@lists.postgresql.org Subject: Re: [EXTERNAL] RDS IO Read time [You don'