Re: Multiple table scans to analyze multiple indexes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Multiple table scans to analyze multiple indexes
Date: 2010-10-20 18:24:28
Message-ID: 201010201824.o9KIOT429465@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thom Brown wrote:
> Hi all,
>
> I might not be understanding this correctly, but does Postgres, when
> VACUUM ANALYZE-ing a table, perform separate scans for each index?
> And if so, is this necessary? Can't it update indexes parallel? This
> would be particularly useful when rebuilding all indexes on a table.

Uh, I am unsure of the question. ANALYZE randomly samples the heap,
plus generates analyze statistics for each expression index.

As far as VACUUM, that scans the heap and then scans the indexes based on
the free space is finds; see vacuumlazy.c:

http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/commands/vacuumlazy.c;h=0ac993f957d6e49c23448dd85f8ed41308dc9c60;hb=HEAD

Are you asking why normal delete doesn't update the index?

This is probably a question for the hackers list.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2010-10-20 18:29:05 Re: Database INNOVATION
Previous Message Merlin Moncure 2010-10-20 15:21:57 Re: recovery from out of disk space