maintenance_work_mem and create index

From: Ioana Danes <ioanasoftware(at)yahoo(dot)ca>
To: PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: maintenance_work_mem and create index
Date: 2008-10-27 14:30:07
Message-ID: 541411.24327.qm@web45101.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

I have a question regarding the maintenance_work_mem and the index creation.

I have a dedicated postgresql server with 16GB of RAM.
The shared_buffers is 4GB and the maintenance_work_mem is 2GB.

I have a table with 28 mil records and 2 one-column indexes:
1. First index is for an integer column - size on disk 606MB
2. The second index is for a varchar column (15 characters usually) - size on disc 851MB.

When I create the first index (for the integer column) it fits in the memory and it takes 1 minute to be created and is using around 1.7GB of the maintenance work memory...

The second index is swapping on pgsql_tmp and it takes 26 minutes to be created so it looks like the 2GB of maintenance work memory is not enough to create a 851MB index...

So my question is the 2GB of maintenance work memory would be enough only for indexes 600MB or smaller on disk? It looks like for creating an index is required a maintenance work memory 3 times larger than the size of the index on disk or I am missing other parameters?

Thanks a lot,
Ioana

__________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.

Browse pgsql-performance by date

  From Date Subject
Next Message David Rees 2008-10-28 00:23:37 Occasional Slow Commit
Previous Message Michelle Konzack 2008-10-24 15:11:06 Re: Annoying Reply-To