Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
unwanted automatic and resource consuming reindexing of price index after saving a product
 
gunnar
Member
 
Avatar
Total Posts:  37
Joined:  2008-05-27
 

hey,
after my update from 1.4.0.1. to 1.5.0.1 i have the following problem:

the complete price index is automaticly reindexed everytime we are saving a product in the admin frontend even though the index mode of the price index is set to “Manual Update”.

this reindexing behaviour is very bad for the performance of our server, because everytime this process takes place all entries from the catalog_product_index_price table are deleted and the new index is copied into this table from an temporay table.

this delete and copy database operation takes about 2-3 minutes, in between all products in the shop are invisible on the frontend.

has anybody an idea, how to stop this automatic reindexing behavior?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Have you changed Index on Save in the indexing section?

 
Magento Community Magento Community
Magento Community
Magento Community
 
gunnar
Member
 
Avatar
Total Posts:  37
Joined:  2008-05-27
 

yes, to manualy update

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

It sound like the system isn’t noticing the change you are putting in.  Try this:

Clear Cache
Change index setting
Clear Cache
Change the index setting back to not indexing on every save

IF you can delete your /var/cache folder that would be even better

 
Magento Community Magento Community
Magento Community
Magento Community
 
gunnar
Member
 
Avatar
Total Posts:  37
Joined:  2008-05-27
 

hey brent,

this was not the solution. we now working around this problem and use the api to maintain the product images in the catalog.  when we use the update attribute action in the product grid, it is working fine. the action is accepting the “Manual Update” Mode of the price index.

to me, this seems to be a bug.

bye, gunter

 
Magento Community Magento Community
Magento Community
Magento Community
 
onthedole
Jr. Member
 
Total Posts:  6
Joined:  2008-11-25
 

I think this is related to another bug in 1.5.0.1

http://www.magentocommerce.com/boards/viewthread/219407/

 
Magento Community Magento Community
Magento Community
Magento Community
 
matlock77
Jr. Member
 
Total Posts:  2
Joined:  2011-02-13
 

I can confirm this problem. Also deleting a product is very slow.

Related Issue #25354:
http://www.magentocommerce.com/bug-tracking/issue?issue=11036

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeff.honnold
Jr. Member
 
Total Posts:  4
Joined:  2010-05-10
 

We can also confirm.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hankzh
Member
 
Total Posts:  56
Joined:  2011-02-08
 

A quick fix is comment line 691 in /app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php. Like this:

//Mage::getModel('catalogrule/rule')->applyAllRulesToProduct($productId);

not fully test. But that line is not existed in v!.4.1.1, added in v1.5.0.1.

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

Commenting out that line reduced our product save time from 20 seconds to 5 seconds, so it\’s definately worth doing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeff.honnold
Jr. Member
 
Total Posts:  4
Joined:  2010-05-10
 

We can confirm that save times went from 6 minutes to 8 seconds for us.  Big deal for the project.

We would be interested in knowing what danger there is to NOT having the product catalog “apply all rules”.  What are these rules, other than the completely unnecessary product price reindexing?  Does anyone know how those rules are computed/derived?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeff.honnold
Jr. Member
 
Total Posts:  4
Joined:  2010-05-10
 

We found this in the 1.5.0.1 comm. edition release notes, so we suspect it is a side-effect of something someone believed was a fix:

Fixed Catalog Price Rule is not applied
- Added Mage_CatalogRule_Model_Rule::applyAllRulesToProduct()

cf. http://www.magentocommerce.com/download/release_notes#Release%20Notes%20-%20Magento%201.5.0.1%20stable%20(February%209,%202011)

This rule appears at first glance to be a new rule and method, forcing an application of catalog price rules.  That would SEEM TO MEAN that if you don’t use catalog price rules it is harmless to not run that method.

HOWEVER, we all should analyze that, yes?  (And look at that addition in detail… maybe it accidentally invokes more than it needs to.)

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeff.honnold
Jr. Member
 
Total Posts:  4
Joined:  2010-05-10
 

Here is the method which is invoked here.  From 1.5.0.1 /app/code/core/Mage/CatalogRule/Model/Rule.php

It would seem that reindexAll() is run every time, at least in our installation.

public function applyAllRulesToProduct($product)
{
$this->_getResource()->applyAllRulesForDateRange(NULL, NULL, $product);
$this->_invalidateCache();
$indexProcess = Mage::getSingleton(’index/indexer’)->getProcessByCode(’catalog_product_price’);
if ($indexProcess) {
$indexProcess->reindexAll();
}
}

This adds to the evidence that it is ok to remove the method in the admin controller.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GFEMajor
Sr. Member
 
Total Posts:  138
Joined:  2010-01-11
 

You saved my life with this fix smile. Nice work, thank you.

works perfectly now, except i have to re-index the price index after saving all products, but thats exceptable smile.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netismine
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-10-28
 

this is changed in 1.6 in such way that only the saved product is being reindexed

Mage::getResourceSingleton('catalog/product_indexer_price')->reindexProductIds(array($productId));
 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 
Netismine - 08 September 2011 09:38 PM

this is changed in 1.6 in such way that only the saved product is being reindexed

Mage::getResourceSingleton('catalog/product_indexer_price')->reindexProductIds(array($productId));

I don’t know, I still need the fix provided in this thread for 1.6, or get 13 seconds save times for products, and nearly 1 minute for new attribute sets

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2