Re: Unused table of view

Поиск
Список
Период
Сортировка
От Laurent Martelli
Тема Re: Unused table of view
Дата
Msg-id 87u0xpu8vq.fsf@stan.aopsys.com
обсуждение исходный текст
Ответ на Re: Unused table of view  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
>>>>> "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


В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unused table of view
Следующее
От: Steve Wampler
Дата:
Сообщение: Using a COPY...FROM through JDBC?