pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedhow sub queries and joins differs funcationally
3+ messages / 2 participants
[nested] [flat]
* how sub queries and joins differs funcationally
@ 2003-01-27 06:59 shreedhar <shreedhar@lucidindia.net>
0 siblings, 2 replies; 3+ messages in thread
From: shreedhar @ 2003-01-27 06:59 UTC (permalink / raw)
To: Postgres <pgsql-admin@postgresql.org>
Can any body tell that how sub queries and joins differs funcationally.
Because sub queries taking lot of time than joins.
Regards,
Sreedhar
"Faith, faith, faith in ourselves, faith, faith in God, this is the secret
of greatness.
If you have faith in all the three hundred and thirty millions of your
mythological gods,
and in all the gods which foreigners have now and again introduced into your
midst,
and still have no faith in yourselves, there is no salvation for you. "
(III. 190)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [ADMIN] how sub queries and joins differs funcationally
@ 2003-01-27 07:36 Ludwig Lim <lud_nowhere_man@yahoo.com>
parent: shreedhar <shreedhar@lucidindia.net>
1 sibling, 0 replies; 3+ messages in thread
From: Ludwig Lim @ 2003-01-27 07:36 UTC (permalink / raw)
To: shreedhar <shreedhar@lucidindia.net>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: how sub queries and joins differs funcationally
@ 2003-01-27 07:52 Ludwig Lim <lud_nowhere_man@yahoo.com>
parent: shreedhar <shreedhar@lucidindia.net>
1 sibling, 0 replies; 3+ messages in thread
From: Ludwig Lim @ 2003-01-27 07:52 UTC (permalink / raw)
To: PostgreSQL Mailing List <pgsql-admin@postgresql.org>
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-01-27 07:52 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27 06:59 how sub queries and joins differs funcationally shreedhar <shreedhar@lucidindia.net>
2003-01-27 07:36 ` Ludwig Lim <lud_nowhere_man@yahoo.com>
2003-01-27 07:52 ` Ludwig Lim <lud_nowhere_man@yahoo.com>
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