3

There seem to be many issues around the re-indexing of product prices on order placement. See the other issue re deadlocks which is related... Price re-index causes DB deadlocks during checkout

I have reported this to Magento and they have replied that I should set indexing to Manual so that it is not run. However I don't see how this is a solution.

In addition to deadlocks, we also notice that some products are suddenly missing from the catalog_product_index_price table after being ordered. They are configurable products and they are in stock, however some of their simple products are not.

The problem is products no longer show up on the website if they don't have a record in product price.

How can I prevent this from happening?

Or why does price have to be reindexed at this time?

I don't think this is needed:

8 /var/www/html/app/code/core/Mage/CatalogInventory/Model/Observer.php(689): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexProductIds(Array)
2
  • Perhaps reindex happens because of the association of price indexing for Promotions Catalog Rules?
    – philwinkle
    Jan 31 '13 at 22:22
  • Kim, Could you please share what you have done? Its okay to answer your own question. I would appreciate that. Aug 17 '13 at 13:48
4

Reindexing is done for a number of reasons after checkout, here are a few things you can look into:

Percona

Check out the Percona Toolset. We generally use that alongside Percona's build of MySQL. The toolset is a set of diagnostic tools, and there's one just for this. It's called pt-deadlock-logger.

New Relic

We have our clients purchase access to New Relic Pro. When you have it connected, you can easily see all the SQL behind your methods. This helps find ORM calls that might not be efficient and is super convenient when trying to profile and refactor.

Checkout Events

We've seen a ton of crazy stuff observing checkout - it's crazy. I'd look at all of those and see what you can do.

Move Indexers

You could rewrite your indexes to use something other than MySQL. We did this before and it was a dramatic improvement. It was before Magento had the new RDBMS abstraction in 1.6, but is something that would be worth doing.

1
  • Thanks Bob. I did just install New Relic - its great! I also found a bug in the indexing core code that i fixed. Will look into percona. Feb 18 '13 at 17:11
0

If a configurable product have no child products salable (all children without stock) then the next time you index price this configurable product won't have any row in catalog_product_index_price. I assume that some automated process have reindexed the catalog prices.

PS. That occurs when you have enable the setting to NO show products without stock in frontend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.