产品平台不会重新索引 - 行尺寸太大

时间:2011-08-29 12:12:44

标签: magento

当我尝试重新索引产品平面数据时,我得到There was a problem with reindexing process.数据库修复没有帮助.Exception.log文件显示此错误

2011-08-29T11:54:05+00:00 DEBUG (7): Exception message: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
Trace: #0 /home/sites/www.domain.com/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/sites/www.domain.com/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/sites/www.domain.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#3 /home/sites/www.domain.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#4 /home/sites/www.domain.com/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php(652): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#5 /home/sites/www.domain.com/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php(122): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->prepareFlatTable('1')
#6 /home/sites/www.domain.com/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Flat/Indexer.php(115): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild('1')
#7 /home/sites/www.domain.com/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(64): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild(NULL)
#8 /home/sites/www.domain.com/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(301): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#9 /home/sites/www.domain.com/app/code/core/Mage/Index/Model/Process.php(139): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#10 /home/sites/www.domain.com/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll()
#11 /home/sites/www.domain.com/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 /home/sites/www.domain.com/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 /home/sites/www.domain.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 /home/sites/www.domain.com/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /home/sites/www.domain.com/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#16 /home/sites/www.domain.com/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#17 /home/sites/www.domain.com/index.php(80): Mage::run('', 'store')
#18 {main}

任何指针?

2 个答案:

答案 0 :(得分:15)

您已超出产品展平数据表中的行限制。基本上255 *属性数> 65535这是MySQL中每行允许的最大字符数 http://dev.mysql.com/doc/refman/5.1/en/column-count-limit.html

可以通过关闭以下属性属性来删除不需要显示在产品展示数据表中的任何属性来解决此问题:在产品详情中使用用于排序在产品列表中,然后在将字符数减少到限制以下时尝试重新索引。

如果必须拥有所有内容,那么您需要开始将产品平面数据中的某些属性存储限制为低于自动分配的最大255个字符。 Sonassi在这里告诉你如何做到这一点:http://www.sonassi.com/knowledge-base/magento-knowledge-base/mysql-limitations-on-the-flat-catalogue-in-magento/

答案 1 :(得分:6)

我建议不要使用product_flat_data - 当行大小接近其限制时,无论如何都会取消其性能优势。

您可以在http://www.sonassi.com/knowledge-base/magento-kb/mysql-limitations-on-the-flat-catalogue-in-magento/

找到有关此问题和可能解决方案的相当详细的文章