Finding the Largest Database Tables Using SQL (Magento 2)

A Magento database can grow large over time. Before you investigate or delete individual tables, identify which tables consume the most space. The following SQL query lists the 20 largest tables, including data size, index size and total size:

…

Finding products without product images using SQL (Magento 2)

Sometimes you need to find all products without assigned images in Magento 2, for example to verify that a product import or data migration is complete. The following SQL query returns products without product images:

Fixing the Mage_Core_Model_Store::setWebsite() argument type error (Magento 1)

You might encounter the message Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given when moving your store to another server. The solution is straightforward. Run the following SQL queries to resolve the issue:

Finding products with and without custom options using SQL (Magento 1)

To find all products that have keine no custom options, run this query:

To find all products that do have custom options, simply remove “NOT” from the query above.