table index

update t set f1 = 'xxx' where f1 = 'yyy';


the sql above is a little slow, which cost 11s, after analyzing, t.f1 doesn't have a index on it.
so I tried to add index to it, but it's slower, cost 22s.
after discussing with DBA, who told me the reason for slower is that if index was created on this column, this update not only do update work, but also update index data for this column.
in all, this kind of sql don't need to setup index.

你可能感兴趣的:(table)