Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Product flat table will not reindex - Row size too large

Tags:

magento

When i try to reindex product flat data,I am getting There was a problem with reindexing process.Database repair didn't help.Exception.log file show this error

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}

Any pointers?

like image 335
blakcaps Avatar asked Aug 29 '11 12:08

blakcaps


2 Answers

You've exceeded the row limits in your product flat data table. Basically 255 * Number of Attributes > 65535 which is the maximum allowable characters per row in MySQL http://dev.mysql.com/doc/refman/5.1/en/column-count-limit.html

This can be fixed by removing any attributes that you do not need to appear in the product flat data table by turning off the following attribute properties: Used in Product Listing and Used for Sorting in Product Listing and then attempting a reindex when you've reduced the character count to below the limit.

If it's absolutely necessary to have everything there, then you need to start limiting some of the attribute storage in product flat data down to less than the 255 char maximum that's automatically assigned. Sonassi tells you how to do this here: http://www.sonassi.com/knowledge-base/magento-knowledge-base/mysql-limitations-on-the-flat-catalogue-in-magento/

like image 193
Fiasco Labs Avatar answered Nov 10 '22 09:11

Fiasco Labs


I would suggest not using product_flat_data - when the row size is nearing its limit, its performance benefits are negated anyway.

You can find a fairly detailed article on the issue and possible resolutions here http://www.sonassi.com/knowledge-base/magento-kb/mysql-limitations-on-the-flat-catalogue-in-magento/

like image 39
Ben Lessani Avatar answered Nov 10 '22 08:11

Ben Lessani