We have a pretty typical django application running on postgresql 9.0. We recently discovered some db queries that took more than 4 hours to complete due to inefficient searches in the admin interface. Although we plan to fix these queries, as a defense, we would like to artificially limit the database query time to 15 seconds - but only in the context of a web request; batch tasks and celery tasks should not be limited to this restriction.
How can we do this? Or is this a terrible idea?
performance django postgresql
claymation
source share