php - Can someone explain Magentos Indexing feature in detail? -
i kind of how indexing in magento works, haven't seen documentation on this. kind of know following.
- how works
- what purpose
- why important
- what details should know it
- anything else can understand indexing , how used in magento
i think having information of great use others in boat don't indexing process.
update: after comment on question , ankur's answer, thinking missing in knowledge of normal database indexing. magento's version of handling indexing , better me answer in terms of database indexing in general, such link here how database indexing work?
magento's indexing similar database-level indexing in spirit. anton states, process of denormalization allow faster operation of site. let me try explain of thoughts behind magento database structure , why makes indexing necessary operate @ speed.
in more "typical" mysql database, table storing catalog products structured this:
product: product_id int sku varchar name varchar size varchar longdesc varchar shortdesc varchar ... etc ...
this fast retrieval, leaves fundamental problem piece of ecommerce software: do when want add more attributes? if sell toys, , rather size column, need age_range
? well, add column, should clear in large store (think walmart, instance), result in rows 90% empty , attempting maintenance new attributes nigh impossible.
to combat problem, magento splits tables smaller units. don't want recreate entire eav system in answer, please accept simplified model:
product: product_id int sku varchar product_attribute_values product_id int attribute_id int value misc product_attributes attribute_id name
now it's possible add attributes @ entering new values product_attributes
, putting adjoining records product_attribute_values
. magento (with little more respect datatypes i've displayed here). in fact, there's no reason 2 products have identical fields @ all, can create entire product types different sets of attributes!
however, flexibility comes @ cost. if want find color
of shirt in system (a trivial example), need find:
- the
product_id
of item (in product table) - the
attribute_id
color
(in attribute table) - finally, actual
value
(in attribute_values table)
magento used work this, dead slow. so, allow better performance, made compromise: once shop owner has defined attributes want, go ahead , generate big table beginning. when changes, nuke space , generate on again. way, data stored in our nice flexible format, queried single table.
these resulting lookup tables magento "indexes". when re-index, blowing old table , generating again.
hope clarifies things bit!
thanks, joe
Comments
Post a Comment