| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Felix Scheicher <mandavi(at)web(dot)de> |
| Cc: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: queries are fast after dump->restore but slow again after some days dispite vacuum |
| Date: | 2012-07-19 15:48:46 |
| Message-ID: | 50082C5E.6020606@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jeff Janes | 2012-07-19 16:12:08 | Re: queries are fast after dump->restore but slow again after some days dispite vacuum |
| Previous Message | Felix Scheicher | 2012-07-19 15:13:14 | Re: queries are fast after dump->restore but slow again after some days dispite vacuum |