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

Configurable MAX_PAGES_PER_ROUND #48

Open
damirda opened this issue Nov 20, 2022 · 1 comment
Open

Configurable MAX_PAGES_PER_ROUND #48

damirda opened this issue Nov 20, 2022 · 1 comment

Comments

@damirda
Copy link

damirda commented Nov 20, 2022

I changed MAX_PAGES_PER_ROUND in the code to 50, to speed things up, and didn't notice any downsides.
Is there any reason to hardcode it to 5 in the first place and not make is configurable through, let's say command line parameter?

@alexius2
Copy link
Member

Hello, I agree that at least it should be configurable. I've made a test few months ago on really big table with mostly empty pages on the tail and got following results (each tested for 5 minutes):

MAX_PAGES_PER_ROUND		speedup
5				1 (baseline)
20				1.49
50				1.77
200				1.88
500				1.39

So optimum for that case was around 200. Not sure about changing default value though, it depends on rows density on pages, concurrent updates on the table and overall server performance. For some bad cases MAX_PAGES_PER_ROUND=5 might be reasonable.
It would be great if pgcompacttable changed that value dynamically depending on query execution time with something like moving average formula, maximizing number of processed pages/s and limiting maximum query execution time (to avoid locks).

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

2 participants