From: Laurent Martelli <laurent@aopsys.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Unused table of view
Date: Sat, 05 Jun 2004 21:01:29 +0200
Message-ID: <87u0xpu8vq.fsf@stan.aopsys.com> (raw)
In-Reply-To: <24845.1086456990@sss.pgh.pa.us>
References: <87y8n2t6jd.fsf@stan.aopsys.com>
<24845.1086456990@sss.pgh.pa.us>
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> Laurent Martelli <laurent@aopsys.com> writes:
>> The pictures table is scanned, but it's not needed.
Tom> Yes it is. For example, if pictures is empty then the view
Tom> yields zero rows. Omitting the join to pictures could give a
Tom> different result.
Since Permission is like this:
CREATE TABLE permissions (
GroupID integer NOT NULL REFERENCES groups ON DELETE cascade,
PictureID integer NOT NULL REFERENCES pictures ON DELETE cascade,
UNIQUE (GroupID, PictureID));
if the pictures table is empty, so is permissions, because
permissions.PictureID references pictures.
--
Laurent Martelli
laurent@aopsys.com Java Aspect Components
http://www.aopsys.com/http://jac.objectweb.org
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-performance@postgresql.org
Cc: laurent@aopsys.com, tgl@sss.pgh.pa.us
Subject: Re: Unused table of view
In-Reply-To: <87u0xpu8vq.fsf@stan.aopsys.com>
* 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