Re: Table partitioning for maximum speed?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: greg(at)turnstep(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table partitioning for maximum speed?
Date: 2003-10-10 18:01:32
Message-ID: 20031010180132.GC4206@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 10, 2003 at 04:30:20PM -0000, greg(at)turnstep(dot)com wrote:

> One way to speed things up is to convert the entire checksum. Consider
> what a md5 checksum really is: a text string representing a hexadecimal
> number. Storing it as TEXT or CHAR is not as good as storing it as a
> number directly. Have your application convert it to a decimal number,
> and then store the checksum as type NUMERIC in the database.

A subsequent idea is that with NUMERIC or other variable length fields
you are wasting time, space and cache hits anyway. It would be probably
faster to create a custom datatype, with fixed length for the exact size
of an MD5 sum. With suitable input and output functions and all the
operators you need, you will likely gain some additional performance
boost.

IIRC, Manfred Koizar developed a fixed-width char datatype for Shridar
Daitankhar (sp?) maybe a year ago. It is probably a good starting
point. Look for it in the pgsql-performance archives.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Endurecerse, pero jamás perder la ternura" (E. Guevara)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-10-10 18:04:58 Re: Interfaces that support cursors
Previous Message Network Administrator 2003-10-10 17:56:37 Re: Interfaces that support cursors