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 40EC19FB1BC for ; Wed, 21 Jun 2006 17:08:31 -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 40443-10 for ; Wed, 21 Jun 2006 17:08:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B89C89FA65C for ; Wed, 21 Jun 2006 17:08:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5LK8Ggi015920; Wed, 21 Jun 2006 16:08:16 -0400 (EDT) To: David Wheeler cc: PostgreSQL Performance List Subject: Re: Performance of DOMAINs In-reply-to: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com> References: <54D833BE-A58F-47B8-B070-2AEDC0802468@kineticode.com> Comments: In-reply-to David Wheeler message dated "Wed, 21 Jun 2006 11:26:16 -0700" Date: Wed, 21 Jun 2006 16:08:16 -0400 Message-ID: <15919.1150920496@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/420 X-Sequence-Number: 19777 David Wheeler writes: > 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? There are some reports in the archives of particular usage patterns where they pretty much suck, because GetDomainConstraints() searches pg_constraint every time it's called. We do what we can to avoid calling that multiple times per query, but for something like a simple INSERT ... VALUES into a domain column, the setup overhead is still bad. I've been intending to try to fix things so that the search result can be cached by typcache.c, but not gotten round to it. (The hard part, if anyone wants to tackle it, is figuring out a way to clear the cache entry when needed.) regards, tom lane