Re: [SQL] Yet Another (Simple) Case of Index not used - Mailing list pgsql-performance

From Tom Lane
Subject Re: [SQL] Yet Another (Simple) Case of Index not used
Date
Msg-id 27004.1050852329@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] Yet Another (Simple) Case of Index not used  (Andreas Pflug <Andreas.Pflug@web.de>)
Responses Re: [SQL] Yet Another (Simple) Case of Index not used  (Andreas Pflug <Andreas.Pflug@web.de>)
List pgsql-performance
Andreas Pflug <Andreas.Pflug@web.de> writes:
>  I think a row counter on each table would be even useful for some kind
> of auto-vacuum mechanism, that could be triggered if pg_class.reltuples
> deviates too far from the real row count.

It would be counting the wrong thing.  auto-vacuum needs to know how
many dead tuples are in a table, not how many live ones.  Example:
UPDATE doesn't change the live-tuple count (without this property,
I don't think the sort of count maintenance Kevin is proposing could
possibly be efficient enough to be interesting).  But it does create
a dead tuple that vacuum wants to know about.

            regards, tom lane


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used
Next
From: Andreas Pflug
Date:
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used