Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

creating NON CLUSTERED INDEX on table Expand / Collapse
Author
Message
Posted Saturday, June 9, 2012 1:45 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 24, 2014 10:50 AM
Points: 17, Visits: 95
Hi ,

I have "INDEX" table with the below columns and having 100 millions of records.

indexid varchar(50) -- this is alphanumeric data that is the reason i have used varchar
indextype varchar(50)
insertdate datetime

with NON CLUSTERED INDEX on insertdate column

when i run the below query it is taking to much time to return the result.

select * from INDEX where indexid='xxxxxxxxxxxx' and indextype='xxxxxxxxx'

here my question is Can i create NON CLUSTERED INDEX on both indexid and indextype columns to improve the performance of the query.
Note: both indexid and indextype columns may have duplicate data.

should i create individual NON CLUSTERED INDEX on each column or should i create single composite NON CLUSTERED INDEX on both columns

please help me on this. Thanks in advance
Post #1313536
Posted Saturday, June 9, 2012 3:14 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 6:28 AM
Points: 42,468, Visits: 35,538
http://sqlinthewild.co.za/index.php/2010/09/14/one-wide-index-or-multiple-narrow-indexes/


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1313540
Posted Saturday, June 9, 2012 9:42 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 24, 2014 10:50 AM
Points: 17, Visits: 95
Thanks for your reply
Post #1313560
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse