Below query taking too much time for exectuion. The is index on Date of Birth. Is there anything more to do make it fast
SELECT * FROM Member_dtls WHERE
DATEADD(year, 10, DateOfBirth) < GETDATE()
Below query taking too much time for exectuion. The is index on Date of Birth. Is there anything more to do make it fast
SELECT * FROM Member_dtls WHERE
DATEADD(year, 10, DateOfBirth) < GETDATE()
Yes, make it SARGable (here by avoiding expression on column that is indexed):
SELECT * FROM Member_dtls
WHERE DateOfBirth < DATEADD(year, -10, GETDATE())
-- this part is "constant"