Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types

Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>

From: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
To: Chengpeng Yan <chengpeng_yan@Outlook.com>
Cc: Tatsuya Kawata <kawatatatsuya0913@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, John Naylor <johncnaylorls@gmail.com>
Date: 2026-02-26T11:46:32Z
Lists: pgsql-hackers
Have you benchmarked this change except in first message in this thread?

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.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Speed up eqjoinsel() with lots of MCV entries.