Re: Indexes on expressions with multiple columns and operators

2025-09-25 Thread Frédéric Yhuel
On 9/23/25 12:20, Frédéric Yhuel wrote: On 9/22/25 23:15, Andrei Lepikhov wrote: I'm not sure I fully understand your case, but SQL Server demonstrates an interesting approach: they have a WHERE clause attached to statistics. So, having implemented this, you may separate the whole range of

Re: Partition pruning is not happening (even in PG18)

2025-09-25 Thread David Rowley
On Fri, 26 Sept 2025 at 07:49, Lauro Ojeda wrote: > The only way I found to make pruning work is to force index_scan using > pg_hint_plan, but I wanted to influence the planner to decide it by itself > rather than relying on hints. What's the reason for this misbehaving and what > could I do to

Re: Partition pruning is not happening (even in PG18)

2025-09-25 Thread Michał Kłeczek
Never mind my message. I misread it and missed the plan with no hints. Michał > On 25 Sep 2025, at 22:10, Michał Kłeczek wrote: > >  > Hi, > > Partition pruning is happening: pruned nodes are marked as “never executed”. > It is just that pruning is performed not by the planner but by the ex

Re: Partition pruning is not happening (even in PG18)

2025-09-25 Thread Michał Kłeczek
Hi, Partition pruning is happening: pruned nodes are marked as “never executed”. It is just that pruning is performed not by the planner but by the executor in this case. — Michał > On 25 Sep 2025, at 21:49, Lauro Ojeda wrote: > >  > Hi super-experts, > I am trying to solve a mystery for a

Partition pruning is not happening (even in PG18)

2025-09-25 Thread Lauro Ojeda
Hi super-experts, I am trying to solve a mystery for a customer where they had some very large heap tables (500GB+ each) on their PG 13 database which was bringing them loads of performance problems. Apart from the regular server tuning efforts, I suggested them to upgrade it to at least Postgresql

Re: Indexes on expressions with multiple columns and operators

2025-09-25 Thread Frédéric Yhuel
On 9/23/25 15:31, Frédéric Yhuel wrote: To get back to the topic of partitioned statistics, do you know if SQL Server is smart enough to handle this case [1] that we discussed last year? (with filtered statistics) [1] https://www.postgresql.org/message-id/flat/b860c71a-7cab-4d88- ad87-8c1f