Re: Long running update

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>, Akash Garg <akash(dot)garg(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Long running update
Date: 2005-08-12 07:24:17
Message-ID: 877jeraa8u.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Would it? My first thought on reading the OP was to recommend
> contrib/pgstattuple, but I refrained after thinking that if the table
> is all that big, the last thing you need is someone doing a seqscan of
> the whole table to see where you are. Much less doing so repeatedly.

Well it's not a magic bullet, but there are lots of circumstances where it
would be useful.

I used to load huge data sets into Oracle from text files. These are purely
insert only, reading the table contents isn't really going to interfere much
with the load operation.

Sometimes I do large queries that seem to take longer than I expect. It would
be useful to be able to look at the data to be sure it isn't off doing
something entirely inappropriate like an unconstrained join or a join on the
wrong columns.

The application where it would be really invaluable is when you want a web
page that displays a progress bar or monitoring software for some running job
(triggered either from the web application or a cron job). Normally you
wouldn't be able to do this unless you were willing to have the job commit
periodically or jury rig up something effectively equivalent to READ DIRTY
involving temporary files or extra database connections. Any progress
information the job has available to it isn't available to the web
application or monitoring software.

I would say this doesn't replace having some sort of progress indication from
SQL queries. It's an entirely separate feature that happens to be useful for
some of the same uses. There are certainly pros and cons of each approach for
various use cases.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karim Nassar 2005-08-12 07:51:42 LIve PGDoc v.01 released
Previous Message Martijn van Oosterhout 2005-08-12 06:56:35 Re: plphp crashing server