pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: slow queries over information schema.tables
Date: Wed, 05 Dec 2018 13:41:32 -0500
Message-ID: <8843.1544035292@sss.pgh.pa.us> (raw)
In-Reply-To: <20181205182555.x4wtnzffmhwsc3c7@alap3.anarazel.de>
References: <CAFj8pRBUCX4LZ2rA2BbEkdD6NN59mgx+BLo1gO08Wod4RLtcTg@mail.gmail.com>
	<5978.1544030694@sss.pgh.pa.us>
	<20181205175657.s7mt6as356kwvrji@alap3.anarazel.de>
	<8210.1544034143@sss.pgh.pa.us>
	<20181205182555.x4wtnzffmhwsc3c7@alap3.anarazel.de>

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




view thread (21+ messages)  latest in thread

Message-ID: <8843.1544035292@sss.pgh.pa.us>
Permalink:  ../8843.1544035292@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8843.1544035292@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pavel.stehule@gmail.com
  Subject: Re: slow queries over information schema.tables
  In-Reply-To: <8843.1544035292@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox