Re: same size VARCHAR or INT IX faster? - Mailing list pgsql-general

From Richard Huxton
Subject Re: same size VARCHAR or INT IX faster?
Date
Msg-id 43180067.7020006@archonet.com
Whole thread Raw
In response to same size VARCHAR or INT IX faster?  (Matthew Peter <survivedsushi@yahoo.com>)
Responses Re: same size VARCHAR or INT IX faster?
List pgsql-general
Matthew Peter wrote:
> same size VARCHAR or INT IX faster? i assume INT. The
> reason I ask is I was wondering what (if any) is the
> avg delay from one over the other? And benefit of one
> over the other? Thanks.

If you want numbers, use INT. If you want text use a VARCHAR.


It's probably difficult to come up with speed comparisons for "the same
size" since varchar will have an overhead for the field-length as well
as the number of characters.

Even then, you'd have to account for client language and application
overheads.

In any case, optimising at this level is unlikely to be a good use of
your time unless you really have reached the practical limits of
available hardware.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Michael Meskes
Date:
Subject: Re: ECPG examples...
Next
From: "Andrus"
Date:
Subject: how to retrieve error message details