Solved

Character column Index

Posted on 2002-06-14
2
526 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

710 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