Re: Relation of indices to ANALYZE

From: Richard Huxton <dev(at)archonet(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Relation of indices to ANALYZE
Date: 2003-07-17 16:14:06
Message-ID: 200307171714.06993.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thursday 17 Jul 2003 3:45 pm, Bill Moran wrote:
> Hello all,
>
> I'm putting together a database that has me wondering about the interaction
> of ANALYZE with indices. I guess the basic question is: are indices
> affected by the results of ANALYZE.
>
> The particular application I've got is doing a batch insert of lots of
> records. For performance, I'm dropping the indexes on the table, doing the
> inserts, then recreating the indexes a then doing a VACUUM ANALYZE.
> Specifically, I'm wondering if I should do the ANALYZE before or after I
> recreate the indexes, or whether it matters.

I don't think it matters - the analyse looks at the data, and then when you
run a query the planner estimates how many rows each clause will require and
checks if there is an index that will help.
--
Richard Huxton

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Albert Cervera Areny 2003-07-17 16:14:16 Re: [PERFORM] Bad performance using ODBC
Previous Message Jean-Luc Lachance 2003-07-17 16:13:27 Re: Hardware performance