Re: How to improve insert speed with index on text column

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: How to improve insert speed with index on text column
Date: 2012-02-01 02:11:57
Message-ID: CAMkU=1ydbxUkuoOoqi4OEkXB_4-hD5VZyD02X+-5Gya1p-mSfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Jan 31, 2012 at 10:46 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>
>> Shared buffers is the cache maintained by PostgreSQL. All all the data
>> that you read/write need to go through shared buffers.
>
> While this is technically true, I need to point out that you generally
> increase shared_buffers for high concurrency, and for reads, not for
> writes, especially for row-at-a-time inserts.  There's just not that
> much memory required (although more than the out-of-the-box defaults).

When inserting rows in bulk (even just with inserts in a tight loop)
into indexed tables, I often see the performance collapse soon after
the active index size exceeds shared_buffers. Or at least,
shared_buffers + however much dirty data the kernel is willing to
tolerate. But that later value is hard to predict. Increasing the
shared_buffers can really help a lot here. I'm sure this behavior
depends greatly on your IO subsystem.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rosser Schwarz 2012-02-01 03:29:18 Re: How to improve insert speed with index on text column
Previous Message Alessandro Gagliardi 2012-01-31 23:43:10 Re: From Simple to Complex