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?
3 Answers
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.
-
-
1wait for it....it will grow...and by the way, you can make my +4 to +3 :)– Marius ♦Sep 6, 2013 at 13:58
Well...you can't. Since this is a limitation of MySQL you cannot go around it with Magento. What you can do is to rethink your business logic, to have less than the max number of join tables and get the rest of your data in an other way (different query). I know this means more queries, but at least it works.
You could write a custom Magento indexer to track the attributes in a single flat index table, which would have the side benefit of being a lot more efficient on the db level. Take a look at
Mage_Catalog_Model_Product_Indexer_Flat
to see how Magento deals with this EAV problem feature in core.