Re: Why does it not use the index? - Mailing list pgsql-general

From Andrew Ayers
Subject Re: Why does it not use the index?
Date
Msg-id 3F1C3C1F.2030204@eldocomp.com
Whole thread Raw
In response to Why does it not use the index?  (Philip Greer <philip@tildesoftware.com>)
Responses Re: Why does it not use the index?
List 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
informationthat is privileged, confidential and exempt from disclosure under applicable law. If you are not the
intendedaddressee, 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
thismessage in error, please immediately advise the sender by reply email, and delete the message. Thank you. 

pgsql-general by date:

Previous
From: Mat
Date:
Subject: Re: Why does it not use the index?
Next
From: Doug McNaught
Date:
Subject: Re: Why does it not use the index?