From: Carlos Benkendorf <carlosbenkendorf@yahoo.com.br>
To: Jan Dittmer <jdittmer@sfhq.hn.org>
To: pgsql-performance@postgresql.org
Subject: Re: ORDER BY costs
Date: Thu, 22 Dec 2005 16:23:36 +0000 (GMT)
Message-ID: <20051222162336.8347.qmail@web35502.mail.mud.yahoo.com> (raw)
In-Reply-To: <43AA6879.6070601@sfhq.hn.org>
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=167710 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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: carlosbenkendorf@yahoo.com.br, jdittmer@sfhq.hn.org
Subject: Re: ORDER BY costs
In-Reply-To: <20051222162336.8347.qmail@web35502.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox