X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BB2C49DCCB7 for ; Thu, 22 Dec 2005 12:23:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09141-07 for ; Thu, 22 Dec 2005 12:23:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web35502.mail.mud.yahoo.com (web35502.mail.mud.yahoo.com [66.163.179.126]) by postgresql.org (Postfix) with SMTP id 371159DCBD4 for ; Thu, 22 Dec 2005 12:23:38 -0400 (AST) Received: (qmail 8349 invoked by uid 60001); 22 Dec 2005 16:23:36 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=a3KDDqkE+epk0PtzTkuf37GSVJgrAUxcDwsFUggTx1ZKIDfRF/C0UAgEEtqMyxoPlVraU2ukZu8TlOwqfZuJ6FOjvH8Th4Se2t4subtpda5DTNeCcyHLYeqVo0DnkvnHQUtjzrvwKoZk5g7qM6mTD2qRhi8gfQKRgyGBi0IPcao= ; Message-ID: <20051222162336.8347.qmail@web35502.mail.mud.yahoo.com> Received: from [201.3.235.213] by web35502.mail.mud.yahoo.com via HTTP; Thu, 22 Dec 2005 16:23:36 GMT Date: Thu, 22 Dec 2005 16:23:36 +0000 (GMT) From: Carlos Benkendorf Subject: Re: ORDER BY costs To: Jan Dittmer , pgsql-performance@postgresql.org In-Reply-To: <43AA6879.6070601@sfhq.hn.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1876667760-1135268616=:8327" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.527 required=5 tests=[AWL=0.047, DNS_FROM_RFC_ABUSE=0.479, HTML_MESSAGE=0.001] X-Spam-Score: 0.527 X-Spam-Level: X-Archive-Number: 200512/572 X-Sequence-Number: 16393 --0-1876667760-1135268616=:8327 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Jan Dittmer 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. --0-1876667760-1135268616=:8327 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit

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. --0-1876667760-1135268616=:8327--