如何提高简单sql查询的性能?

时间:2018-05-24 08:07:40

标签: sql sql-server

如何提高简单sql查询的性能 请考虑下表中的字段

id, name, empId, address, contact, joiningDate, designation, location

select * from tblEmployee where location = "Amsterdam"

目前需要3秒,如何减少它。

请建议所有可能的解决方案或方法,以提高查询性能。

1 个答案:

答案 0 :(得分:1)

您可以在location列上创建索引。

CREATE INDEX ix_emp ON tblEmployee(location);
-- NONCLUSTERRED is default

-- please note that I've changed " to '
select * from tblEmployee where location = 'Amsterdam';
相关问题