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

Non cluster index help required (3 questions) : SSMS 2008R2 Expand / Collapse
Author
Message
Posted Thursday, June 20, 2013 12:31 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, August 4, 2014 9:44 AM
Points: 29, Visits: 176
Hi Friends,

I have table

(Table_A (A_id int(PK),
col1 nvarchar,
col2 nvarchar,
col3 nvarchar,
col4 nvarchar,
col5 nvarcar
Col6 nvarchar))

A_id int(PK),--- already have one clusterd index on this column as this is PK


I hav only ONE non clustered index on col1, col2 and col3 and i have below query

SELECT col4, COl5, col6
FROM Table_A a INNER JOIN Some_Table_B b
ON a.a_id = b.b_some_id
WHERE a. col1 = 'Some value' AND a.col2 = 'some Value' and a.col3 = 'SOme value'

**Question 1**

do i need more NON Clustered index on this table so that, this query will perform well(as SELECT statement has more columns which dont have any indexex, ).


**Question 2**

if i put the non clusterd index on the columns which are only considerd for displaying the result set
(example, here col4, COl5, col6 with SELECT only, these columns are not utilised in WHERE or JOIN clause ) WIll this improve performance of the query

**Question 3**

Another question (as as i have mentined earlier NON clustred index is on col1, col2 and col3 )

if my WHERE clause hav only col_1 and col_2 ,
Example
SELECT col4, COl5, col6
FROM Table_A a INNER JOIN Some_Table_B
ON a.a_id = b.b_some_id
WHERE a. col1 = 'Some value' AND a.col2 = 'some Value' --- no column3 ok

will this non cluster index help or do i need to create another index only with these two columns.

Please do the needful.

**Thanks in Advance
Parixitsinh**
Post #1465470
Posted Thursday, June 20, 2013 1:01 AM


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 @ 12:33 PM
Points: 42,818, Visits: 35,943
Please don't cross post. It just wastes people's time and fragments replies.

No replies to this thread please. Direct replies to http://www.sqlservercentral.com/Forums/Topic1465465-392-1.aspx



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 #1465479
Posted Thursday, June 20, 2013 2:16 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, August 4, 2014 9:44 AM
Points: 29, Visits: 176
Sorry Sir,
actually i found Performence forum after posting it here.

Thanks for your patient with me.
Post #1465504
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse