Re: More indexes...more better?

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Varun Kacholia <varunk(at)cse(dot)iitb(dot)ac(dot)in>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: More indexes...more better?
Date: 2002-06-25 02:50:50
Message-ID: Pine.LNX.4.44.0206242239210.16955-100000@cm-lcon-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gordon Luk 2002-06-25 03:03:17 [Please Help!!!!!!!!] Problem in Chinese (Big5)!!! Version 7.2.1 (come with Redhat 7.3)
Previous Message Marc G. Fournier 2002-06-25 02:48:44 Re: Proxy Server ...