Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 982079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:38:25+00:00 2026-05-16T04:38:25+00:00

CREATE TABLE profile_category ( id mediumint UNSIGNED NOT NULL AUTO_INCREMENT, pc_name char(255) NOT NULL,

  • 0
CREATE TABLE profile_category (
  id mediumint UNSIGNED NOT NULL AUTO_INCREMENT,
  pc_name char(255) NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY idx_name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

This is one of the tables in database that is entirely in utf8 charset. The problem is here (and I didn’t new about it until now) that index for pc_name column will triple times bigger, because MySQL reserves 3 bites for every char. In this case indexes will take much more space.

I cannot make shorter index, because I need this value to be unique. One of the solutions could be set pc_name char(255) CHARSET latin1 NOT NULL, but I dont’t know if this is a problem or not.
Is this is a good Idea, or are there any solutions that I don’t know ?

Update: the pc_name column is validated in application to be valid utf8. And it allows non western characters. But in this case I can just make a trade of and allow only /[_A-Za-z]/ if the case is worth it.

Update 2: I tried to set pc_name to latin1 charset, but now I get exceptions like: Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:38:26+00:00Added an answer on May 16, 2026 at 4:38 am

    If pc_name is going to contain non-Western text then latin1 isn’t going to be an option here – otherwise, go for it.

    Not being a hardcore MySQL’er, I don’t know if mixing InnoDB and MySQL tables is fraught with problems – if not, perhaps you could make this table a standard MySQL table and leave it as utf8?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

create table snippet( id int not null auto_increment, primary key(id), idlanguage int not null,
Create Table: CREATE TABLE `category` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255)
create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't
CREATE TABLE `tbl_atn` ( `atn_id` int(15) NOT NULL AUTO_INCREMENT, `eng_id` int(15) DEFAULT NULL, `visit`
CREATE TABLE Posts { id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(200), url VARCHAR(200) }
This is my SQL Script CREATE TABLE account_profile ( accnt_id int NOT NULL ,
CREATE TABLE SupplierQuote ( supplierQuoteID int identity (3504,2) CONSTRAINT supquoteid_pk PRIMARY KEY, PONumber int
Given the following table structure: CREATE TABLE user ( uid INT(11) auto_increment, name VARCHAR(200),
I have this table CREATE TABLE IF NOT EXISTS `profile_connections` ( `id` int(11) NOT
CREATE TABLE #TEMPTABLE ( requestTime datetime2, NoOfSessions integer ) INSERT INTO #TEMPTABLE select convert(nvarchar(16),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.