Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Time Taken by any sql query

 
Ali Hassaan
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I need little assistance from you guys.I need to know is their anyway of calculating time taken by any sql query.
What i want is that when user search for anything from my database i want to show a progress bar showing how much time left.
Its little urgent..
Thanx for reading...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand what you are trying to do correctly, it sounds like you are attempting to do it the wrong way around.
You are trying to know how long a query takes before you have run it. Instead, set it up so that it shows a 'please wait' screen then starts the query. Wait till the query finishes then build the results page and replace the 'please wait' page.
The problem with a progress bar if that there is no way to tell when the query is 10%, 50% or 75% complete so it has to be purely time-based, which doesn't work because the query time can depend on things you have no control over.
(this is how I've seen it done in a web app, my preference is to fix the query so that it doesn't take so long)
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic