Re: Natural key woe - Mailing list pgsql-general

From Eelke Klein
Subject Re: Natural key woe
Date
Msg-id CALEkvvy2k6XExA1Fgc_oo8-ze_q0F9idSN8MBEpwUizyaew2_A@mail.gmail.com
Whole thread Raw
In response to Re: Natural key woe  (Robin <robinstc@live.co.uk>)
List pgsql-general


One other wrinkle to note. After clearing out these rows, running 'VACUUM table2', 'ANALYZE table2' and 'REINDEX table table2', some queries with simple sequence scans were taking a few seconds to run even though there are only a thousand rows in the table. I finally found that running CLUSTER on the table sorted that out, even though we're on an SSD so I would have thought seeking all over the place for a seq. scan wouldn't have made that much difference. It obviously does still make some.

A VACUUM FULL table2 would have made the CLUSTER unnecesary. A normal VACUUM only marks dead rows as free but does not shrink the table. A VACUUM FULL removes all the free space from the table and returns it to the OS.

Eelke Klein

 

pgsql-general by date:

Previous
From: Robin
Date:
Subject: Re: Natural key woe
Next
From: Adrian Klaver
Date:
Subject: Re: Question about synchronous replication