Re: Domains and subtypes, a brief proposal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Domains and subtypes, a brief proposal
Date
Msg-id 22711.1157744843@sss.pgh.pa.us
Whole thread Raw
In response to Re: Domains and subtypes, a brief proposal  (elein <elein@varlena.com>)
Responses Re: Domains and subtypes, a brief proposal  (elein <elein@varlena.com>)
List pgsql-hackers
elein <elein@varlena.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


pgsql-hackers by date:

Previous
From: elein
Date:
Subject: Re: Domains and subtypes, a brief proposal
Next
From: Martijn van Oosterhout
Date:
Subject: Re: [PATCHES] Fix linking of OpenLDAP libraries