Re: Running update in chunks?

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "Jeff Janes" <jeff(dot)janes(at)gmail(dot)com>,"Tim Uckun" <timuckun(at)gmail(dot)com>
Cc: "Steve Crawford" <scrawford(at)pinpointresearch(dot)com>,"pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running update in chunks?
Date: 2013-01-23 14:45:49
Message-ID: 20130123144550.119100@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Janes wrote:

> one hstore field can easily be equivalent to 50 text fields with
> an index on each one.
>
> I'm pretty sure that that is your bottleneck.

I agree that seems like the most likely cause. Each update to the
row holding the hstore column requires adding new index entries for
all the hstore elements, and autovacuum will need to clean up the
old ones in the background. The best solution would be to either
normalize the data instead of using hstore, or move the hstore to a
separate table which is referenced by some sort of ID from the
frequently-updated table.

-Kevin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Haas 2013-01-23 15:17:11 Re: proposal: fix corner use case of variadic fuctions usage
Previous Message Alexander Farber 2013-01-23 12:13:46 Re: Sending several commands simultaneously to PostgreSQL 8.4