i'm doing a select from a table with 50 million rows with 'select where in' on an indexed field(varchar(255)); the sql is like this
select Fid, Fnumber from t_word where Fnumber in (a,b,c)
where in fact (a,b,c) is a list of 500 elements
in navicat, the sql returns within 0.12s
however with pymysql 0.9.3
l = (a,b,c)
sql = 'select Fid, Fnumber from t_word where Fnumber in %s'
cursor.execute(sql, [l])
result = cursor.fetchall()
took 60 seconds. i think pymysql is not using index
did i format my sql wrong?
pymysql select in with variable number of parameters i've followed code here
my mysql version is 5.7.18-cdb20170530-log
the where field is indexed USING BTREE