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

Re: How are null's stored?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>,Ryan <pgsql-performance(at)seahat(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How are null's stored?
Date: 2003-05-12 23:50:24
Message-ID: 24826.1052783424@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> All in all, I'm not sure what the semantic differences between a varchar
> with no length specified and a text are in PostgreSQL actually and if the
> whole thing could be simplified in some way that doesn't break backwards
> compatibility.

Yeah, I've been wondering about that too.  A large part of the problem
is that varchar has its own set of operators, which the planner has no
right to assume behave exactly like the text ones ... but they do.  It
might work to rip out the redundant varchar operators and allow indexes
on varchar to become truly textual indexes (ie, they'd be text_ops not
varchar_ops opclass).  There might be a few tweaks needed to get the
planner to play nice with indexes that require implicit coercions, but
I think it could be made to work.

Another idea that has been rattling around is to stop treating bpchar as
binary-equivalent to text, and in fact to make bpchar-to-text promotion
go through rtrim() to eliminate padding spaces.

I think this stuff got put on hold because we haven't been able to come
up with a good solution for the comparable problems in the numeric
datatype hierarchy.  But bpchar/varchar/text is a lot simpler problem,
and maybe could be solved with the tools we have in place already.

			regards, tom lane


In response to

Responses

pgsql-performance by date

Next:From: csajlDate: 2003-05-12 23:51:00
Subject: partial index / funxtional idx or bad sql?
Previous:From: Stephan SzaboDate: 2003-05-12 23:19:25
Subject: Re: How are null's stored?

pgsql-hackers by date

Next:From: Joseph ShraibmanDate: 2003-05-13 01:47:00
Subject: Re: fomatting an interval (resend)
Previous:From: Christopher BrowneDate: 2003-05-12 23:29:46
Subject: Re: Scheduled jobs

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