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]

 



Scara Maccai wrote:

> I mean: there's access exclusive lock on the table while clustering,
> so I don't see any problem in doing it... this way you could 
> 
> - avoid sorting (which is what is used in the method "create newtable
> as select * from oldtable order by mycol", and can be slow with 15M
> rows, plus in my case uses 8GB of ram...)
> - avoid random-reading on disk
> 
> Am I missing something or it's just that "hasn't been done yet"?

The actual CLUSTER implementation is "do an indexscan, insert the rows
in the new heap in that order".  It's pretty stupid.  There was an
attempt to fix it (for example so that it could try to do a seqscan+sort
instead of indexscan), but it stalled.
http://archives.postgresql.org/message-id/87vdxg6a3d.fsf@xxxxxxxxxxxxxxxxxx
http://archives.postgresql.org/message-id/20080901072147.GB16993@xxxxxxxxx

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
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