Search Postgresql Archives

Re: Clustering with enough work_mem: copy heap in mem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux