views:

56

answers:

2

Hello, well the title says it all. Does anyone have an idea? Would need to lock the table for that long on production site, so it is kinda important.

Also, do you have any suggestion how such query could be optimized?

Thanks!

+2  A: 

This greatly depends on your hardware, db and indices.
The best option is to do a rehearsal - run the query in production, or on a test environment the closely simulates it.

Kobi
Thanks for the answers. I was hoping someone who has been in a similar situation reads this and can share his/her experience. I mean after I'm done testing it, I will be able to give my two cents on similar questions. So I don't really understand why my question got downrated ;)
JobGovernor
That's easy - it got down voted because it cannot be answered. Even when you run it on production multiple times you may get different results.
Kobi
I can understand that. But 'rough estimate' I thought would be clear enough indication that I am not asking for presicion in miliseconds. Anyway, thanks for clarifying that, I will try to be more precise next time.
JobGovernor
+2  A: 

I would say that it depends on the hardware and load of the computer on which it runs. Furthermore, the existence (or non-existence) of indexes would also influence the result. I think you will have to meassure it yourself. Maybe on some staging environment.

klausbyskov