pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: William Yu <wyu@talisys.com>
To: pgsql-performance@postgresql.org
Subject: Re: Table UPDATE is too slow
Date: Tue, 31 Aug 2004 12:15:22 -0700
Message-ID: <ch2j5l$uap$1@news.hub.org> (raw)
In-Reply-To: <4134C4FA.20404@syscor.com>
References: <4134BF36.3000504@syscor.com>
	<20040831181815.GB24253@uio.no>
	<4134C4FA.20404@syscor.com>

Ron St-Pierre wrote:
> Yes, I know that it's not a very good idea, however queries are allowed 
> against all of those columns. One option is to disable some or all of the
> indexes when we update, run the update, and recreate the indexes, 
> however it may slow down user queries. Because there are so many indexes,
> it is time consuming to recreate them after the update.

Just because a query can run against any column does not mean all 
columns should be indexed. Take a good look at the column types and 
their value distribution.

Let's say I have a table of addresses but every address I collect is in 
the 94116 zip code. That would mean indexes on city, state and zip are 
not only useless but could decrease performance.

Also, if a search always includes a unique key (or a column with highly 
unique values), eliminating the other indexes would force the planner to 
always use that index first.



view thread (16+ messages)  latest in thread

Message-ID: <ch2j5l$uap$1@news.hub.org>
Permalink:  ../ch2j5l$uap$1@news.hub.org/
Also on:    postgresql.org/message-id/ch2j5l$uap$1@news.hub.org

 · 

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: wyu@talisys.com
  Subject: Re: Table UPDATE is too slow
  In-Reply-To: <ch2j5l$uap$1@news.hub.org>

* 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