From: Andrew Dunstan <andrew@dunslane.net>
To: Felix Scheicher <mandavi@web.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: queries are fast after dump->restore but slow again after some days dispite vacuum
Date: Thu, 19 Jul 2012 11:48:46 -0400
Message-ID: <50082C5E.6020606@dunslane.net> (raw)
In-Reply-To: <loom.20120719T160306-28@post.gmane.org>
References: <loom.20120719T133136-384@post.gmane.org>
<5007FFDD.5050103@dunslane.net>
<loom.20120719T160306-28@post.gmane.org>
On 07/19/2012 11:13 AM, Felix Scheicher wrote:
> Andrew Dunstan <andrew <at> dunslane.net> writes:
>
>> Try running CLUSTER on the relevant tables and see if it makes a
>> difference. If it does you might want to look into using pg_reorg
>> periodically.
>
> That worked like a charm! Many thanks. But how comes, the queries are also fast
> after a restore without the cluster?
>
There is probably a lot of unused space in your table. CLUSTER rewrites
a fresh copy, as do restore and pg_reorg.
You might also want to try changing the settings on the table so it gets
much more aggressively auto-vacuumed, so that dead space is made
available much more quickly, and the table has less chance to get bloated.
cheers
andrew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: andrew@dunslane.net, mandavi@web.de
Subject: Re: queries are fast after dump->restore but slow again after some days dispite vacuum
In-Reply-To: <50082C5E.6020606@dunslane.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox