Make a new cursor class to limit query time
MySQL database connector for Python programming
Brought to you by:
adustman
Often when using mysqldb on really large databases
there is a potential to issue huge queries which would
just take way too long. This is obviously not ideal,
but the risk is that having a very slow query on the
server may cause unacceptable performance problems.
It would be nice to add the safety check in the cursor
class to ensure that the query doesnt take too long -
if it does it should be killed.
For example see:
http://pyflag.sourceforge.net/pyflag/_darcs/current/src/pyflag/DB.py
Where a threading.Timer is used to time the query
killing it if it takes too long.
This is essential for shared sites where any query
longer than a few seconds can really affect performace.
Michael.
Logged In: YES
user_id=71372
Propose a mechanism to implement this. There is no API for
doing asynchronous queries, and signals tend to not work
well with threads.