>>>>> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:

  Tom> Laurent Martelli <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]                                Java Aspect Components
http://www.aopsys.com/                          http://jac.objectweb.org

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to