Solved

Character column Index

Posted on 2002-06-14
2
519 Views
Last Modified: 2013-12-03
Hello experts!!!!

Can anyone tell me if an index applied to a character column is slower than other applied to a numeric column?

Thanks.
0
Comment
Question by:dbroosv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Expert Comment

by:yoren
ID: 7079756
For most applications, no. Yes, character comparisons are generally slower than integer comparisons, but other factors such as how your tables are designed and the options you use to create the index will affect performance far more.

Basically, if you have numeric data, put it into a number column. If you have character data, put it into a character column.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 7080288
character column -> index performance

The index performance depends on the size of the column, not on the datatype as such. Of course, a column with 1 caracter will be as performant as a numerical column on 1 byte, because they will have as many index entries in one data page. If you have a column on 2 caracters, only half of the index entries will be on 1 page, thus the index will need 2x the index pages. For the index search this can mean max 1 index page more to read, depending on the implementation, and this index page read can be the performance loss.

CHeers
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question