Efficiency question: VARCHAR with empty string vs NULL - Mailing list pgsql-general

From Doug Fields
Subject Efficiency question: VARCHAR with empty string vs NULL
Date
Msg-id 5.1.0.14.2.20020524131720.02c09fa0@mail.pexicom.com
Whole thread Raw
In response to Re: MacOS X Shared Buffers (SHMMAX)?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Efficiency question: VARCHAR with empty string vs NULL
List pgsql-general
Hello,

I have a table with about 15-20 VARCHAR items. I use VARCHAR on the
assumption that it is more space efficient and not too much slower than
CHAR, especially when you expect many of those VARCHAR to be null or empty
strings.

Is there a performance difference with VARCHAR elements of value NULL and
zero-length string? If so, can I assume that NULL is the better performer,
and thus re-code my INSERTS to replace empty strings with NULLs (or vice
versa)?

Now that I've had to re-write all my data to substring it to fit in the
VARCHARs, one more "thing" won't matter much.

Many Thanks,

Doug


pgsql-general by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: Case Insensitive Data Type
Next
From: "Russell Black"
Date:
Subject: Re: Case Insensitive Data Type