Re: Use merge-based matching for MCVs in eqjoinsel

Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>

From: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
To: David Geier <geidav.pg@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-09-08T10:45:06Z
Lists: pgsql-hackers
On 08.09.2025 13:35, Ilia Evdokimov wrote:
> Based on these results, I’d prefer the hash lookup implementation, so 
> I think it makes sense to improve your patch further and bring it into 
> good shape. Shall I take care of that, or would you prefer to do it 
> yourself?



I realized I mistakenly copied the wrong results for the hash-map 
version in my previous draft. Sorry about that. Here are the correct 
benchmark results:

Merge

default_statistics_target | Planner Speedup (×) | Planner Before (ms) | 
Planner After (ms)
--------------------------------------------------------------------------------
100                       | 1.00                | 1892.627            | 
1898.622
1000                      | 1.12                | 2286.922            | 
2033.553
2500                      | 1.92                | 4647.167            | 
2423.552
5000                      | 5.94                | 17964.779           | 
3025.739
7500                      | 10.48               | 38622.443           | 
3684.262
10000                     | 16.72               | 69538.085           | 
4159.418


Hash-Map

default_statistics_target | Planner Speedup (×) | Planner Before (ms) | 
Planner After (ms)
--------------------------------------------------------------------------------
100                       | 1.00                | 1892.627            | 
1886.969
1000                      | 1.09                | 2286.922            | 
2100.099
2500                      | 1.94                | 4647.167            | 
2400.711
5000                      | 6.15                | 17964.779           | 
2919.914
7500                      | 10.58               | 38622.443           | 
3650.375
10000                     | 16.33               | 69538.085           | 
4257.864

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