Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
1  
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
add comment

1 Answer 1

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
2  
alter table tablename disable keys; ...do 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
add comment

Your Answer

 
discard

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.