Re: ORDER BY costs - Mailing list pgsql-performance

From Tom Lane
Subject Re: ORDER BY costs
Date
Msg-id 15455.1135193975@sss.pgh.pa.us
Whole thread Raw
In response to ORDER BY costs  (Carlos Benkendorf <carlosbenkendorf@yahoo.com.br>)
Responses Re: ORDER BY costs  (Carlos Benkendorf <carlosbenkendorf@yahoo.com.br>)
Re: ORDER BY costs  (Carlos Benkendorf <carlosbenkendorf@yahoo.com.br>)
List pgsql-performance
Carlos Benkendorf <carlosbenkendorf@yahoo.com.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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wrong index used when ORDER BY LIMIT 1
Next
From: "Merlin Moncure"
Date:
Subject: Re: Speed of different procedural language