Magento update product attribute without trigger reindex

Magento update product attribute without trigger reindex

August 7, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento update product attribute without trigger reindex

Updating Magento Product Attributes Without Triggering Reindex

Updating product attributes in Magento typically triggers a reindex event, which can have performance implications for large catalogs. In this article, we’ll explore whether it’s possible to update attributes without initiating the reindex process.

Understanding the Magento Indexing Process

Magento uses an indexing system to optimize database queries and improve site performance. When you update product data, the system marks these entities as outdated in the index table. The next time a page is loaded or cron job runs, the outdated records are identified and updated with new values through reindex_all command.

The Default Magento Update Process

The default way to update attributes is by using the load(), setData(), and save() methods:

$product = Mage::getModel('catalog/product')->load($productId);
$product->setAttributeSetId($attributeSetId);
$product->save();

This sequence executes a full product save, which triggers reindexing. The same applies to the updateAttributes method in Mage_Catalog_Model_Product_Action:

public function updateAttributes($productIds, $attrData, $storeId)
{
    // ...

    // register mass action indexer event
    Mage::getSingleton('index/indexer')->processEntityAction(
        $this,
        Mage_Catalog_Model_Product::ENTITY,
        Mage_Index_Model_Event::TYPE_MASS_ACTION
    );
}

The processEntityAction call is the key; it registers an event that subsequently triggers reindexing.

An Alternative Approach: Direct Database Update

To avoid triggering reindex, you can update product attributes directly in the database. This approach bypasses Magento’s built-in save and index processes:

  1. Select the row(s) from the catalog_product_entity table.
  2. Update the desired attribute columns (e.g., attribute_set_id) using a prepared statement.

Here’s an example using PDO:

$pdo = new PDO('mysql:host=localhost;dbname=magentodb', 'username', 'password');

$sql = "UPDATE catalog_product_entity SET attribute_set_id = ? WHERE entity_id = ?";
$stmt = $pdo->prepare($sql);
$stmt->execute([$newAttributeSetId, $productId]);

This direct database update skips the usual Magento save process and doesn’t trigger reindexing.

Best Practices for Database Direct Updates

While this approach avoids reindexing, it comes with caveats:

  • Be sure to handle concurrency properly. Use transactions or locking mechanisms to prevent conflicts.
  • Ensure your changes don’t violate any Magento schema constraints or data integrity rules.
  • Be careful when updating core tables directly; changes could potentially break the platform.

Conclusion

In conclusion, it’s technically possible to update Magento product attributes without triggering reindexing by performing direct database updates. However, this method should be used sparingly due to potential risks and is generally recommended only for advanced use cases or plugin development.

For most common scenarios, using Magento’s built-in save methods with proper indexing management (e.g., via reindex command scheduling) remains the recommended approach.

Learn more about Magento’s index management and optimization strategies in our dedicated guide on Magento Indexing Best Practices.

Catalog Indexing Database Performance

Our network