Re: Enable data checksums by default
От | Ants Aasma |
---|---|
Тема | Re: Enable data checksums by default |
Дата | |
Msg-id | CANwKhkPUsYFi0JzFj1pQ8qzoVMk20cecSecfNwhzGj0G1WzTzw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Enable data checksums by default (Tomas Vondra <tomas@vondra.me>) |
Список | pgsql-hackers |
On Thu, 31 Jul 2025 at 18:21, Tomas Vondra <tomas@vondra.me> wrote: > I don't know the Intel vs. AMD situation exactly, but e.g. [1] does not > suggest AMD wins by a mile. In fact, it suggests Intel does much better > in this particular benchmark (with AVX-512 improvements). Of course, > this is a fairly recent *kernel* improvement, maybe it wouldn't work for > our data checksums that well. Page checksums are not CRC, but a custom FNV inspired algorithm that rearranges the calculation into 32 parallel ones to extract more instruction level parallelism. With recent improvements in execution capability this is still instruction latency bound - Zen 5 could execute it 3x faster if we widened it 4x. It is especially bound on Intel, as they decided soon after we implemented this algorithm to increase the latency of vpmulld to 10, compared to 3 on AMD. This requires compiling for a target that supports the wide instructions, so it could really use runtime CPU detection to switch between different SIMD width implementations. Even if we made the checksum algorithm itself faster, the main issue is actually memory bandwidth. Intel server CPUs have about half the bandwidth of AMD ones. A checksum has to pull in the whole page in a few hundred cycles. Without checksums only a part of the page might be accessed and the accesses are spread over a longer time, making them easier to hide by out-of-order execution. But all the above still ends up at being a few hundred nanoseconds per buffer read. Basically this ends up only mattering measurably for in-RAM but out of shared buffers workloads. And the easy workaround is to increase shared buffers. As you said, the main issue is the other overheads that checksums pull in. -- Ants Aasma
В списке pgsql-hackers по дате отправления: