Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook - max number of parameters in “IN” clause?

In Facebook query language(FQL), you can specify an IN clause, like:

SELECT uid1, uid2 FROM friend WHERE uid1 IN (1000, 1001, 1002)

Does anyone know what's the maximum number of parameters you can pass into IN?

like image 366
Gaurav Sharma Avatar asked Feb 23 '10 11:02

Gaurav Sharma


People also ask

What is the max limit for in clause in SQL?

The maximum is 2100.

How many maximum values we can provide within in clause How do you manage if it exceeds more the limit?

1) Cant we put more than 1000 values in 'in clause'.

What is the maximum number of parameters used in a stored procedure?

The maximum number of procedure parameters is 32 for input arguments and 32 for output arguments. The maximum number of variables in a stored procedure is 1,024.


2 Answers

I think the maximum result set size is 5000

like image 187
Ceilingfish Avatar answered Sep 29 '22 04:09

Ceilingfish


It may seem like an odd number (so perhaps I miss counted, but it's close ~1), but I can not seem to query more than 73 IN items. This is my query:

SELECT object_id, metric, value
FROM insights
WHERE object_id IN ( ~73 PAGE IDS HERE~ )
AND metric='page_fans'
AND end_time=end_time_date('2011-06-04')
AND period=period('lifetime')

This is using the JavaSCript FB.api() call.

like image 32
thaddeusmt Avatar answered Sep 29 '22 04:09

thaddeusmt