List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 19 1999 5:11pm
Subject:Performance impact of using varchar vs bigint
View as plain text  
>>>>> "Rick" == Rick Moore <lrmoore@stripped> writes:

Rick> Hello, everyone!
Rick> Question:

Rick> I'm at a point where I can use either char or bigint for a particular column. 
> This column will be an index which will be searched extensively.  They are both fixed
> length which the manual recomends for maximum performance.

Rick> I understand the space penalty, but is there a significant performance penalty
> for using char over bigint?  Does MySQL create hash values from char() indicies (which I
> suspect would make performance very close)?

Rick> Rick

Hi!

No, MySQL will not create a HASH on the char() (This would make the
index impossible to use for >=, >, < and <= queries)
MySQL will however compress the CHAR() key so that index shouldn't be
that much bigger than wih BIGINT, but BIGINT should be faster.

The easy way ís to test it yourself;  Just take the insert-test
benchmark and modify it to suite our needs.

Regards,
Monty
Thread
Performance impact of using varchar vs bigintRick Moore19 Sep
  • Performance impact of using varchar vs bigintMichael Widenius19 Sep