Re: Why does it not use the index?

From: Andrew Ayers <aayers(at)eldocomp(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why does it not use the index?
Date: 2003-07-21 19:16:47
Message-ID: 3F1C3C1F.2030204@eldocomp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doug McNaught wrote:
> It's not the VACUUM that's necessary; it's the ANALYZE. The query
> planner uses table statistics to make its decisions, and ANALYZE is
> what collects those statistics. Without an ANALYZE the planner will
> make default assumptions that are rarely correct. :)

I am not the original poster, but I am a PG newbie, so:

So - are you saying that if you have a table, and you create an index on
that table, you need to perform an ANALYZE in order for PG to use the
index. Otherwise, the index goes unused (or used improperly)?

I am just trying to understand this for a database I have set up, where
I set up a variety of indexes, assumming (wrongly?) that the indexes
would be used once they were created.

Andrew L. Ayers
Phoenix, Arizona

-- CONFIDENTIALITY NOTICE --

This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-07-21 19:26:28 Re: Why does it not use the index?
Previous Message Mat 2003-07-21 19:12:25 Re: Why does it not use the index?