Thread: Re: Long running queries and timeouts

Re: Long running queries and timeouts

From
"Josh Berkus"
Date:
Francisco,

> > If queries > 2 min are common, you'll need some kind of "progress
>  bar"
> >  mechanism that updates the page every 40 seconds to prevent the
> >  browser from timing out.
> > -Josh
>
> Do you have any experience on this? Sample code?
> Is that a term you think I may search for on the web "progress bar"?

Actually, my web developer and I talked about the programming necessary
 to do this, and decided that it was easier to break up the
 long-running function into 3 smaller functions.  So, no, we don't have
 any sample code.  In fact, we might be willing to buy some code that
 creates a progress bar from someone who does have it ...

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

Re: Long running queries and timeouts

From
Francisco Reyes
Date:
On Tue, 22 Jan 2002, Josh Berkus wrote:

> Actually, my web developer and I talked about the programming necessary
>  to do this, and decided that it was easier to break up the
>  long-running function into 3 smaller functions.  So, no, we don't have
>  any sample code.  In fact, we might be willing to buy some code that
>  creates a progress bar from someone who does have it ...

I can't imagine a "progress bar". In particular if you are waiting for a
reply from the DB server.


Re: Long running queries and timeouts

From
Jean-Michel POURE
Date:
Le Mardi 22 Janvier 2002 16:52, Josh Berkus a écrit :
> Actually, my web developer and I talked about the programming necessary
>  to do this, and decided that it was easier to break up the
>  long-running function into 3 smaller functions.

Are you connecting from Netscape? I noticed long queries timeouted in
Netscape. This is because Nescape waits for the entire content of a page
before displaying it.

On the converse, when connecting from $M Internet Explorer, just echo a
message like "Please wait during processing." and then "." everytime you run
a query. IE refreshes content and there is no timeout.

Also, it is possible to set timeout time in /etc/php.ini. Set a high value
like 600 seconds. Then you also need to allow more connections to PostgreSQL
backend as described in this very interesting article :
http://www.phpbuilder.com/columns/smith20010821.php3?page=2.

PostgreSQL can run very fast when well-optimized. You probably need to
optimize the source code of queries themselves, probably writing some good
PL/pgSQL server side code. If you need a GUI to do so, download and install
Dave Page's excellent tool http://pgadmin.postgresql.org

Cheers,
Jean-Michel POURE

Re: Long running queries and timeouts

From
postgresql@finner.de
Date:
On 23-Jan-02 Francisco Reyes sat down, thought for a long time and then
wrote:
> On Tue, 22 Jan 2002, Josh Berkus wrote:
>
>> Actually, my web developer and I talked about the programming
>> necessary
>>  to do this, and decided that it was easier to break up the
>>  long-running function into 3 smaller functions.  So, no, we don't
>>  have
>>  any sample code.  In fact, we might be willing to buy some code
>>  that
>>  creates a progress bar from someone who does have it ...
>
> I can't imagine a "progress bar". In particular if you are waiting
> for a
> reply from the DB server.

I found a nice one on http://www.lyrics.de! ;-)

It´s just a fake: An animated GIF picture with a progress bar. I think,
they made some statistics on database queries, added 10% and created
the GIF. The result is, that the waiting time seems shorter. Nice.

Correct me anybody please, who can proof that this progress bar is no
fake. I´d like to know this technique, too.

Greetings,
--
Frank Finner

And now there is no turning back at all.
                              (M. Moorcock, "Elric Of Melnibone")"

Re: Long running queries and timeouts

From
"Josh Berkus"
Date:
Jean-Michael,

> Are you connecting from Netscape? I noticed long queries timeouted in
>
> Netscape. This is because Nescape waits for the entire content of a
>  page
> before displaying it.

Yes, and several other Mozilla derivatives.  For example, Konqueror has
 a .conf variable that defaults its timeout at 60 seconds.  While one
 can adjust this, you can't count on hundreds of users doing the same.

> PostgreSQL can run very fast when well-optimized. You probably need
>  to
> optimize the source code of queries themselves, probably writing some
>  good
> PL/pgSQL server side code. If you need a GUI to do so, download and
>  install
> Dave Page's excellent tool http://pgadmin.postgresql.org

Nope don't need a GUI.  The query in question was actually a procedure
 that evaluated 700-1500 candidates for jobs based on between 14 and 90
 different scalable criteria and then ranked them by suitability.  So
 there was a good reason for it to run for a long time ... that, and
 the DB server's damn Celeron chip which I eventually replaced.

Thanks for the general advice.  I'm sure the other list members will
 benefit from it.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco