Re: Optimization outcome depends on the index order

From: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimization outcome depends on the index order
Date: 2023-12-22 17:24:37
Message-ID: 9b3dbf6d-776a-4953-a5a4-60992939321d@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22/12/2023 11:48, Alexander Korotkov wrote:
> > Because we must trust all predictions made by the planner, we just
> > choose the most trustworthy path. According to the planner logic, it is
> > a path with a smaller selectivity. We can make mistakes anyway just
> > because of the nature of estimation.
>
> Even if we need to take selectivity into account here, it's still not
> clear why this should be on top of other logic later in add_path().
I got your point now, thanks for pointing it out. In the next version of
the patch selectivity is used as a criteria only in the case of COSTS_EQUAL.

--
regards,
Andrei Lepikhov
Postgres Professional

Attachment Content-Type Size
v4-0001-Choose-an-index-path-with-the-best-selectivity-estim.patch text/plain 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-12-22 17:31:52 Re: Avoid computing ORDER BY junk columns unnecessarily
Previous Message Pavel Stehule 2023-12-22 17:03:15 Re: [DOC] Introducing Quick Start Guide to PL/pgSQL and PL/Python Documentation