From: Ludwig Lim <lud_nowhere_man@yahoo.com>
To: PostgreSQL Mailing List <pgsql-admin@postgresql.org>
Subject: Re: how sub queries and joins differs funcationally
Date: Sun, 26 Jan 2003 23:52:36 -0800 (PST)
Message-ID: <20030127075236.66462.qmail@web80314.mail.yahoo.com> (raw)
In-Reply-To: <001601c2c5d1$a646cdd0$1201a8c0@a4005>
Hi shreedhar :
--- shreedhar <shreedhar@lucidindia.net> wrote:
> Can any body tell that how sub queries and joins
> differs funcationally.
> Because sub queries taking lot of time than joins.
>
The following could be the probable reasons:
a) Your are using correlated queries - Correlated
queries always re-evaluate the sub-query for each row
processed.
b) You have an IN clause - try using EXISTS clause,
since it IN clause doesn't utilize the index when your
subquery is another SELECT statement.
ludwig.
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
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-sql@postgresql.org
Cc: lud_nowhere_man@yahoo.com, pgsql-admin@postgresql.org
Subject: Re: how sub queries and joins differs funcationally
In-Reply-To: <20030127075236.66462.qmail@web80314.mail.yahoo.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