Long queries priority

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a 120M record table that needs to have indexes added as a
background process.  While running the CREATE INDEX command, which is
taking several days, all other SELECT queries on the same machine (on a
different database) are slowed dramatically.

Is there a way to reduce the CREATE INDEX priority so that other SELECT
queries can still function at normal speed?

The OS is linux, and I have tried to 'nice' the caller script, which
works for shorter queries, but presumably the longer queries are
running entirely in the MySQL process that isn't 'nice'.

Thanks in advance for your help,

Re: Long queries priority

peteraguard-google@yahoo.com wrote:

Quoted text here. Click to load it

Don't know if such method exists. But SELECT has "HIGH_PRIORITY", which
can be used to give selects a higher priority. But I have no idea does
that work with CREATE INDEX.

MySQL Manual SELECT syntax:

Re: Long queries priority

Aggro wrote:
Quoted text here. Click to load it

This doesn't seem to affect the speed of the SELECTs, as they are still
slow, but it's a good try.  I think this relates to overriding an

We've thought of one possible solution, which is to start another mysql
server on the same machine, and 'nice' that 2nd server, with it running

Details here:

but if there is a cleaner way of doing it, I'm all ears.


Site Timeline