Dear all,
My SQL DB size is 150 GB.
I am fetching record from a simple query but its execution takes too much time (Approx. 1 Min)
My Query is:
SELECT * FROM DELIVERY WHERE EMAILId='[email protected]'
(Note: EmailID is not primary key or clustered index or non clustered index).
Please guide me so that i can improve the query performance.
Loading


Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 20, 2014, 6:51 PM EST
create non cluster index column those are used in where clause or join.
hope this will help you.
rakesh chaudhari57 reputationPosted Jan 20, 2014, 5:41 PM EST
write query as
replace field name on *
SELECT fieldname FROM DELIVERY WHERE EMAILId='[email protected]'
retrive that values which are you needed so if write this kind of query then get much faster data fetching
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Jan 20, 2014, 9:55 PM EST
CREATE NONCLUSTERED INDEX [IX_DeliveryEmailID] ON [dbo].Delivery
(
[EmailID] ASC
)
set Nocount On
Select coulmn1,column2 from Delivery(nolock) where Emailid='[email protected]'
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Jan 21, 2014, 7:07 AM EST
Problem has been resolved by adding non clustered index