Which is faster: char(14) or varchar(14)

From: Edson Richter <edsonrichter(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Which is faster: char(14) or varchar(14)
Date: 2012-12-04 13:44:20
Message-ID: BLU0-SMTP416DB00C21E4E2FBC9B939ECF470@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think I already know the answer (char(14)), but I would like to
confirm: which is faster?

In Brazil, company id has 14 digits (12 identifiers, 2 control digits).
By today, application use varchar(14) for these, but I intend to
optimize insert/update/delete and search, and I'm considering to change
it to char(14).

Will it give ANY gain? I do use equality and like operators for search.

Regards,

Edson

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2012-12-04 13:50:33 Re: Which is faster: char(14) or varchar(14)
Previous Message Vincent Veyron 2012-12-04 13:26:14 Re: SETOF come ritorno delle funzioni