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

From Andreas Pflug
Subject Re: [SQL] Yet Another (Simple) Case of Index not used
Date
Msg-id 3EA2BED5.9010707@web.de
Whole thread Raw
In response to Re: [SQL] Yet Another (Simple) Case of Index not used  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:

>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.
>
>
>
I understand your point, but is this about VACUUM only or VACUUM ANALYZE
too? People wouldn't bother about big databases if it's still fast
(until the disk is full :-)

Do dead tuples affect query planning? I thought the plan only cares
about existing rows and their data patterns.
So count(*), pg_stat_all_tables.n_tup_ins, .n_tup_upd and .n_tup_del all
together can make a VACUUM ANALYZE necessary, right?

Regards,
Andreas


pgsql-performance by date:

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