How to process Magento indexes from the command line

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.