Re: single index on more than two coulumns a bad thing?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: Palle Girgensohn <girgen(at)pingpong(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: single index on more than two coulumns a bad thing?
Date: 2004-04-02 04:36:38
Message-ID: 18754.1080880598@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> Is it always bad to create index xx on yy (field1, field2, field3);

> I'm afraid that you've been given some misleading advice.

I'd say it's a matter of getting your optimizations straight.

If you have a query that can make use of that index, and the query is
executed often enough to make it worth maintaining the index during
table updates, then by all means make the index.

The standard advice is meant to warn you against creating a zillion
indexes without any thought to what you'll be paying in update costs.
Indexes with more than a couple of columns are usually of only narrow
applicability, and so you have to be sure that they'll really pay for
themselves...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Stark 2004-04-02 04:44:29 Re: Index Performance Help
Previous Message Josh Berkus 2004-04-02 00:35:45 Re: single index on more than two coulumns a bad thing?