Hello All,
CREATE TABLE [dbo].[DataStore](
[ID] [bigint] NOT NULL,
[ParentId] [bigint] NOT NULL,
[TimeStampUTC] [decimal](20, 8) NOT NULL,
[TimeStampLocal] [decimal](20, 8) NULL,
[Col1] [int] NULL,
[Col2] [int] NULL,
[Col3] [int] NULL,
)
ON [PRIMARY]
GO
Query 1:
SELECT * FROM DataStore WHERE ParentId IN (1) AND TimeStampUTC between 0 and 1400000000
Query 2:
SELECT * FROM DataStore WHERE ParentId IN (1) AND TimeStampLocal between 0 and 1400000000
I have added Clustered unique key on ParentId and TimeStampUTC
Query 1 it works fine but
Query 2 takes more time.
Please Advise.
vinaya kumar
...
Go to the complete details ...