Re: very slow update query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ilija Vidoevski <ilija(dot)vidoevski(at)yahoo(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: very slow update query
Date: 2012-07-31 00:59:22
Message-ID: 10296.1343696362@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ilija Vidoevski <ilija(dot)vidoevski(at)yahoo(dot)com> writes:
> This is table DDL

What I asked for was EXPLAIN ANALYZE output ... but anyway, the thing
that jumps out at me about that DDL is the six extremely wide indexes
(not even counting the primary key index). It seems very unlikely
that those are going to repay their update maintenance costs. I'd
try dropping all but the primary key and seeing if that improves the
update-speed situation at all. If it does, I'd suggest reading
something about Postgres-oriented index design before you add anything
back. There's material in the manual here:
http://www.postgresql.org/docs/9.1/static/indexes.html
but the key points I think you are missing is that indexes with more
than a few columns are seldom worth the trouble, and indexes with
identical leading columns are even more seldom worth the trouble.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jonatan Reiners 2012-07-31 10:06:18 Re: problem with pg_dump
Previous Message Tom Lane 2012-07-30 23:15:42 Re: WAL tuning advice