MySQL Query IN() Clause Slow on Indexed Column

前端 未结 5 460
自闭症患者
自闭症患者 2020-12-03 01:18

I Have a MySQL query that is being generated by a PHP script, the query will look something like this:

SELECT * FROM Recipe_Data WHERE 404_Without_200 = 0 A         


        
5条回答
  •  时光说笑
    2020-12-03 02:08

    For someone like me using SQlAlchemy, using for-loop is also a good option:

    rows=[]
    
    for id in ids:
      row = cls.query.filter(cls.id==id).first()
      if row:
         rows.append(row)
    
    #return rows
    

提交回复
热议问题