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

powa_statements table keeps growing #133

Closed
banlex73 opened this issue Jun 8, 2020 · 8 comments
Closed

powa_statements table keeps growing #133

banlex73 opened this issue Jun 8, 2020 · 8 comments
Assignees

Comments

@banlex73
Copy link

banlex73 commented Jun 8, 2020

I noticed that powa_statements table keeps growing constantly and it causes performance issue.
Expected that powa_statements_purge will clean it up but it deletes obsolete records from powa_statements_history and powa_statements_history_db only

@rjuju rjuju self-assigned this Jun 8, 2020
@rjuju
Copy link
Member

rjuju commented Jun 8, 2020

Hello.

Yes, that's expected behavior for now. This is based on the assumption that a single database will have a finite set of normalized queries. I'm assuming that your workload is causing this assumption to break. Do you know if for instance you're using a lot of temporary tables, or if you're dropping and creating table frequently?

@banlex73
Copy link
Author

banlex73 commented Jun 8, 2020 via email

@rjuju
Copy link
Member

rjuju commented Jun 8, 2020

You mean some kind of LRU for the statements? That's probably the easiest way to enable a cheap purge for those rows and make sure those are also automatically cleaned up.

Note that the only FK that exist for powa_statements are for powa_qualstats_quals, so you can probably run a massive purge by checking the rows not reference in that tables, run a vacuum or vacuum full, and if any statements is still active on the remote servers they'll be added back at the next snapshot.

BTW, do you have pg_qualstats enabled? It seems that you can run into the issue with powa_qualstats_quals table.

@banlex73
Copy link
Author

banlex73 commented Jun 8, 2020 via email

@rjuju
Copy link
Member

rjuju commented Jun 8, 2020

Thank you so much!

@banlex73
Copy link
Author

banlex73 commented Jun 20, 2020 via email

@rjuju
Copy link
Member

rjuju commented Jul 4, 2020

Thanks a lot for the PR! I merged it, and added the required boilerplate code required for a new extension version (see powa-team/powa-archivist@8a50508).

@rjuju rjuju closed this as completed Jul 4, 2020
@banlex73
Copy link
Author

banlex73 commented Jul 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants