pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Koczan <pjkoczan@gmail.com>
To: Ben Kim <bkim@tamu.edu>
Cc: Jessica Richard <rjessil@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: "_" in a serach  pattern
Date: Tue, 24 Jul 2007 21:29:02 -0500
Message-ID: <46A6B56E.3040405@gmail.com> (raw)
In-Reply-To: <Pine.GSO.4.64.0707240911090.5503@coe.tamu.edu>
References: <829317.804.qm@web56414.mail.re3.yahoo.com>
	<46A54962.30109@gmail.com>
	<Pine.GSO.4.64.0707240911090.5503@coe.tamu.edu>

Most database systems can figure out the size (in bytes) of a column 
rather quickly from offsets within a record. I doubt that postgres is 
any different. The only difference I can think of is that it might be 
slower to filter out trailing spaces of a char column before comparing, 
though the actual string length may be cached somewhere. Semantically, 
it should be no different. I haven't perused the source code enough to 
know for sure.

Any of the developers that patrol this list can probably answer your 
questions better, especially the question of matching or not matching 
strings of different length.

Peter

Ben Kim wrote:
>> The only difference is that varchar can have a length limit, text is 
>> always unlimited length. There's no significant performance 
>> difference between either. For most intents and purposes, they're equal.
>
> Forgive me for diversion, but out of curiosity, would it make some 
> difference whether strings of known length are compared or strings of 
> unknown length are compared, like in join condition "using(address)"?
>
> Or, is the actual length stored in a separate field and read first so 
> strings of different lengths wouldn't even need to be matched?
>
> Is there some reference on this subject other than the source code?
>
>
> Thanks.
>
> Ben K.
> Developer
> http://benix.tamu.edu
>




view thread (7+ messages)

Message-ID: <46A6B56E.3040405@gmail.com>
Permalink:  ../46A6B56E.3040405@gmail.com/
Also on:    postgresql.org/message-id/46A6B56E.3040405@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pjkoczan@gmail.com, bkim@tamu.edu, rjessil@yahoo.com
  Subject: Re: "_" in a serach  pattern
  In-Reply-To: <46A6B56E.3040405@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox