在Mysql数据库表中,哪个搜索更快?
1-在字符串列中搜索 2-在数字行中搜索
1-示例数据
column_string include <long string> <type: text>:
sdf,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,qwe,rt,45dg,sf,34wer,we3,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,sdf,sd,w,sdf,sg,fg,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,qwe,rt,45dg,sf,34wer,we3,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,sdf,sd,w,sdf,sg,fg,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,iopiop,rt,45dg,sf,34wer,we3,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,ioipi,sd,w,sdf,sg,fg,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,qwe,rt,45dg,sf,34wer,asdfsdf,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,sdf,sd,w,sdf,sg,fg,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,qwe,rt,45dg,sf,34wer,we3,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,sdf,sd,w,sdf,sg,fg,sdfa,sdfaf,sfdsdf,sdfsg,sfdfg,sdfe,qwer,qwe,rt,45dg,sf,34wer,we3,q3e,sdf,wersg,sg,sfgef,e,f,w,s,w,sdf,sd,w,sdf,sg,fg,.....
2-示例数据
tbl row 1 --> id: 1
tbl row 2 --> id: 2
.
.
tbl row 95100984612346 --> id: 95100984612346
1-示例查询:
select column_string(type=text) from tbl where column_string.include("mystring")
2-示例查询:
select id from tbl where id == 25100984612346
哪种搜索更快?
答案 0 :(得分:1)
会更快。