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
=?UTF-8?B?QW5uYSBCLg==?= writes:
> create index "ix-transaction-client-trans_dttm-division"
> on transaction (client_id,
> trans_dttm desc,
> division_code);
>
> EXPLAIN (ANALYZE, BUFFERS)
> select *
> from transaction
> where client_id = 123456
> an
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