Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types - Mailing list pgsql-hackers

From John Naylor
Subject Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
Date
Msg-id CANWCAZYBjANakZjyc_Gk0Myc13rC3XKgSV3zk+m1Jds1mEs0cw@mail.gmail.com
Whole thread
In response to Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
List pgsql-hackers
On Thu, Feb 26, 2026 at 6:46 PM Ilia Evdokimov
<ilya.evdokimov@tantorlabs.com> wrote:
> While reviewing the patch more closely, I noticed
> that compute_distinct_stats() is only used for types where we have =, !=
> but not <. In practice, most common scalar types go through
> compute_scalar_stats() instead.
>
> That makes me wonder how often this optimization would actually trigger
> in real workloads. Since compute_scalar_stats() is the more common path,
> there's chance that the hash-table based improvement in
> compute_distinct_stats() may not provide a noticeable overall benefit.

Coming back to this point, in any installation, the common path is
going to vastly outnumber the rare path, so this patch is optimizing
the wrong thing.

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Report index currently being vacuumed in pg_stat_progress_vacuum
Next
From: Chao Li
Date:
Subject: Adjust pg_stat_get_lock() prorows to match lock types