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 determine it's dependencies.
Having a look at Mage/Catalog/etc/config.xml
, the indexer processes configurations there are as follows:
<index>
<indexer>
<catalog_product_attribute>
<model>catalog/product_indexer_eav</model>
</catalog_product_attribute>
<catalog_product_price>
<model>catalog/product_indexer_price</model>
</catalog_product_price>
<catalog_url>
<model>catalog/indexer_url</model>
</catalog_url>
<catalog_product_flat>
<model>catalog/product_indexer_flat</model>
</catalog_product_flat>
<catalog_category_flat>
<model>catalog/category_indexer_flat</model>
</catalog_category_flat>
<catalog_category_product>
<model>catalog/category_indexer_product</model>
</catalog_category_product>
</indexer>
</index>
No dependencies are declared at all, so I would say the concrete processing order is more or less random, or unspecified.
To have the *_flat
indexer processes run before the catalog_url
reindexing, it should be enough to add a dependency as follows:
<catalog_url>
<model>catalog/indexer_url</model>
<depends>
<catalog_product_flat/>
<catalog_category_flat/>
</depends>
</catalog_url>