Re: query progress indicator

From: Alex Satrapa <alex(at)lintelsys(dot)com(dot)au>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: query progress indicator
Date: 2004-02-09 06:40:32
Message-ID: 40272B60.1000603@lintelsys.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Garamond wrote:
> [=============> ] 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?

Well... you could do something it in PostgreSQL. If it's the recovery of the data that's causing selects to go for too long without feedback, simply open a cursor and increment the progress bar as you bring result back from the cursor. If it's the query itself, break it up into smaller pieces.

If there are a bunch of changes to be done, try increasing the number of inserts/updates by making the criteria more specific, eg: instead of 'where date between '2004-01-01' and '2004-01-31', break it up into one day at a time. Then you can measure progress by the number of updates that have completed.

For longer or larger change sets, you have to address the issue of knowing how many changes are actually going to be made without actually performing the query - witness the difference between "explain" and "explain analyze" :)

These are just my ideas for doing things from the application side of things. Perhaps they might be of some use.

Alex Satrapa

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-02-09 10:13:02 Re: Where do I find the init-script
Previous Message Tom Lane 2004-02-09 05:57:12 Re: disallowing multiple NULLs in a unique constraint