> I've found it easier to select everything into another > table, truncate > the original table, then insert the rows as: that takes 50 seconds of pure sorting and 8GB of ram to sort; my method doesn't require more memory than the size of the heap table, and no sorting, since the index is already sorted. Basically the cluster operation would be: A) time it takes to do a full scan of the heap + B) time it takes to do a full scan of the index + C) time it takes to rewrite ordered heap and index of course C) is no different than any other method I guess. plus: with the "create as" method indexes, foreign keys etc have to be recreated on the tab (I'm not talking about timing: it's just that you have to "remember" to re-create whatever was in the old table...). Plus: if a table has a foreign key to the table you're clustering, I guess the "create as" method doesn't work (I guess you can't drop a table that is the foreign key of another one). -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general