1345RE: 1344MYSQL IN clause is expensive?

Thursday, December 10, 2009

yes it is, it is better to do a left join on the table and exclude in the where clause where one of the fields is not null

> Date: Wed, 9 Dec 2009 23:20:19 -0800
> Subject: 1344MYSQL IN clause is expensive?
> From: natarajanonline@gmail.com
> To: it_help_desk@googlegroups.com
>
> Hi,
>
> I would like to use SELECT * from users where userid IN(SELECT userid
> from user_book where availability=1)
>
> In the above subquery, it can return 1000 of records. Whether this
> operation is expensive?
>
> Dot Net, VB.NET, C#, ADO.Net, ASP.NET, XML, WML, Ajax, SAP, Ruby, Java, SAP, WAP, WML, PHP, MYSQL, ASP, SQL, HTML, DHTML CSS, Flash, Flex, IT Jobs , Freelancer Projects & many more
>
> Read more.. http://groups.google.com/group/it_help_desk


Windows Live Hotmail gives you a free,exclusive gift. Click here to download.

0 comments

Post a Comment