[lug] OT - MySQL IN() limit

Jason Vallery jason at vallery.net
Fri Sep 4 16:08:41 MDT 2009


You might want to consider a UNION instead of an IN if you have a large
number of parameters.  The IN clause is very expensive computationally so
your query will probably be poorly performing.

As to your original question, I've never experienced the upper limit.  I
typically hit the upper limit of the max_allowed_packet size much earlier
than I do any hard query limits.

-JV



On Fri, Sep 4, 2009 at 3:31 PM, John Starkey <jstarkey at breezedev.com> wrote:

> Does anyone know the limit for the mysql IN() function? How many
> integers it would allow before croaking?
>
> TIA,
>
> John
>
> --
> -----------------
> John Starkey
> 720-227-0516
> I just know I'm a better manager when I have Joe DiMaggio in center field.
> --Casey Stengel
> -----------------
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#hackingsociety
>



-- 
Jason Vallery
jason at vallery.net

mobile: +1.720.352.8822
home: +1.303.993.3712
web: http://vallery.net/
twitter: jvallery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20090904/4aa1bdcc/attachment.html>


More information about the LUG mailing list