Index-only scan not working when IN clause has 2 or more values

2022-11-24 Thread Anna B .
  Hi all,   CREATE TABLE transaction (     client_id     decimal(18, 0) NOT NULL,     trans_dttm    timestamp,     division_code varchar(255),     ... )   One row size = approx 2Kb.   Usually table is searched by client_id and trans_dttm, but sometimes also by division_code, so:   create index "i

Re[2]: Index-only scan not working when IN clause has 2 or more values

2022-11-28 Thread Anna B .
Hi Tom and community,   Thank you very much!  After digging how Postgres planner uses statistics, I have increased table statistics from 100 to 1000. It was enough for planner to use multiple scans of the index and then sort! (Also I have added dependency extended stats on the three columns as y