Re: ORDER BY costs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Carlos Benkendorf <carlosbenkendorf(at)yahoo(dot)com(dot)br>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: ORDER BY costs
Date: 2005-12-21 19:39:35
Message-ID: 15455.1135193975@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Carlos Benkendorf <carlosbenkendorf(at)yahoo(dot)com(dot)br> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2005-12-21 20:43:43 Re: Speed of different procedural language
Previous Message Tom Lane 2005-12-21 19:34:19 Re: Wrong index used when ORDER BY LIMIT 1