Re: Inserts or Updates

From: Ofer Israeli <oferi(at)checkpoint(dot)com>
To: Andy Colson <andy(at)squeakycode(dot)net>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>, Olga Vingurt <olgavi(at)checkpoint(dot)com>, Netta Kabala <nettak(at)checkpoint(dot)com>
Subject: Re: Inserts or Updates
Date: 2012-02-07 17:40:11
Message-ID: 217DDBC2BB1E394CA9E7446337CBDEF20102C056BE6F@il-ex01.ad.checkpoint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Andy,

The two tables I am referring to have the following specs:
Table 1:
46 columns
23 indexes on fields of the following types:
INTEGER - 7
TIMESTAMP - 2
VARCHAR - 12
UUID - 2

23 columns
12 indexes on fields of the following types:
INTEGER - 3
TIMESTAMP - 1
VARCHAR - 6
UUID - 2

All indexes are default indexes.

The primary index is INTERGER and is not updated.

The indexes are used for sorting and filtering purposes in our UI.

I will be happy to hear your thoughts on this.

Thanks,
Ofer

-----Original Message-----
From: Andy Colson [mailto:andy(at)squeakycode(dot)net]
Sent: Tuesday, February 07, 2012 4:47 PM
To: Ofer Israeli
Cc: pgsql-performance(at)postgresql(dot)org; Olga Vingurt; Netta Kabala
Subject: Re: [PERFORM] Inserts or Updates

On 2/7/2012 4:18 AM, Ofer Israeli wrote:
> Hi all,
>
> We are currently "stuck" with a performance bottleneck in our server
> using PG and we are thinking of two potential solutions which I would be
> happy to hear your opinion about.
>
> Our system has a couple of tables that hold client generated
> information. The clients communicate *every* minute with the server and
> thus we perform an update on these two tables every minute. We are
> talking about ~50K clients (and therefore records).
>
> These constant updates have made the table sizes to grow drastically and
> index bloating. So the two solutions that we are talking about are:
>

You dont give any table details, so I'll have to guess. Maybe you have
too many indexes on your table? Or, you dont have a good primary index,
which means your updates are changing the primary key?

If you only have a primary index, and you are not changing it, Pg should
be able to do HOT updates.

If you have lots of indexes, you should review them, you probably don't
need half of them.

And like Kevin said, try the simple one first. Wont hurt anything, and
if it works, great!

-Andy

Scanned by Check Point Total Security Gateway.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ofer Israeli 2012-02-07 17:43:19 Re: Inserts or Updates
Previous Message Claudio Freire 2012-02-07 17:31:20 Re: Inserts or Updates