Re: More indexes...more better? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: More indexes...more better?
Date
Msg-id Pine.LNX.4.44.0206242239210.16955-100000@cm-lcon-46-187.cm.vtr.net
Whole thread Raw
In response to More indexes...more better?  (Varun Kacholia <varunk@cse.iitb.ac.in>)
List pgsql-general
Varun Kacholia dijo:

>  hi ,
>   I wanted to know whether it is better (speed-wise) to have more
>   indexes .Or one should try to have less number of them , so that
>   as much as possible all can be stored 'in-memory'? Or is it
>   that they are loaded 'in-memory' only after the analyzer
>   decides which of them to use?
>    I am having 12 indexes on 6 tables(they are huge with 0.5 million
>    rows in each).

Every index you have adds some maintenance overhead when you INSERT,
UPDATE or DELETE.  Therefore, for those operations, the less indexes,
the better.  However you should have the indexes you need for SELECT
operations.  You have to find out which ones do your queries use, by
means of EXPLAINing them.

Don't forget to VACUUM and ANALYZE your tables.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El destino baraja y nosotros jugamos" (A. Schopenhauer)




pgsql-general by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Proxy Server ...
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Proxy Server ...