| From: | Alexandre Felipe <o(dot)alexandre(dot)felipe(at)gmail(dot)com> |
|---|---|
| To: | Dhruv Aron <dhruv(dot)aron(at)gmail(dot)com> |
| Cc: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Restructured Shared Buffer Hash Table |
| Date: | 2026-10-12 18:40:47 |
| Message-ID: | CAE8JnxN2tkbkBY9ZVQqkHsyq_uj9Kb9LU1UWybQEe4eejYJC-A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Dhruv,
A few details I would like your attention,
1. mod vs bitwise and
Instead of computing [hashcode % num_buckets] you could save
bucket_mask = num_bucket - 1, and do hashcode & bucket_mask.
2. the 1.5 factor
On my first review I pointed out that in one specific test for
shared_buffers
as a power of two the number of buckets in your patch ended up being half
as many as the previous version (maybe that is the correct way to go).
Or maybe you want at least to rewrite that line using integer arithmetic.
4. scalability
In your 16 GB test the gains are minimal. What changes at that scale?
That suggests that maybe the gain at 4 GB was due to a high cache hit
(not a bad thing, but important to have it clear).
Regards,
Alexandre
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ayush Tiwari | 2026-10-12 19:15:07 | Re: New test function replace_conf() to get rid of unlink/append pattern |
| Previous Message | Haibo Yan | 2026-10-12 18:28:16 | Re: [PATCH] Fix grouping-set nulling of variable-free grouping expressions |