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

Поиск
Список
Период
Сортировка
От Scara Maccai
Тема Re: Clustering with enough work_mem: copy heap in mem?
Дата
Msg-id 676587.27600.qm@web24615.mail.ird.yahoo.com
обсуждение исходный текст
Ответ на Re: Clustering with enough work_mem: copy heap in mem?  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
> 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
theheap 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
foreignkey to the table you're clustering, I guess the "create as" method doesn't work (I guess you can't drop a table
thatis the foreign key of another one). 







В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Clustering with enough work_mem: copy heap in mem?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Clustering with enough work_mem: copy heap in mem?