1)How indexing works in Magento
2)Please explain..what exactly it does
3)Why it is required
I have tried searching some links but it is not explained properly
|
1)How indexing works in Magento 2)Please explain..what exactly it does 3)Why it is required I have tried searching some links but it is not explained properly |
|||||||||||||
|
|
There are different kind of indexes in Magento. Flat Index Catalog Search Index Product Prices. Catalog url Rewrites Category Products Stock Status Product Attributes. Tag Aggregation |
|||||||||||||||||
|
|
Can't take credit for this as it is taken from original post at: http://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 the thoughts behind the Magento database structure and why it makes indexing necessary to operate at speed. In a more "typical" MySQL database, a table for storing catalog products would be structured something like this:
This is fast for retrieval, but it leaves a fundamental problem for a piece of eCommerce software: what do you do when you want to add more attributes? What if you sell toys, and rather than a size column, you need age_range? Well, you could add another column, but it should be clear that in a large store (think Walmart, for instance), this would result in rows that are 90% empty and attempting to maintenance new attributes is nigh impossible. To combat this problem, Magento splits tables into smaller units. I don't want to recreate the entire EAV system in this answer, so please accept this simplified model:
Now it's possible to add attributes at will by entering new values into product_attributes and then putting adjoining records into product_attribute_values. This is basically what Magento does (with a little more respect for datatypes than I've displayed here). In fact, now there's no reason for two products to have identical fields at all, so we can create entire product types with different sets of attributes! However, this flexibility comes at a cost. If I want to find the color of a shirt in my system (a trivial example), I need to find:
Magento used to work like this, but it was dead slow. So, to allow better performance, they made a compromise: once the shop owner has defined the attributes they want, go ahead and generate the big table from the beginning. When something changes, nuke it from space and generate it over again. That way, data is stored primarily in our nice flexible format, but queried from a single table. These resulting lookup tables are the Magento "indexes". When you re-index, you are blowing up the old table and generating it again. Hope that clarifies things a bit! |
|||
|
|
|
Magento is a pretty powerful and complex system. It allows to work with massive amounts of data, but when database is overloaded with tons of records it becomes heavy and slow. Magento uses indexes to solve this problem. Indexes are additional database tables with some flat data, which allows to organize fast responses from the database. By default, core system updates indexes on each item’s save. But in some cases you need to do it manually, for example some types of mass actions etc. You can update indexes any time from the admin backend (Admin->System->Index Management). But sometimes it causes problems. For example, if you have 10k+ products and a lot of categories, rebuilding ‘catalog url rewrite‘ index may take hours. Then php script can just break because of max_execution_time exceeding. There is a way to solve several problems by running reindex process from the command line. |
|||
|
|