php - postgresql max execution time
Is there开发者_高级运维 an option to use with PostgreSQL Functions in PHP, so you can specify a maxim execution time for a query ? I don't want to enable this from the config file because only certain queries need to be restricted.
run from php a query before the main query
like
SET statement_timeout TO 5000;
You can use set_time_limit()
According to PHP doc:
When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out
.
精彩评论