pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: David Wheeler <david@kineticode.com>
Cc: PostgreSQL Performance List <pgsql-performance@postgresql.org>
Subject: Re: Performance of DOMAINs
Date: Wed, 21 Jun 2006 14:02:43 -0500
Message-ID: <20060621190243.GE93655@pervasive.com> (raw)
In-Reply-To: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com>
References: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com>

On Wed, Jun 21, 2006 at 11:26:16AM -0700, David Wheeler wrote:
> Howdy,
> 
> Didn't see anything in the archives, so I thought I'd ask: has anyone  
> done any work to gauge the performance penalty of using DOMAINs? I'm  
> thinking of something like Elein's email DOMAIN:
> 
>   http://www.varlena.com/GeneralBits/
> 
> I figured that most simple domains that have a constraint check are  
> no faster or slower than tables with constraints that validate a  
> particular column. Is that the case?
 
Probably. Only thing that might pose a difference is if you're doing a
lot of manipulating of the domain that didn't involve table access;
presumably PostgreSQL will perform the checks every time you cast
something to a domain.

> But I'm also interested in how Elein made the email domain case- 
> insensitive, since I'd like to have/create a truly case-insensitive  
> text type (ITEXT anyone?). The functions for the operator class there  

http://gborg.postgresql.org/project/citext/projdisplay.php

> were mainly written in SQL, and if it adds a significant overhead,  
> I'm not sure it'd be a good idea to use that approach for a case- 
> insensitive text type, since I use it quite a lot in my apps, and  
> often do LIKE queries against text data. Thoughts?
> 
> Many TIA,
> 
> David
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (8+ messages)  latest in thread

Message-ID: <20060621190243.GE93655@pervasive.com>
Permalink:  ../20060621190243.GE93655@pervasive.com/
Also on:    postgresql.org/message-id/20060621190243.GE93655@pervasive.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-performance@postgresql.org
  Cc: jnasby@pervasive.com, david@kineticode.com
  Subject: Re: Performance of DOMAINs
  In-Reply-To: <20060621190243.GE93655@pervasive.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