Re: [Sqlrelay-discussion] query timeout
Brought to you by:
mused
From: Firstworks/4access <dav...@fi...> - 2005-07-15 14:58:49
|
On Fri, 2005-07-15 at 09:52 -0400, simon martin wrote: > Hi all, > > One of my customers uses postgresql and I am using sqlrelay for > connection pooling. This is working very well and has been for quite > some time now. Unfortunately they are having some problems with the > database and queries that used to take a copule of seconds, now take a > couple of minutes. They are looking into the problem, but they want me > to add a 2 second timeout to some of the time critical queries that > are run (some external clients will only wait 10 seconds for a > response to a set of queries). > > The only way I can see of implementing this is using the > STATEMENT_TIMEOUT command. Is there any way to specify a query timeout > in sqlrelay? > > TIA > There's no good way (yet). Some database API's (including postgresql's) provide functions for running asynchronous queries. You can start a query, let it run in the background, check on it's progress, and possibly cancel it. Using an interface like that is the simplest way to implement a timeout. However, since many databases API's don't provide functions for running asynchronous queries, I never got around to implementing methods for asynchronous queries in SQL Relay's API. In fact, I'm not sure that there even is a safe way to do them if the database's native API doesn't support them. At any rate, "api for running queries in the background" is on the TODO list, I'll update it with a note about being able to run a query with a timeout, but I'm not certain when I'll get it implemented. If it's a feature you really need soon, please consider taking out a custom development contract (see http://sqlrelay.sourceforge.net/support.html). I place much higher priority on bugs and features requested by support and custom development contract holders than on regular TODO list items. David Muse dav...@fi... |