Re: Postgres Query Plan using wrong index

2025-04-05 Thread Manikandan Swaminathan
_a > 4996) Rows Removed by Filter: 9992000 Planning Time: 0.285 ms Execution Time: 536.681 ms > > On Apr 2, 2025, at 5:30 PM, Tom Lane wrote: > > Manikandan Swaminathan writes: >> 1) Why is the query currently picking the poorly performing index? > >

Re: Postgres Query Plan using wrong index

2025-04-05 Thread Manikandan Swaminathan
.005 rows=0 loops=1) Index Cond: (col_a > 5000) Heap Fetches: 0 Planning Time: 2.279 ms Execution Time: 0.028 ms (6 rows) > > On Apr 1, 2025, at 5:30 PM, Tom Lane wrote: > Manikandan Swaminathan writes: >> 4. When running the following query, I would exp

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