Subject: Re: number of tuples processed

From: kyongsok kim <[email-masked]>
Date: Thu, 18 Jul 91 12:13:17 -0700

> 1. Is (or will) there be a way to query the number of tuples that have been
> replaced or added to a class after the execution of a 'replace'
> or 'append' command ?

When I used the equel (embedded quel of the Univ. Ingres), I had the same
question.  With retrieve stmt, you can do something with every tuple
retrieved.  HOwever, with append/replace/delete, you can't do that.

I have not tried with postgres yet.  However, I think that must be a
useful feature.

k kim

---

From: [email-masked] (Mike Olson)
Date: Thu, 18 Jul 91 14:45:54 PDT

> 1. Is (or will) there be a way to query the number of tuples that have
>    been replaced or added to a class after the execution of a 'replace'
>    or 'append' command ?

no, we don't have any easy way of doing this, though it probably wouldn't
be very hard to add.

> 2. What's about the column 'reltuples' in the system table 'pg_class'?
>    At the moment it does not seem to contain reasonable values. The value
>    is always 0! Is there another (efficient) possibility to query the number
>    of tuples in a class or will this column be used in version 3.0?

it gets set by the vacuum cleaner.  if it's always zero, then you're not
running the vacuum cleaner.  see the documentation for details.

as a special case, defining an index sets reltuples and relpages on the base
and index relations in order to get the planner to use them.  we don't keep
these values current all the time, since that would require an extra system
catalog update every time you added or deleted a tuple from your database.

					mike olson
					postgres research group
					uc berkeley
					[email-masked]

---

From: [email-masked]
Date: Thu, 18 Jul 91 14:55:31 PDT

>    been replaced or added to a class after the execution of a 'replace'

if you run the backend directly with the -s flag, you will get a detailed
stat report at the end of every command, which includes the number of tuples
processed/replaced/appended, etc.  you can not see the stat if you are running
postgres through the monitor.

					wei hong
					postgres research group
					uc berkeley