Magento – How to deal with 61 tables join limit when building magento collection

collection;MySQL

Mysql has known limitation of 61 tables to join, how do you overcome that when you have more than 61 attributes to join in magento collection?

Best Answer

There's no circumventing, however, you don't always need a join. If custom tables are involved, denormalize them. Serialize some data into JSON/PHP serialized objects.

You can also use UNION to merge multiple SELECT statements. You can use subqueries, and you can use multiple, sequential, queries to append to a custom collection.

In short, rethink your design or your implementation.

Other thoughts:

Or look into Magento's compatibility with other RDBMS' such as SQL Server or Oracle. Look into the specs of MariaDB, the fork of MySQL to see if it's compatible. See if there's some community support (not sure off the top of my head) for Postgres in Magento.