5

In magento we are updating orders in two tables each time, what is the real significance to use two tables,

what is the difference between sales_flat_order_grid and sales_flat_order tables ,

why we need to store order details in two tables.

2 Answers 2

12

sales_flat_order_grid works like an index to make displaying, sorting and filtering in the order grid faster and not blocking the real order tables. The source of truth for the shop is sales_flat_order.

The grid table is generated from it (see: Mage_Sales_Model_Resource_Order_Abstract::updateGridRecords().

10
  • is sales_flat_order_grid table has magento model Jan 25, 2017 at 12:59
  • @manokarthickkarthick No, only a collection class Mage_Sales_Model_Resource_Order_Grid_Collection, the items are regular order models Jan 25, 2017 at 13:02
  • then how can i update the sales_flat_order_grid ? Jan 25, 2017 at 13:15
  • is collection model allow to update the table? Jan 25, 2017 at 13:15
  • Update with updateGridRecords(), see link above Jan 25, 2017 at 13:19
2

sales_flat_order_grid table is for the Admin Order grid. In grid magento is showing billing name and shipping name, here shipping name and billing name are stored in another table.

To achieve this we have to join many tables, So they are using two different table.

sales_flat_order_grid is for Admin sales grid

And another one(sales_flat_order) is to store order details

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.