"Kevin Grittner" <kevin.gritt...@wicourts.gov> writes:
> Tom Lane <t...@sss.pgh.pa.us> wrote:
>> Another thing that struck me while looking at the code is that the
>> curpages clamp is applied to indexes too, which seems like a
>> thinko. A table occupying a few pages wouldn't likely have an
>> index as big as the table itself is.
 
> But not zero pages, either.

Huh?  I think you misread the test.  Keep in mind that the starting
value of curpages is the actual current size of the relation (as
reported by lseek(SEEK_END)).  The clamp action is triggering if
pg_class.relpages is zero, indicating (approximately) that we've never
yet run vacuum on the relation.

BTW, in some quick testing it seems like a newly-created index will
start out with relpages nonzero anyway, making the point moot; so adding
a relkind test here is really more documentation than anything else.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to