Re: Running update in chunks?
Richard Huxton <dev@archonet.com>
From: Richard Huxton <dev@archonet.com>
To: Tim Uckun <timuckun@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>, Kevin Grittner <kgrittn@mail.com>, "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Date: 2013-01-25T09:23:07Z
Lists: pgsql-general
On 25/01/13 08:57, Tim Uckun wrote: >> What if you do: >> alter table cars.imports set (fillfactor=50); >> Before the vacuum full, and then try the update again? > > This makes a dramatic difference when combined with a vacuum. > > UPDATE 98834 > Time: 3408.210 ms > > Ten times faster! That suggests (to me, at least) that it is related to index updating. Again, your GIN index seems primary candidate. A fillfactor of 50% means row updates probably stay on the same disk-block as their previous version. This implies less index updates. Try running iostat (I think that's available on a Mac) with/without the fillfactor and with/without the GIN index while you do the updates. It's possible your SSD is just behaving oddly under stress. -- Richard Huxton Archonet Ltd