MySQL Forums
Forum List  »  Performance

Re: Column Type and Performance
Posted by: KimSeong Loh
Date: March 30, 2005 07:20PM

Maybe you should take a look at the size of the columns rather than the column type, also how the comparison can be done.

I guess there should not be any significant difference between char(1) and tinyint, both requires 1 byte storage and any 2 values can be compare in a single operation.

There is likely to be some difference with mediumint and char(20), mediumint is 3 bytes and char(20) is 20 bytes. For the char(20), the index tree will be larger, needs more disk reads and buffer space to cache. Also comparing 2 strings will likely to take more operations than comparing 2 integer values.

By the way, you should choose the column types based on your data requirements, indexing usually depends to the need in your queries.

Options: ReplyQuote


Subject
Views
Written By
Posted
2510
March 30, 2005 02:00AM
Re: Column Type and Performance
1745
March 30, 2005 07:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.