On 10/26/07, The Fearow <fearow00(a)hotmail.com> wrote:
Can we limit the amount of CPU/processing a query
could take? If not, that
would be a very useful MySQL function. We could then run those queries but
expect them to take a lot longer.
It doesn't work that way, AFAIK. Using InnoDB, you would have to
maintain a transaction for as long as the query runs. Many queries
run simultaneously at low priority for a long time would therefore
probably take a lot longer than if they were run quickly a few at a
time, due to transactional overhead. InnoDB has to keep separate
consistent copies for each query, more or less, which I suppose must
involve copy-on-write -- needless to say, that slows down every write
considerably if you have many transactions open. (In MyISAM, of
course, it would be even worse: you would take out a read lock and
prevent changes altogether.)