Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group