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

Limit transaction cost #4

Open
steve-chavez opened this issue Sep 9, 2017 · 0 comments
Open

Limit transaction cost #4

steve-chavez opened this issue Sep 9, 2017 · 0 comments

Comments

@steve-chavez
Copy link
Contributor

I would like to have a plan_filter.transaction_cost_limit setting, with a behavior similar to plan_filter.statement_cost_limit but this would limit the sum of the statements costs in a transaction, this is useful as a security measure for webapps that expose endpoints that enable batch operations in a single transaction.

My idea is to limit misbehaving clients that could specify a large number of queries through the batch interface and reject their requests mapping the plan cost limit exceeded error to a HTTP 429 Too Many Requests status code; there are mechanisms at the application level to defend against this kind of misbehavior but I think it would be simpler/cleaner to enforce it at the database level.

Any thoughts about this? If it seems like a reasonable feature, I could work on a PR.

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