From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Julian Scarfe <jscarfe(at)callnetuk(dot)com> |
Cc: | PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] Simulating an outer join |
Date: | 2000-01-13 13:06:37 |
Message-ID: | 200001131306.IAA24854@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> Bruce Momjian wrote:
>
> > I am just writing the EXISTS section from my book. I don't think it
> > matters what fields are returned from an EXISTS subquery. If I am
> > wrong, someone please let me know.
>
> Celko also writes (in his chapter on EXISTS in "SQL for Smarties"):
>
> "In general the SELECT * option should perform better than the actual column.
> It lets the query optimizer decide which column to use. If a column has an
> index on it, then simply seeing a pointer to the index is enough to determine
> that something exists."
>
> Obviously you're in a much better position than me to judge whether that's the
> case in pgsql! But it might be worth a test.
In psql, I think * would generate all the columns, then throw it away,
while a specific column would only carry around that column in the
subquery result. so a single column is better.
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | admin | 2000-01-13 13:38:45 | searching oid's |
Previous Message | Chana Slutzkin | 2000-01-13 11:21:58 |