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

  • SEARCH
  • Home
  • 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 7034379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:10:43+00:00 2026-05-28T01:10:43+00:00

I know questions with this title have been answered before, but please do read

  • 0

I know questions with this title have been answered before, but please do read on. I’ve read thoroughly all the other questions/answers on this error before posting.

I am getting the above error for the following query:

CREATE TABLE IF NOT EXISTS `pds_core_menu_items` (
  `menu_id` varchar(32) NOT NULL,
  `parent_menu_id` int(32) unsigned DEFAULT NULL,
  `menu_name` varchar(255) DEFAULT NULL,
  `menu_link` varchar(255) DEFAULT NULL,
  `plugin` varchar(255) DEFAULT NULL,
  `menu_type` int(1) DEFAULT NULL,
  `extend` varchar(255) DEFAULT NULL,
  `new_window` int(1) DEFAULT NULL,
  `rank` int(100) DEFAULT NULL,
  `hide` int(1) DEFAULT NULL,
  `template_id` int(32) unsigned DEFAULT NULL,
  `alias` varchar(255) DEFAULT NULL,
  `layout` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`menu_id`),
  KEY `index` (`parent_menu_id`,`menu_link`,`plugin`,`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Does anyone have idea why and how to fix it?
The catch is – this same query works perfectly on my local machine, and worked as well on my previous host. Btw.it’s from a mature project – phpdevshell – so I’d guess these guys know what they are doing, although you never know.

Any clue appreciated.

I’m using phpMyAdmin.

  • 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-28T01:10:44+00:00Added an answer on May 28, 2026 at 1:10 am

    As @Devart says, the total length of your index is too long.

    The short answer is that you shouldn’t be indexing such long VARCHAR columns anyway, because the index will be very bulky and inefficient.

    The best practice is to use prefix indexes so you’re only indexing a left substring of the data. Most of your data will be a lot shorter than 255 characters anyway.

    You can declare a prefix length per column as you define the index. For example:

    ...
    KEY `index` (`parent_menu_id`,`menu_link`(50),`plugin`(50),`alias`(50))
    ...
    

    But what’s the best prefix length for a given column? Here’s a method to find out:

    SELECT
     ROUND(SUM(LENGTH(`menu_link`)<10)*100/COUNT(`menu_link`),2) AS pct_length_10,
     ROUND(SUM(LENGTH(`menu_link`)<20)*100/COUNT(`menu_link`),2) AS pct_length_20,
     ROUND(SUM(LENGTH(`menu_link`)<50)*100/COUNT(`menu_link`),2) AS pct_length_50,
     ROUND(SUM(LENGTH(`menu_link`)<100)*100/COUNT(`menu_link`),2) AS pct_length_100
    FROM `pds_core_menu_items`;
    

    It tells you the proportion of rows that have no more than a given string length in the menu_link column. You might see output like this:

    +---------------+---------------+---------------+----------------+
    | pct_length_10 | pct_length_20 | pct_length_50 | pct_length_100 |
    +---------------+---------------+---------------+----------------+
    |         21.78 |         80.20 |        100.00 |         100.00 |
    +---------------+---------------+---------------+----------------+
    

    This tells you that 80% of your strings are less than 20 characters, and all of your strings are less than 50 characters. So there’s no need to index more than a prefix length of 50, and certainly no need to index the full length of 255 characters.

    PS: The INT(1) and INT(32) data types indicates another misunderstanding about MySQL. The numeric argument has no effect related to storage or the range of values allowed for the column. INT is always 4 bytes, and it always allows values from -2147483648 to 2147483647. The numeric argument is about padding values during display, which has no effect unless you use the ZEROFILL option.

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

Sidebar

Related Questions

I know questions of this kind have been asked before, but my situation differs
I know this must have been answered before here, but I simply can't find
I know similar questions have been asked and answered before but the truth is
I know there have been some similar questions to this, but they haven't helped
I know this kind of questions have been asked already many times before. The
Hey all, I know this question has been asked a million times before but
I know there have been a couple questions asked similar to this, but I
I know this questions has come up in various guises before, but this is
I know this one is the weirdest of all weird questions I have asked
I know this is very similar to a few other questions, but I can't

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.