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

  • SEARCH
  • Home
  • 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 508875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:57:09+00:00 2026-05-13T06:57:09+00:00

I have created script to find selectivity of each column for all tables. In

  • 0

I have created script to find selectivity of each column for all tables. In some tables with less than 100 rows, selectivity of a column is more than 50%.
Where Selectivity = Distinct Values / Total Number Rows. Are those columns eligible for an index? Or, can you tell me the minimum requirement for number of rows to create an index?

  • 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-13T06:57:10+00:00Added an answer on May 13, 2026 at 6:57 am

    You can index on any column – the question is whether it makes any sense and whether that index will be used….

    Typically, a selectivity of less than 1-5% might work – the smaller that percentage, the better. The best is single values out of a large population, e.g. a single customer ID out of hundreds of thousands – those indices will definitely be used.

    Things like gender (only 2 values) or other things that only have a very limited number of possible values typically don’t work well on an index. At least on their own – these columns might be ok to be included into another index as a second or third column.

    But really, the only way to find out whether or not an index makes sense is to

    • measure your queries before
    • create the index
    • run your queries again, check their execution plans, measure their timings

    There’s no golden rule as to when an index will be used (or ignored) – too many variables play into that decision.

    For some expert advice on how to deal with indices, and how to find out which indices might not get used, and when it makes sense to create an index, see Kimberly Tripp’s blog posts:

    • Spring cleaning your indices (part 1)
    • Spring cleaning your indices (part 2)
    • Why aren’t those non-clustered indices being used?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created script to find selectivity of each columns for every tables. In
I have created a script that saves some files in the Documents directory of
I have created an R script that it needs to load some libraries first.
I have created one ruby script that I want to run with some flags
I have created build script in search way it will place all project dependencies
I have created the SQL script below that creates four tables and inserts data
I have created a script which splits filenames into components for database inserts: find
I have created a script to make my div expandable. $('.expandable').find('h2').on('click', function(){ $(this).parent().css({height: (parseInt($(this).parent().css('height'))
Hi all I have created a jquery based multilevel nav menu, when onMouse each
Intro I have created a script that loops trough all installed applications on our

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.