Re: ORDER BY costs

Поиск
Список
Период
Сортировка
От Carlos Benkendorf
Тема Re: ORDER BY costs
Дата
Msg-id 20051222162336.8347.qmail@web35502.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на ORDER BY costs  (Carlos Benkendorf <carlosbenkendorf@yahoo.com.br>)
Список pgsql-performance

Jan Dittmer <jdittmer@sfhq.hn.org> escreveu:
What is your work_mem setting? I think the default is 1MB which is
probably too low as your trying to sort roughly 150000*100Bytes = 15MB.

Jan
I think you would like to say 150000*896Bytes... Am I right? My default work_mem is 2048 and I changed to 200000... and pgsql_tmp directory is not used any more...but...
 
Now the new numbers:
 
Sort  (cost=132929.22..133300.97 rows=148701 width=896) (actual time=3949.663..4029.618 rows=167710 loops=1)
   Sort Key: anocalc, cadastro, codvencto, parcela
   ->  Index Scan using pk_arript, pk_arript, pk_arript, pk_arript on arript  (cost=0.00..120154.28 rows=148701 width=896) (actual time=0.166..829.260 rows=1677 10 loops=1)
         Index Cond: (((anocalc = 2005::numeric) AND (cadastro = 19::numeric) AND (codvencto = 0::numeric) AND (parcela >= 0::numeric)) OR ((anocalc = 2005::numeric) AND (cadastro = 19::numeric) AND (codvencto > 0::numeric)) OR ((anocalc = 2005::numeric) AND (cadastro > 19::numeric)) OR (anocalc > 2005::numeric))
 Total runtime: 4184.723 ms
(5 rows)
 
It is less than with work_mem set to 2000 but is it worthly? I´m afraind of swapping... are not those settings applied for all backends?
 
Benkendorf
 
 


Yahoo! doce lar. Faça do Yahoo! sua homepage.

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

Предыдущее
От: Steve Peterson
Дата:
Сообщение: Re: effizient query with jdbc
Следующее
От: Juan Casero
Дата:
Сообщение: Re: What's the best hardver for PostgreSQL 8.1?