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

Поиск
Список
Период
Сортировка
Искать
От
Scara Maccai
Тема
Re: Clustering with enough work_mem: copy heap in mem?
Дата
Msg-id
65654.5083.qm@web24603.mail.ird.yahoo.com
Ответ на
Список
Дерево обсуждения
Clustering with enough work_mem: copy heap in mem? Scara Maccai <m_lists@yahoo.it>
Re: Clustering with enough work_mem: copy heap in mem? Alvaro Herrera <alvherre@commandprompt.com>
Re: Clustering with enough work_mem: copy heap in mem? Scara Maccai <m_lists@yahoo.it>
Re: Clustering with enough work_mem: copy heap in mem? Scott Marlowe <scott.marlowe@gmail.com>
Re: Clustering with enough work_mem: copy heap in mem? Scara Maccai <m_lists@yahoo.it>
> 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.

Actually I read that, but it's complicated... it involves planning and a lot of other stuff I don't even know about...

My "solution" I guess would be easier (but, of course, can't be used if you don't have enough work_mem):

if heap table <= work_mem
 copy heap table in mem
 use that region as it was the real file
else
 do the regular (slow!) cluster 

I guess this can be worse than the current way of doing it only when the table contains a lot of dead rows; in all other cases I can't see how cluster could ever become faster than a simple table + index scans.

Of course, I'm not saying it's "very easy" to implement... but given the tons of ram a lot of people use in the servers, and the fact that work_mem can be set on a per-connection basis, I think it would be nice...

 



В списке pgsql-general по дате отправления
От: Alvaro Herrera
Дата:
От: Greg Sabino Mullane
Дата:
FAQ