How many values in an “in” clause is too many in a SQL query?

前端 未结 4 1353
挽巷
挽巷 2021-02-12 19:14

I have a SQL query that uses the values of an array in its WHERE clause:

 $ids = array 
         ( 
           [0] => 1 
           [1] => 2 
           [2         


        
4条回答
  •  余生分开走
    2021-02-12 19:49

    The more values you put into IN, the slower it will run, obviously.

    "how many is too many" is a function of many factors. For example, your dataset size. Or how the rest of your query looks like.

提交回复
热议问题