X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9B05E9F9CC1 for ; Wed, 21 Jun 2006 16:02:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 37673-01 for ; Wed, 21 Jun 2006 16:02:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 2CD179FB1C0 for ; Wed, 21 Jun 2006 16:02:45 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 747F756458; Wed, 21 Jun 2006 14:02:43 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 21 Jun 2006 14:02:43 -0500 Date: Wed, 21 Jun 2006 14:02:43 -0500 From: "Jim C. Nasby" To: David Wheeler Cc: PostgreSQL Performance List Subject: Re: Performance of DOMAINs Message-ID: <20060621190243.GE93655@pervasive.com> References: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060621:david@kineticode.com::5cht1hqIp0jupcJt:00000000000000000 00000000000000000000000001a0 X-Hashcash: 1:20:060621:pgsql-performance@postgresql.org::Moqa9k8SognTMDI2:00000 0000000000000000000000000nJe X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/415 X-Sequence-Number: 19772 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