- Is there any limit to the number of value in the IN condition?
this
$query->where([
'id' => [4, 8, 15],
]);
and this
['in', 'id', [1, 2, 3]]
- Is it ok to has thousands of value in any of those IN condition?
this
$query->where([
'id' => [4, 8, 15],
]);
and this
['in', 'id', [1, 2, 3]]
Not from Yii side. It depends on which storage engine you’re using. For example, in MySQL it’s limited by max_allowed_packet which is 4MB by default.
Again, it depends.