I'm writing some code which will research for unique id's inside a table with more than 60,000 rows for those that are in a wide array using

mysql_query("SELECT * FROM users WHERE  unique_indexed_user_id IN('".join("', '", $array)."')") ;

the quantity of this array isn't restricted to the consumer so that they might finish up choosing a sizable array. thus I must limit the array

   if( count($array_limit)>$array_limit ) 
  array_splice($array, $array_limit);

however i have no clue how to determine the limit, this code has been utilized in a social networking for individuals to ask their buddies to something. therefore the bigger it's the better. however I'm not sure how large of the array mysql are designed for?

what should the need for $array_limit be?

The max period of a question passed to MySQL is the duration of your max_packet_size variable. http://lists.mysql.com/mysql/187971

Additionally you may want to take other activities into account, for example the amount of time it will require to parse and perform query with this many IDs. I have taken this method myself, also it began to honestly decelerate following a couple of 1000 IDs. You might want to consider using a JOIN, if you're able to.

The number of do you want, really?

I have tried personally something similar to 10000 products inside a query without problem (while moving data in one database to a different, not inside a live site), so that you can certainly create a horribly large query.

There's however no reason to get that lots of products when you wish to show these to a person, because nobody scrolls through a listing that large towards the finish, and getting much data would definitely decelerate the interface substantially.

You need to use some type of paging or append on request, to ensure that you simply go just like a hundred products every time.