Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
63

There are different kind of indexes in Magento. All of the indexers are there to make things run faster. I will cover here only a few of them. Flat Index There are 2 such indexes. One for categories and one for products. By default the category and product entities (and customers and customer addresses but they are not important in this situation) are EAV ...


55

In official documentation: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/indexing.html there is the stement: `Allows tracking database changes for a certain entity (product, category and so on) and running change handler. Emulates the materialized view technology for MySQL using triggers and separate materialization process (provides executing ...


31

You are running this command from ROOT and indexer.php is located under shell directory. So try this commands instead: php shell/indexer.php --reindex catalog_product_attribute For re-indexing all indexes : php -f shell/indexer.php reindexall Listing all commands : php shell/indexer.php --reindex catalog_product_attribute php shell/indexer.php --reindex ...


28

A server timeout might causing Magento Admin Reindexing to stuck on "Processing" forever. What you need to do is to get SSH access for your server and depending on which reindex you got stuck, preform the following command lines. php yourmagentofolder/html/shell/indexer.php -reindex catalog_product_attribute php yourmagentofolder/html/shell/indexer.php -...


24

Yes, flat tables are still a thing. You can enable flat tables for products and categories from stores->configuration->catalog->storefront. Why do we need flat tables? They do offer significant performance boost for large catalog data. One of our client has only 5 categories and around 250 products so it doesn't really matter if you have flat on or off. It ...


20

Those tables are related to MView from Magento 2. It's the indexer that runs in cron every minute by default. MView is used if you set the indexer mode to 'Index by Schedule'. Magento checks if the _cl tables exist, if not, are created every time the indexer/MView runs. The code related to these table creation is in \Magento\Framework\Mview\View::subscribe()...


18

Most probably you have a declared indexer that does not have a model associated to it. There is also the chance that if you have the cache enabled, this cache can be corrupted. (but I doubt it). Just to make sure first you clear the contents of var/cache. If that does not work, and probably won't here is how the indexes work. An index is defined in the ...


18

Doing a grep on the code directory will get you a list of files that triggers an invalidation. grep -Ri '::STATUS_REQUIRE_REINDEX' . The following core files trigger an invalidation ./core/Mage/CatalogSearch/Model/Indexer/Fulltext.php ./core/Mage/Catalog/Model/Product/Indexer/Flat.php ./core/Mage/Catalog/Model/Product/Indexer/Price.php ./core/Mage/Catalog/...


16

There is quite big probability that your payment method is processing payment wrongly. Magento Order Save Process is quite simple: Prepares all data that should be transfered from quote item to order item, including prices and product information, afterwards it doesn't invoke price retrieval. Invoke before order submit events ...


16

You need to enable visible_on_front to push into the Catalog Flat tables. Category flat tables are affected by used_in_product_listing. As for the limit in MySQL I believe that is a separate question and should be migrated out as a separate Q&A.


15

Update on Save :The index is set to update whenever a change is saved. Update on Schedule :The index is set to update on schedule according to a cron job. On a small store,Update on Save is fine and will add very little load. If you have a larger store with multiple admins, working in the backend then your indexes could be getting triggered constantly. ...


14

Maybe it's an idea to temporarily create a rewrite for this site on Mage_Index_Model_Resource_Process Then do something like: <?php class YourNamespace_YourModule_Model_Resource_Process extends Mage_Index_Model_Resource_Process { public function updateStatus($process, $status) { if ($status === Mage_Index_Model_Process::...


12

This is actually a feature. If you want to avoid this you should set the flag 'Is anchor' to 'No' on the parent category. In your example 'Clothing'. This way, in the parent category you will see only products directly assigned to it. After you do the changes you should re-index everything.


11

Can't take credit for this as it is taken from original post at: https://stackoverflow.com/questions/4945307/can-someone-explain-magentos-indexing-feature-in-detail Magento's indexing is only similar to database-level indexing in spirit. As Anton states, it is a process of denormalization to allow faster operation of a site. Let me try to explain some of ...


11

DELETE FROM `catalog_product_entity_datetime` WHERE entity_id NOT IN (SELECT entity_id FROM `catalog_product_entity`); DELETE FROM `catalog_product_entity_decimal` WHERE entity_id NOT IN (SELECT entity_id FROM `catalog_product_entity`); DELETE FROM `catalog_product_entity_gallery` WHERE entity_id NOT IN (SELECT entity_id FROM `catalog_product_entity`); ...


10

This works fine in Magento CE 1.6 and newer: $event = Mage::getSingleton('index/indexer')->logEvent( $product, $product->getResource()->getType(), Mage_Index_Model_Event::TYPE_SAVE, false ); Mage::getSingleton('index/indexer') ->getProcessByCode('catalog_url') // Adjust the indexer process code as needed ->setMode(...


10

Just a guess, but it sounds like Your command line php executable uses a different php.ini file than the web server The php.ini file your command line version uses has a different, and invalid, value set for the mysql.default_socket ini setting When you specify a MySQL server host as localhost, you're telling the system to use this socket file to connect ...


10

Since others have already answered your questions specifics. I thought it may be better to explain why indexing is needed and how it relates to Magento and the relationship to modern databases. Index: an alphabetical list of names, subjects, etc., with references to the places where they occur, typically found at the end of a book. So what exactly is ...


9

Starting with Magento CE 1.8 the flat table indexes are only shown on the Index Management page if flat tables are enabled. Enable flat tables in System > Configuration > Catalog > Catalog > Frontend: Enjoy the flat table indexes in System > Index Management:


9

Here you go $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat'); //the ID is 4 $process->reindexEverything(); Then you should be all set


9

You can fix this from the command line by reseting the index which will invalidate the state of the index and remove the processing flag from the index. php bin/magento indexer:reset Optionally you may also append the index name to the command to just just reset that index.


9

After lot of debugging, i found the sound code which does reindex product by product id. Here is the way - require_once('app/Mage.php'); umask(0); Mage::app(); // Get products $productsIds = array('11','222','3333'); // product id array // Reindex category/product association $event = Mage::getModel('index/event'); $event->setNewData(array( '...


8

Because this is a custom extension, we can find a custom workaround (read: hack) to retrying the save without editing core files. I have solved all of my deadlock woes with the following two methods added to a helper class. Instead of calling $product->save() I now call Mage::helper('mymodule')->saferSave($product): /** * Save with a queued retry ...


8

They shouldn't have the same number of records. The table catalog_category_product contains the links you create in the backend. Here is an example. Let's say you have the following category structure. Using category ids: 2 |-4 |-5 |-6 And in the backed you associate the product with id 99 to the category with id 6. Then in catalog_category_product you ...


8

use for layered navigation. Filterable (with results) means that links will only appear for values where the number of results (the number in parentheses next to each value) is greater than zero. Filterable (no results) means that links will appear for all values, whether the number of results is zero or greater.


8

Yes, it must be faster than Magento v1.x (by at least 20%). Improved scalability consists of improved indexers, new Magento performance toolkit, Varnish Cache, Full page caching, What is Magento 2 index Indexing is how Magento transforms data such as products, categories, and so on, to improve the performance of your storefront. As data changes, the ...


7

The indexing order when reindexing all processes is defined by Mage_Index_Model_Indexer::_runAll(). This method uses the depends property of each process to check which other processes have to run before itself can do it's work. The getDepends() method of the index/process uses the configuration node global/index/indexer/[process-code]/depends to ...


7

There is a cron called "enterprise_index_clean_changelog" to handle the cleaning of those tables. It is configured via the admin at System -> Configuration -> Advanced -> Index Management -> Index Clean Schedule. From there you can enable/disable it and adjust the start time and frequency.


7

it seams that you have zombie data in the flat table for store with id 1. The prepareFlatTable method is trying to add a Foreign Key to the catalog_product_entity table and that fails. Most probably because you already have in the catalog_product_flat_store_1 table a product id that is not in the catalog_product_entity table. First backup your database (...


6

60,000 products * 40 store views = 2,400,000 products I'm honestly not surprised you've got catalogue consistency issues. Magento doesn't scale well at all with large catalogues combined with large numbers of store views. Your issue is almost entirely caused by an index not being complete, so your theories of 1, 1a and 1b are all correct. We've seen this ...


Only top voted, non community-wiki answers of a minimum length are eligible