Solved

Character column Index

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
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…

630 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