Finding Product URL Rewrites with SQL (Magento 2)

When product URLs behave unexpectedly, a direct look at Magento’s url_rewritetable can be useful. It stores public-facing paths, internal targets and redirects for product URLs. Use the following query to display URL rewrites for a specific SKU:

request_path contains…

Finding Direct ObjectManager Usage in Code (Magento 2)

In older extensions or inherited Magento code, you may find direct calls to the ObjectManager. A regular expression makes it easy to search for those calls throughout the codebase.

For example, the search may find:

The regular expression…

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:

…