Re: Single column vs composite partial index

2020-09-18 Thread Michael Lewis
Index Cond: ((load_dttm)::date >= (CURRENT_DATE - 7))" There is no need to cast the load_dttm field to a date in the query. The plain index on the field would be usable if you skipped that. In your example, you show creating the single column index but it isn't getting used because of the type cas

Re: Single column vs composite partial index

2020-09-16 Thread Nagaraj Raj
> You're asking whether to keep one index or the other? My ask is which index can be used for the mentioned query in production for better IO > It depends on *all* the queries you'll run, not just this one. I'm more concerned about this specific query, this has been using in one block stored pro

Re: Single column vs composite partial index

2020-09-15 Thread Justin Pryzby
On Tue, Sep 15, 2020 at 10:33:24PM +, Nagaraj Raj wrote: > Hi, > I'm running one query, and I created two types of index one is composite and > the other one with single column one and query planner showing almost the > same cost for both index bitmap scan, I'm not sure which is appropriate t

Single column vs composite partial index

2020-09-15 Thread Nagaraj Raj
Hi, I'm running one query, and I created two types of index one is composite and the other one with single column one and query planner showing almost the same cost for both index bitmap scan, I'm not sure which is appropriate to keep in production tables. explain analyze SELECT BAN, SUBSCRIBER