Thread
-
Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> — 2026-05-03T14:16:24Z
On 4/14/26 04:34, Chengpeng Yan wrote: > I split v5 accordingly. The first patch changes the singleton handling > from shifting to a cursor-based eviction scheme, and the second patch > adds the hash lookup. I reviewed v5 of the patches. Instead of going through each issue one by one, I made a pass to clean up and clarify the code and summarize the main changes belows: - Fixed a few typos in comments and added comments in places where the logic was not immediately clear; - Rewrote the bubble-up loop using `for` loop, which I find more readable. Also removed some confusing uses of the `j` variable that mase the flow harder to follow; - Simplified parts of the code to improve overall readability. -- Best regards, Ilia Evdokimov, Tantor Labs LLC, https://tantorlabs.com/
-
Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
John Naylor <johncnaylorls@gmail.com> — 2026-05-04T02:10:16Z
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
-
Re: [PATCH] ANALYZE: hash-accelerate MCV tracking for equality-only types
Chengpeng Yan <chengpeng_yan@outlook.com> — 2026-05-06T04:51:45Z
Hi, > On May 3, 2026, at 22:16, Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> wrote: > > I reviewed v5 of the patches. Instead of going through each issue one by one, I made a pass to clean up and clarify the code and summarize the main changes belows: > - Fixed a few typos in comments and added comments in places where the logic was not immediately clear; > - Rewrote the bubble-up loop using `for` loop, which I find more readable. Also removed some confusing uses of the `j` variable that mase the flow harder to follow; > - Simplified parts of the code to improve overall readability. Thanks for the review and for working on this. After giving it more thought, I agree with John’s point that the set of types benefiting from this optimization is currently too limited. While this optimization can still provide noticeable improvements in some specific cases, those cases do not seem common enough at this stage, so the overall benefit also seems fairly small. Because of that, I marked this patch as Withdrawn in the current CommitFest and plan to pause further work on it for now. That said, if postgres or some extensions introduce more commonly used types that are a good fit for this optimization, I think it would make sense to revisit and potentially revive this work. Thanks again for the effort and contribution. -- Best regards, Chengpeng Yan