hey, can i hijack my message back?...this thread is about the performance of
subselects, not stored procedures. go write your own message :-)...

so....the original question is if someone would be nice enough to answer..

====> Do any MySql coders writing subselects in 4.1 know whether EXISTS will
outperform an equivalent query written as a join. <=====

Typically, db vendors recommend you use an exists clause, not a join when
testing for the presence of child data because it's faster.

e.g.

4.1 version  (faster?)
---------------------
select person.person_id, person.name from person where exists ( select 1
from invoice where invoice.paid is null and invoice.person_id =
person.person_id)

vs

4.0 version (slower?)
----------------------
select DISTINCT person.person_id, person.person_name from person, invoice
where person.person_id = invoice.person_id and invoice.paid is null


Thanks,
Greg.

----- Original Message -----
From: "Dan Rossi" <[EMAIL PROTECTED]>
To: "Victoria Reznichenko" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, November 11, 2002 11:04 PM
Subject: RE: RE: MySql 4.1 Sub Selects


> damn , i read it was 4.1 i guess we have to wait a bit then, i wish i
could
> program some c ++ to hurry it along a bit, i dont really have access to
DB's
> like oracle to learn stored procedure stuff
>
> -----Original Message-----
> From: Victoria Reznichenko [mailto:victoria.reznichenko@;ensita.net]
> Sent: Monday, November 11, 2002 11:00 PM
> To: [EMAIL PROTECTED]
> Subject: re: RE: MySql 4.1 Sub Selects
>
>
> daniel,
> Monday, November 11, 2002, 3:51:25 AM, you wrote:
>
> d> will 4.1 hopefully have stored procedure functionality ?
>
> Nope.
> Stored procedures will be implemented around v5.0
>
>
> --
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.net http://www.ensita.net/
>    __  ___     ___ ____  __
>   /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
>        <___/   www.mysql.com
>
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to