Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bias max_offset in pareto distribution #534

Open
morgo opened this issue Aug 7, 2024 · 0 comments
Open

Bias max_offset in pareto distribution #534

morgo opened this issue Aug 7, 2024 · 0 comments

Comments

@morgo
Copy link

morgo commented Aug 7, 2024

We use sysbench to test Spirit (an online schema change tool).

Spirit has an optimization where it can ignore keys that have been modified above a certain known point. Unfortunately this is a little bit difficult to test in sysbench because while many of our workloads look to be roughly pareto, it is the higher keys that are modified, and not the first keys in the table.

What I would like to propose is an option to the pareto distribution function. i.e. currently defined as:

uint32_t sb_rand_pareto(uint32_t a, uint32_t b) # starting-value, max-offset
{
  return a + (uint32_t) ((b - a + 1) *
                         pow(sb_rand_uniform_double(), pareto_power));
}

For our use-case we would instead like to have something like:

uint32_t sb_rand_pareto(uint32_t a, uint32_t b) # starting-value, max-offset
{
  return b - (uint32_t) ((b - a + 1) *
                         pow(sb_rand_uniform_double(), pareto_power));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant