Solved

Character column Index

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now