I have a customer table in sql server 2005 with 6588395 records, I need to retreive records from customer table based on creation date. I have created clustered index on creation date. Through linked server , I am retrieving the records from this table. The query I have used is
@StartDate=N'01 Jan 2016',@EndDate=N'31 Mar 2016'
select
firstname,
lastname,
Address,
Addrss1,
city
from
[ABC\SQCENTRE].[Reports].[dbo].[tbl_Customer]
where
creation_date BETWEEN @startdate AND @EndDate
This query is taking 30 minutes to retrieve the records. Can you advise how to optimise the query.
I have tried openquery also, that also did not makes any difference. Creation_date is a datetime field
Any help appreciated.