graphile / crystal

đź”® Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.63k stars 572 forks source link

Restrict the query execution time in PostgraphQL #716

Closed Tritpi closed 6 years ago

Tritpi commented 6 years ago

Is there an option/setting in postgraphql which allows us to set the max run time of a query.This is to ensure that someone doesn’t run a query which consumes a lot of resources for a long period of time on the database.

benjie commented 6 years ago

I think you can do this via pgSettings; set the statement_timeout

https://www.postgresql.org/docs/9.6/static/runtime-config-client.html https://www.graphile.org/postgraphile/usage-library/

hmaurer commented 6 years ago

Do note some related features are now available under a payed plan c.f. https://www.graphile.org/postgraphile/pricing/. @benjie

benjie commented 6 years ago

Not to do with query execution time explicitly though - but this request is solved via pgSettings.