From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: Adriaan van Os <postgres@microbizz.nl>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Progress of asynchronous queries
Date: Fri, 15 Sep 2006 17:18:25 +0700 (ICT)
Message-ID: <25525.203.121.164.162.1158315505.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <450A6A87.2030808@microbizz.nl>
References: <450A6A87.2030808@microbizz.nl>
On Fri, September 15, 2006 15:55, Adriaan van Os wrote:
> I couldn't find anything in the libpq interfaces that identifies the
> current progress of an
> asynchronous query as a percentage of the estimated total query time. So,
> unless I missed
> something, I would like to file this as a feature request.
>
> The idea behind this, of course, is to show a progress bar in the user
> interface of the client
> application as soon as the query takes longer than say 1 second.
One way to do this would be to use a cursor, and only receive batches of
(say) a hundred or a thousand rows at a time. In that case you might not
even want to bother with asynchronous execution at all.
It may take some extra work for your program to handle its data in chunks.
Then again, for many programs it's not necessary to hold all of a result
set in memory at the same time. In that case you may see reduced memory
usage if you request one chunk of data through a cursor, process it, then
request the next batch.
Doing that will take longer overall but give you faster initial response
time. If you want to keep the overall time low, and you do a lot of
processing per batch, you may still want to request your batches
asynchronously just so your program can process one batch of data while
the server is retrieving the next.
Jeroen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jtv@xs4all.nl, postgres@microbizz.nl
Subject: Re: Progress of asynchronous queries
In-Reply-To: <25525.203.121.164.162.1158315505.squirrel@webmail.xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox