MySQL Forums
Forum List  »  Newbie

Re: mysql search performance
Posted by: Rick James
Date: October 30, 2009 08:10PM

If it is a US-centric zip-5, then there is not much difference in index performance between using CHAR(5) and MEDIUMINT -- 5 bytes vs 3 bytes.

If you want International postal codes, VARCHAR(6) (at least) is necessary. If you are using a mixture zip-5 and zip-9, then converting to INT (and back) would be clumsy.

I recommend a VARCHAR of sufficient length and not worry about the minor diff in performance.

Is this MyISAM or InnoDB? SHOW CREATE TABLE -- there could be other issues with zip as a secondary key.

Options: ReplyQuote


Subject
Written By
Posted
October 29, 2009 08:09PM
October 30, 2009 03:00AM
November 01, 2009 12:57AM
November 01, 2009 11:18AM
Re: mysql search performance
October 30, 2009 08:10PM
October 31, 2009 09:22PM
October 31, 2009 10:55PM


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.