Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7064481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:50:23+00:00 2026-05-28T04:50:23+00:00

Indexing is used to improve performance of sql query but I always found it

  • 0

Indexing is used to improve performance of sql query but I always found it little difficult to decide in which situation should I use index and in which not. I want to clarify some of my doubts regarding non-clustered index

  1. What is Non-clustered index key. As book say each index row of non clustered index contains non clustered key value so is it mean it is the column in which we created non clustered index i.e. If created index on empname varchar(50) , so non clustered key will be
    that empname .

  2. Why It is preferable to create index on column with small width. It is due to comparison with more width column takes more time for SQL server engine or is it due to it will increment hierarchy of intermediate nodes as page size is fixed so with more width column in a page or node less index row it will contain.

  3. If a table contain multiple non clustered column so whether non clustered key will be combination of all this column or some unique id is generated internally by SQL with locator which will point to actual data row. If possible please clear it will some real time example and graphs.

  4. Why It is said that column with non-repeatable value is good to create index as even if it contains repeated value it will definitely improve performance as once it reach to certain key value its locator will immediately found its actual row.

  5. If column used in indexing is not unique how it find actual data row from table.

Please refer any book or tutorial which will be useful to clear my doubts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:50:23+00:00Added an answer on May 28, 2026 at 4:50 am

    First I think we need to cover what an actual index is. Usually in RDBMS indexes are implemented using a variant of B-tree’s (B+ variant is most common). To put it shortly – think a binary search tree optimized for being stored on a disk. The result of looking up a key in the B-tree is usually the primary key of the table. That means if a lookup in the index completes and we need more data than what is present in the index we can do a seek in the table using the primary key.

    Please remember that when we think of performance for a RDBMS we usually measure this in disk accesses (I decide to ignore locking and other issues here) and not so much CPU time.

    Having the index being non-clustered means that the actual way the data in the table is stored has no relation to the index key – whereas a clustered index specifies that the data in the table will be sorted (or clustered by) the index key – this is why there can only be one clustered index per table.

    2) Back to our model of measuring performance – if the index key is has small width (fits into a low amount of bytes) it means that per block of disk data we retrieve we can fit more keys – and as such perform lookups in the B-tree much faster if you measure disk I/O.

    3) I tried explaining this further up – unfortunately I don’t really have any graphs or drawings to indicate this – hopefully someone else can come along and share these.

    4) If you’re running a query like so:

    SELECT something, something_else FROM sometable t1 WHERE akey = 'some value'
    

    On a table with an index defined like so:

    CREATE INDEX idx_sometable_akey ON sometable(akey)
    

    If sometable has alot of rows where akey is equal to ‘some value’ this means alot of lookups in both the index but also in the actual table to retrieve the values of something and something_else. Whereas if there’s a good chance that this filtering returns few rows then it also means less disk accesses.

    5) See earlier explanation

    Hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to put an update SQL command inside db-data-config.xml used for indexing
I'm looking for an open source search indexing library. It will be used for
Googlebot has been occasionally indexing one of our sites with a bad query string
I am trying to enable Full-text indexing in SQL Server 2005 Express. I am
I recently decided to port my indexing engine from sphinx to solr. Having used
I found the [] operator is sometimes confusing when it is used agains SimpleXMLElement
I have seen in many articles on Sql Server which states that when we
How can you determine if the performance gained on a SELECT by indexing a
1)Are SQL query execution times O(n) compared to the number of joins, if indexes
Has any one used SQL Server 2008 as an xml document database? what are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.