1

Is it possible to truncate catalog_product_index_price without causing problems to the actual products?

2 Answers 2

1

Yes you can, but be sure before performing this tasks. You can run "php bin/magento indexer:reindex" command, also refer this link:

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/indexer-batch.html

Magento optimizes certain indexer processes to prevent deadlocks and wait locks caused by read/write collisions on the same table. In these cases, Magento uses separate tables for performing read operations and reindexing. As a result of this table switching process, customers are not impacted when you run a full reindex. For example, when catalog_product_price is reindexing, customers won’t be slowed down as they navigate on Categories pages, search products, or user layer navigation filters with price filters.


2
  • I did ran "php bin/magento indexer:reindex", it only added more records to the catalog_product_index_price table. the problem I have is when I try to perform a DB backup it takes forever due to the large size of that table
    – Med Amine
    Commented Apr 6, 2020 at 9:41
  • Yes you can truncate it also you can truncate logs tables to if you don't need them.
    – Ankit
    Commented Apr 6, 2020 at 11:14
0

A really good topic to discuss on... I think it depends on the number of products, there were issues in the past. But not sure about right now.

Anyone wants to put their points or share any experiences?

Anyways, I was following the great discussion on GitHub and Stack Overflow. Maybe you would find anything relevant.

https://github.com/magento/magento2/issues/6415 https://stackoverflow.com/questions/12205714/list-of-tables-to-safely-truncate-in-magento

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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