Re: Domains and subtypes, a brief proposal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: elein <elein(at)varlena(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Domains and subtypes, a brief proposal
Date: 2006-09-08 19:47:23
Message-ID: 22711.1157744843@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

elein <elein(at)varlena(dot)com> writes:
> a) if subtypes/domains can have constraints then the model should
> not be different for domains only but for all types. Constraint
> checking would only
> occur at check constraint points--and there for any type. You
> already check for the existance of a domain. Change that test
> to the existence of a constraint only and eliminate domain specific
> code.

Au contraire, the test whether a constraint actually exists occurs at
runtime, not at the time we check for domain-ness. Your proposal would
force such checks to be introduced into every single expression
evaluation. It's not feasible at all without plan invalidation, and
even with that I foresee fairly enormous added overhead. Our experience
with domains so far is that looking up those constraints is *expensive*.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-09-08 19:47:46 Re: [HACKERS] Fix linking of OpenLDAP libraries
Previous Message elein 2006-09-08 19:41:02 Re: Domains and subtypes, a brief proposal