473,506 Members | 16,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

query progress bar

is it possible to mke a progress bar for queries? say i have a query
that will take 20 seconds, i'd like to give some feed back to users on
how long this will take.
Jul 19 '05 #1
8 3135
What type of UI is this for? The Python Cookbook, 2nd Ed. has a nice
textual solution. I'm not sure if this is the same one, but here is <a
href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639">one
from ASPN</a>. Here is one <a
href="http://wxpython.org/docs/api/wx.ProgressDialog-class.html"> for
wxPython.</a>

Jul 19 '05 #2
ry**@ryankaskel.com wrote:
What type of UI is this for? The Python Cookbook, 2nd Ed. has a nice
textual solution. I'm not sure if this is the same one, but here is <a
href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639">one
from ASPN</a>. Here is one <a
href="http://wxpython.org/docs/api/wx.ProgressDialog-class.html"> for
wxPython.</a>

it's for wx, the problem isn't making the progress bar itself, it's
knowing how long the query is going to run for.
i'm using pypgsql
Jul 19 '05 #3
> it's for wx, the problem isn't making the progress bar itself, it's
knowing how long the query is going to run for.
i'm using pypgsql


It is quite easy:

from timemachine import oracle

guesser=oracle(guess="SQL")
guesser.set_hint(driver="pypgsql")
guesser.set_hint(gui="wx")

expected_runtime=guesser.estimate("<put your query text here>")

Only problem is that the timemachine module is currently only installed
on Guidos and Tims Python.

Harald
Jul 19 '05 #4
Harald Massa wrote:
it's for wx, the problem isn't making the progress bar itself, it's
knowing how long the query is going to run for.
i'm using pypgsql


It is quite easy:

from timemachine import oracle

guesser=oracle(guess="SQL")
guesser.set_hint(driver="pypgsql")
guesser.set_hint(gui="wx")

expected_runtime=guesser.estimate("<put your query text here>")

Only problem is that the timemachine module is currently only installed
on Guidos and Tims Python.

Harald

man thats exactly what i'm looking for. it won't install on standard 2.3 ?
Jul 19 '05 #5
f
Timothy Smith wrote:
is it possible to mke a progress bar for queries? say i have a query
that will take 20 seconds, i'd like to give some feed back to users on
how long this will take.


it is strictly impossible to predict that cause of network load, server
load, query complexity ....

i recommend you put an activity widget, something moving (ie throbber in
wxPython) while waiting for the result (like the rotating circle in
firefox).

once query is finished stop your moving stuff, so the user knows it's
completed.

So you don't need a progress bar, but an activity widget. in gtk, i saw
that progress bar could be put in activity mode.

And don't forget to add a timeout ...

François
Jul 19 '05 #6
Timothy Smith wrote:
i'm using pypgsql


Assuming you work with PostgreSQL, then:
You know the EXPLAIN command?

EXPLAIN will give you a very accurate estimation for the expense for the
query.
(You'll have to find out what cost means in terms of your progress.)

I did never try this using pypgsql, but if it works, this might be your
solution...

The precision of EXPLAIN, however, depends on the modifications since the
last time you ran VACUUM on the DB.
If the size of tables or indices didn't suffer considerable changes since
then, the estimation should be quite accurate.

Bernhard

Jul 19 '05 #7
Bernhard Holzmayer wrote:
Timothy Smith wrote:
i'm using pypgsql


Assuming you work with PostgreSQL, then:
You know the EXPLAIN command?

EXPLAIN will give you a very accurate estimation for the expense for the
query.
(You'll have to find out what cost means in terms of your progress.)

I did never try this using pypgsql, but if it works, this might be your
solution...

The precision of EXPLAIN, however, depends on the modifications since the
last time you ran VACUUM on the DB.
If the size of tables or indices didn't suffer considerable changes since
then, the estimation should be quite accurate.

Bernhard


i've never heard of pypgsql supporting andthing like that, but i'll have
a look

Jul 19 '05 #8
f wrote:
Timothy Smith wrote:
is it possible to mke a progress bar for queries? say i have a query
that will take 20 seconds, i'd like to give some feed back to users on
how long this will take.
....an activity widget, something moving (ie throbber in wxPython)
while waiting for the result (like the rotating circle in firefox)....

The one extra thing you might want to do, if your application gets
regular use, is show elapsed time. The user will come to know how
long it should take, while your application probably won't get any
smarter.

--Scott David Daniels
Sc***********@Acm.Org
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1475
by: MSW | last post by:
I am trying to give the user some indication of some progress of a query since it takes about 5 hours to run. Is there any way to extract the progress of a query WHILE it is running (or perform...
0
1809
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
2
1968
by: greg | last post by:
Hi Basically I call a page that does a very long op (like very long database query) and display results (possible on another page) But I need to display a progress bar for user to see some...
2
4172
by: David Garamond | last post by:
56% ETA ... I know there is no such thing in Postgres right now (though there is pg_stat_activity). But is there database product that can do this? -- dave
0
1290
by: Lee Blevins | last post by:
I'm trying to query a postgresql database with PHP. I am having a problem when using a WHERE. It works without the WHERE. Example: $query = "SELECT job_number, customer, desription, archive,...
6
3269
by: mattdaddym | last post by:
Hi all, I'm looking for a way to show my users the progress of their sql queries. I've implemented Microsoft Ajax in order to show a progress bar, but I would love to be able to show: number...
12
34994
by: yoavyoavyoav | last post by:
Hi , I would like a progress bar to be displayed while running an sql query. the progress bar doesn't have to move according to the query pace - I just want it to move back and forth while the...
1
2735
by: bbatson | last post by:
Hello, I have searched for help on this and have not been successful in finding an answer to my particular problem. I am trying to compute a running sum of sales in a query. Here is the...
0
967
by: blackrobin | last post by:
I'm stress out here, I know its simple but I cant seem to get to work. I hope any body would help me. I have two query: QProgress_FM Fullname School_ID Visit Date Cluster Number School...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.