Re: Index space growing even after cleanup via autovacuum in Postgres 9.2

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Tirthankar Barari <tbarari(at)verizon(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Index space growing even after cleanup via autovacuum in Postgres 9.2
Date: 2014-01-10 12:06:21
Message-ID: CA+bJJbx3hfPQFZEWQ-Yzw-vQ2NBCuffW231ATp+cjb+OD6nzyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

On Thu, Jan 9, 2014 at 7:50 PM, Tirthankar Barari <tbarari(at)verizon(dot)com> wrote:
> We have a table where we insert about 10 million rows everyday. We keep 14
> day's worth of entries (i.e. 140 mil). A scheduled task wakes up every day
> and deletes all entries past the 14 day window (i.e. deletes entries from
> the 15th day in the past).

Not related to your vacuum problem, but if your pattern is something
like deleting everything inserted 15 days ago you may want to think of
using partitioning or simple inheritance. Make the scheduled task
create a new partition/child table, redirect insertions to it, drop
the oldest partition.

Also, if the pattern is insert-only all the time, delete whole day, it
may be easier to exclude the table from autovacuum and make the
scheduled task vacuum the table after deleting.

Francisco Olarte.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sramay 2014-01-10 12:57:55 Re: pg_largeobject related issue with 9.2
Previous Message M Tarkeshwar Rao 2014-01-10 11:06:13 Re: Consistent file-level backup of pg data directory