Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible in MySQL to know beforehand query execution time? I mean how long it will take to execute the query.

Generally its worthwhile to know how long any query can take to execute.

At the moment, problem at hand is Converting CHAR to BIT (1.2GB Table size, MyISAM, indexes not on the columns I want to change, 3GB RAM)

share|improve this question
So many things play a factor in this there isn't really a blanket answer. Can you tell us the exact execution route you're going? How much RAM does your DB server have dedicated to mysql? How much for disk cache? What is does your .cnf look like? In general I get a feel for how long things will take on a particular machine. – atxdba Sep 25 '11 at 14:30
I'll add all info about machine but I thought there might be an SQL way to know query execution time. – Gary Lindahl Sep 25 '11 at 14:59
up vote 3 down vote accepted

If you go the route I suggested in your previous post I'm going to say < 10 minutes. But again, soooo much that isn't given will affect the wall time. Is this a dedicated MySQL server or is other stuff going on? Specifically things that will be affecting the disk i/o? How fast are the disks? Are they SSD? Is it write through or write back cache?

In short there is no "explain" for operations like this that will give you a time value.

Don't forget to disable/enable keys during the modifications.

Report back and let us know the results.

share|improve this answer
What keys are you mentioning to enable/disable? – Gary Lindahl Sep 25 '11 at 15:35
alter table tablename disable keys; stuff... alter table tablename enable keys; It's better to let it completely rebuild instead of trying to keep track for ops like this – atxdba Sep 25 '11 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.