Re: Performance Optimization for Dummies 2 - the SQL

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Carlo Stonebanks <stonec(dot)register(at)sympatico(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: 2006-10-06 16:53:43
Message-ID: 1160153623.6181.13.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 2006-10-06 at 11:44, Carlo Stonebanks wrote:
> This didn't work right away, but DID work after running a VACUUM FULL. In
> other words, i was still stuck with a sequential scan until after the
> vacuum.
>
> I turned autovacuum off in order to help with the import, but was perfoming
> an ANALYZE with every 500 rows imported.
>
> With autovacuum off for imports, how frequently should I VACUUM?

Basically once the query planner stops using seq scans is usually good
enough, although sometimes there's a bit of a period where it'll be
using nested loops and then switch to merge etc...

Every 500 is probably a bit much. After the first few thousand rows,
run an analyze, and after about 5 to 10 thousand another analyze and you
should be set.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2006-10-06 18:53:35 Re: Performance Optimization for Dummies 2 - the SQL
Previous Message Carlo Stonebanks 2006-10-06 16:44:29 Re: Performance Optimization for Dummies 2 - the SQL