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 0621E9DC84B for ; Wed, 21 Dec 2005 15:39:37 -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 06265-06 for ; Wed, 21 Dec 2005 15:39:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A7B0F9DC84A for ; Wed, 21 Dec 2005 15:39:34 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBLJdZ8M015456; Wed, 21 Dec 2005 14:39:35 -0500 (EST) To: Carlos Benkendorf cc: pgsql-performance@postgresql.org Subject: Re: ORDER BY costs In-reply-to: <20051221181601.45239.qmail@web35508.mail.mud.yahoo.com> References: <20051221181601.45239.qmail@web35508.mail.mud.yahoo.com> Comments: In-reply-to Carlos Benkendorf message dated "Wed, 21 Dec 2005 18:16:01 +0000" Date: Wed, 21 Dec 2005 14:39:35 -0500 Message-ID: <15455.1135193975@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.029 required=5 tests=[AWL=0.029] X-Spam-Score: 0.029 X-Spam-Level: X-Archive-Number: 200512/542 X-Sequence-Number: 16363 Carlos Benkendorf writes: > Table "iparq.arript" > Column | Type | Modifiers > -------------------+-----------------------+----------- > anocalc | numeric(4,0) | not null > cadastro | numeric(8,0) | not null > codvencto | numeric(2,0) | not null > parcela | numeric(2,0) | not null > inscimob | character varying(18) | not null > codvencto2 | numeric(2,0) | not null > parcela2 | numeric(2,0) | not null > codpropr | numeric(10,0) | not null > dtaven | numeric(8,0) | not null > anocalc2 | numeric(4,0) | I suspect you'd find a significant performance improvement from changing the NUMERIC columns to int or bigint as needed. Numeric comparisons are pretty slow. regards, tom lane