Open btrask opened 9 years ago
There are basically two ways to do this:
I'm not sure which one is better. By counting steps, the result would be deterministic and unaffected by other processes or random slowdowns. On the other hand the timer might be more accurate/adaptive, for example if the whole system is running slow then we should probably terminate earlier.
Currently we don't impose any timeout on slow queries. This can easily lead to saturating the thread pool and causing a denial of service.
This is a little bit more difficult because for trusted applications we don't want to impose timeouts. Either we need to add a special user permission for long-running queries, or else we need to figure out a compromise. Possibly preempting slow queries or something.
Obviously it'd be nice to simply speed up slow queries too. #22