I am attaching patch v4.
I add one more sentence to documentation to emphasize that degree of proximity depends on parameter . And also I made restriction on parameter, now it can be only in range (0; 1)
I have renamed it to “s”.
Renamed zipfZeta to zipfGeneralizedHarmonic, zetan to harmonicn.
Replaced with Least Recently Used replacement algorithm.
Now it prints warning message if array overflowed. To print message only one time, it uses global flag, which is available for all threads.
And theoretically message can be printed more than one time.
It could be solved easily using pg_atomic_test_set_flag() from src/include/port/atomics.h but it can not be used in pgbench because of following lines of code there:
#error "atomics.h may not be included from frontend code"
Or it can be fixed by using mutexes from pthread, but I think code become less readable and more complex in this case.
So, should I spend time on solving this issue?
Fixed. Does ZIPF_CACHE_SIZE = 15 is ok?
I will send tests later, as separate patch.
Description: Binary data
Thanks and Regards,
The Russian Postgres Company