答案 0 :(得分:4)
这取决于所使用的数据库系统和表的大小(行数)。
如果表足够小并且您正在使用MSSQL,例如a table scan will be used(整个表将被读入内存)并且索引将相对无用。
一般来说,是 - 字段should be indexed if that is the column you'll be using to select or sort data。
答案 1 :(得分:1)
作为一般规则,我考虑索引出现在常用查询的$result -> array(1) {
[1] =>
string(26) "secondset=blue;yellow;red;"
}
$resultString -> string(26) "secondset=blue;yellow;red;"
或WHERE
子句中的列。