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 a script that appends some rows to a table. One of the
I have created a PHP-script to update a web server that is live inside
I have a page which is largely created by DOM script, which generates a
I'm using SQL*Plus 9.2 on Oracle 10g enterprise. I have created some scripts that
I have a column with a DEFAULT constraint. I'd like to create a script
I have a bash script that creates a Subversion patch file for the current
I have written a CGI script that creates an image dynamically using GET data.
I have a migration that runs an SQL script to create a new Postgres
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I have a simple PowerShell script that uses WMI to create a web site

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.