Re: Performance of DOMAINs - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance of DOMAINs
Date
Msg-id 15919.1150920496@sss.pgh.pa.us
Whole thread Raw
In response to Performance of DOMAINs  (David Wheeler <david@kineticode.com>)
Responses Re: Performance of DOMAINs  (David Wheeler <david@kineticode.com>)
List pgsql-performance
David Wheeler <david@kineticode.com> 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

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Big array speed issues
Next
From: "Alex Turner"
Date:
Subject: Quick question about top...