maintenance_work_mem and create index - Mailing list pgsql-performance

From Ioana Danes
Subject maintenance_work_mem and create index
Date
Msg-id 541411.24327.qm@web45101.mail.sp1.yahoo.com
Whole thread Raw
List 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
usingaround 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
workmemory 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
lookslike for creating an index is required a maintenance work memory 3 times larger than the size of the index on disk
orI 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.


pgsql-performance by date:

Previous
From: "Lionel"
Date:
Subject: Re: Hardware HD choice...
Next
From: "David Rees"
Date:
Subject: Occasional Slow Commit