Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
John Naylor <johncnaylorls@gmail.com>
From: John Naylor <johncnaylorls@gmail.com>
To: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Cc: Chengpeng Yan <chengpeng_yan@outlook.com>,
Tatsuya Kawata <kawatatatsuya0913@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-05-04T02:10:16Z
Lists: 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