Re: slow queries over information schema.tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: slow queries over information schema.tables
Date
Msg-id 8843.1544035292@sss.pgh.pa.us
Whole thread Raw
In response to Re: slow queries over information schema.tables  (Andres Freund <andres@anarazel.de>)
Responses Re: slow queries over information schema.tables
Re: slow queries over information schema.tables
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2018-12-05 13:22:23 -0500, Tom Lane wrote:
>> Not following what you have in mind here?  My 0002 throws away the
>> CoerceToDomain if there are *no* constraints, but I can't see any
>> situation in which we'd likely be able to ignore a constraint,
>> simple or not.

> Yea, simple probably means nonexistant for now. We could e.g. optimize
> some NOT NULL checks away, but it's probably not worth it.

Ah, yes, that is a case where we might have enough knowledge to prove
the test redundant --- but considering that we explicitly discourage
domain NOT NULL as bad style and not fully supported, I can't get
excited about it.  I suppose in some cases we might be able to use
predtest.c to prove domain CHECK constraints redundant, but I bet that
it's not worth the trouble.

The bigger picture here is that people seem to like to use domains
as simple type aliases, which will never have any constraints, but
we're very dumb about that today.  So the patch as presented seems
like it has lots of potential applicability, as long as we fix the
invalidation aspect.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql pragma statement
Next
From: Andres Freund
Date:
Subject: Re: slow queries over information schema.tables