Re: 回复: An implementation of multi-key sort - Mailing list pgsql-hackers

From Robert Haas
Subject Re: 回复: An implementation of multi-key sort
Date
Msg-id CA+TgmoY=uUQxKZwOkMJgS0ufMSiB9a78OaViLEwz336S5Rbh8Q@mail.gmail.com
Whole thread Raw
In response to Re: 回复: An implementation of multi-key sort  (Konstantin Knizhnik <knizhnik@garret.ru>)
Responses Re: 回复: An implementation of multi-key sort
List pgsql-hackers
On Sun, Jul 7, 2024 at 2:32 AM Konstantin Knizhnik <knizhnik@garret.ru> wrote:
> If mksort really provides advantage only when there are a lot of
> duplicates (for prefix keys?) and of small fraction of duplicates there
> is even some (small) regression
> then IMHO taking in account in planner information about estimated
> number of distinct values seems to be really important.

I don't think we can rely on the planner's n_distinct estimates for
this at all. That information tends to be massively unreliable when we
have it at all. If we rely on it for good performance, it will be easy
to find cases where it's wrong and performance is bad.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: XML test error on Arch Linux
Next
From: Nathan Bossart
Date:
Subject: Re: improve performance of pg_dump with many sequences