pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: Palle Girgensohn <girgen@pingpong.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: single index on more than two coulumns a bad thing?
Date: Thu, 01 Apr 2004 23:36:38 -0500
Message-ID: <18754.1080880598@sss.pgh.pa.us> (raw)
In-Reply-To: <200404011635.45440.josh@agliodbs.com>
References: <24070000.1080860445@palle.girgensohn.se>
	<200404011635.45440.josh@agliodbs.com>

Josh Berkus <josh@agliodbs.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



view thread (9+ messages)  latest in thread

Message-ID: <18754.1080880598@sss.pgh.pa.us>
Permalink:  ../18754.1080880598@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18754.1080880598@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com, girgen@pingpong.net
  Subject: Re: single index on more than two coulumns a bad thing?
  In-Reply-To: <18754.1080880598@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox