Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 142
TSQL 76
SSRS 70
SSIS 66
XML 54

Top Categories · View All
SQL Server 142
TSQL 76
SSRS 70
SSIS 66
XML 54

Sql Server Index used

Feb 8 2012 12:00AM by Santosh Srivastava   

TABLE NAME - CUSTOMER
   FIELD NAME ( CUST_CODE, CUST_NAME, CUST_CITY, CUST_ADDRESS)
INDEX i1 - CUST_CODE
INDEX i2 - CUST_CODE, CUST_CITY

SELECT 
    CUST_CODE,
    CUST_NAME, 
    CUST_CITY 
FROM CUSTOMER WHERE CUST_CODE = ??

In above sql query which index are used index i1 or index i2

how can identified which index are used index i1 or index i2 ?

Submitted under: Microsoft SQL Server · DBA · TSQL · Indexes · 


Santosh Srivastava
586 · 0% · 61

2 Replies

  • Index1 will be used. Have a look at execution plan to know more details

    commented on Feb 15 2012 1:15AM
    Madhivanan
    3 · 39% · 12472
  • As Madhivanan mentioned, the only way to figure out details of indexes being used is by looking into the execution plan. The query optimizer may not pick an index that we believe it could use in a number of scenarios. A number of factors such as the selectivity of the condition, status of statistics, included columns available with the indexes etc will influence the choice of indexes.

    if the table is really small, the query processor may decide to use a table scan always, instead of using an available index.

    So execution plan is our best friend to figure out the details of how exactly the query processor executes our queries.

    commented on Aug 15 2012 6:06AM
    Jacob Sebastian
    1 · 100% · 32004

Your Reply


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]