Wordpress LScache Plugin: Index column size too large
Last Updated on: Wed, 15 Apr 2026 00:00:02 Recently I discovered the following error on my installation. It is log regularly and startet approximately late January. Any idea how to fix it? [08-Mar-2018 06:58:13 UTC] WordPress-Datenbank-Fehler Index column size too large. The maximum column size is 767 bytes. f?r Abfrage CREATE TABLE IF NOT EXISTS wp_litespeed_img_optm ( id int(11) unsigned NOT NULL AUTO_INCREMENT, post_id bigint(20) unsigned NOT NULL DEFAULT 0, optm_status varchar(255) NOT NULL DEFAULT , src varchar(1000) NOT NULL DEFAULT , srcpath_md5 varchar(128) NOT NULL DEFAULT , src_md5 varchar(128) NOT NULL DEFAULT , server varchar(255) NOT NULL DEFAULT , root_id int(11) NOT NULL DEFAULT 0, src_filesize int(11) NOT NULL DEFAULT 0, target_filesize int(11) NOT NULL DEFAULT 0, target_saved int(11) NOT NULL DEFAULT 0, webp_filesize int(11) NOT NULL DEFAULT 0, webp_saved int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY post_id_2 (post_id,srcpath_md5), KEY post_id (post_id), KEY optm_status (optm_status), KEY root_id (root_id), KEY src_md5 (src_md5), KEY srcpath_md5 (srcpath_md5)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci von require(wp-blog-header.php), require_once(wp-load.php), require_once(wp-config.php), require_once(wp-settings.php), do_action(after_setup_theme), WP_Hook->do_action, WP_Hook->apply_filters, LiteSpeed_Cache->init, LiteSpeed_Cache_Optimize::get_instance, LiteSpeed_Cache_Optimize->__construct, LiteSpeed_Cache_Optimize->_static_request_check, LiteSpeed_Cache_Optimizer->serve, LiteSpeed_Cache_Data::optm_hash2src, LiteSpeed_Cache_Data::get_instance, LiteSpeed_Cache_Data->__construct, LiteSpeed_Cache_Data->_create_tb_img_optm Hello, Can you tell us your mysql version. Server Version: 5.6.39-cll-lve ? MySQL Community Server (GPL) Hello again, Did you use InnoDB engine? Yes, Im using the InnoDB engine. Hello again, Last question (i hope) ? what is the charset? This problem is related to this specifically configuration. That is why i ask this question. The charset is utf8mb4_unicode_520_ci, latin1_swedish_ci. Thanks for your effort. Hello again, Okay, so i run some test but at that point i cant recreate the problem. If its not a problem for you can you run this in phpmyadmin > your database -> sql: CREATE TABLE IF NOT EXISTStmptest(id` int(11) unsigned NOT NULL AUTO_INCREMENT, post_id bigint(20) unsigned NOT NULL DEFAULT 0, optm_status varchar(255) NOT NULL DEFAULT , src varchar(1000) NOT NULL DEFAULT , srcpath_md5 varchar(128) NOT NULL DEFAULT , src_md5 varchar(128) NOT NULL DEFAULT , server varchar(255) NOT NULL DEFAULT , root_id int(11) NOT NULL DEFAULT 0, src_filesize int(11) NOT NULL DEFAULT 0, target_filesize int(11) NOT NULL DEFAULT 0, target_saved int(11) NOT NULL DEFAULT 0, webp_filesize int(11) NOT NULL DEFAULT 0, webp_saved int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY post_id_2 (post_id,srcpath_md5), KEY post_id (post_id), KEY optm_status (optm_status), KEY root_id (root_id), KEY src_md5 (src_md5), KEY srcpath_md5 (srcpath_md5)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOTE: Edit the last part DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci with your details. If I run your script on phpmyadmin Im getting the following error: #1709 ? Index column size too large. The maximum column size is 767 bytes. I tried a few things and found out that the problem is related to optm_status varchar(255) NOT NULL DEFAULT , I could change this for example to optm_status varchar(128) NOT NULL DEFAULT , and then the sql script would run without a problem. OK thanks for your testing. Will fix this in next release. Commit in https://github.com/litespeedtech/lscache_wp/commit/d6ac16649eb3856d7b5beb922c828255fc79d1d4 You can try this in your LSCWP v2.0 to make it work. Thank you very much for the fix. It works now on my website (LSCWP v2.0).
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference