• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Time Taken by any sql query

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic