MySQL Forums :: Character Sets, Collation, Unicode :: <char dimension with charset UTF8>


Advanced Search

<char dimension with charset UTF8>
Posted by: max power ()
Date: November 27, 2010 03:31PM

Hi everybody,
1) I was wondering if I'd better performance in using a char instead of a tinyint, needing just to rappresent a number from 1 to 3 (or better 3 values),
Had I?

CREATE TABLE 'user'
( 'level' int );

CREATE TABLE 'user'
( 'level' char(1) );

2) I'm using the UTF-8 charset in my web pages and mysql, but while a char means 1 byte, an UTF8 char mean 3 (soon 4) bytes: is it right?
So when I use a char in my table with the UTF8 charset, mysql is occupying 3-4 bytes? Is it right?

Thanks for your replies :)



Edited 2 time(s). Last edit at 11/27/2010 03:43PM by max power.

Options: ReplyQuote


Subject Views Written By Posted
<char dimension with charset UTF8> 3026 max power 11/27/2010 03:31PM
Re: <char dimension with charset UTF8> 1051 Rick James 11/28/2010 07:06PM
Re: <char dimension with charset UTF8> 1078 max power 11/29/2010 05:46AM
Re: <char dimension with charset UTF8> 1067 Rick James 11/29/2010 09:07AM
Re: <char dimension with charset UTF8> 999 max power 11/29/2010 10:03AM


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.