"Jeffrey Baker" <jwbaker@gmail.com> writes:
> For this query, work_mem is 100MB and maintenance_work_mem is 1GB, on a
> system with 8GB of memory. Notably I just installed a new storage subsystem
> and upgraded to 8.3.1 less than a week ago, so my experience with this
> instance is somewhat limited. Creating the table in this case takes half an
> hour and then indexing it requires almost an hour.
These numbers seem to me to be pretty strong evidence that
maintenance_work_mem = 1GB is a mistake. Try it at 100MB and then some
intermediate values.
Now, *why* it is a mistake is interesting to speculate about, but
let's confirm the theory first.
regards, tom lane