2

In my drupal application, query is generated dynamically by joining more than 61 tables. But while executing the query i got a error like cannot join more than 61 tables. I cannot reduce the number of tables. So how can i solve this issue? Any help is highly appreciated.

  • 3
    http://dev.mysql.com/doc/refman/5.1/en/joins-limits.html – DCoder Sep 13 '13 at 05:06
  • 6
    61? Good grief, keptin, I dinna think the engines can _take_ much more! This must be the near-mythical seventeenth normal form :-) – paxdiablo Sep 13 '13 at 05:07
  • I don't think so you can join more than 61 tables in MySQL. http://stackoverflow.com/questions/1684971/too-many-tables-mysql-can-only-use-61-tables-in-a-join – verisimilitude Sep 13 '13 at 05:07
  • @paxdiablo: it's a result of Drupal's "flexible" architecture. In Drupal, you can use a GUI to create "content types" (akin to *classes* in OOP) with arbitrary "fields" (*properties*) of various types. Each field is stored in a separate table, and when you try to load a "node" (an *instance* of a class) from the DB, the core automatically creates the needed joins behind your back. – DCoder Sep 13 '13 at 05:16
  • Does Drupal require MySQL? This sounds much more suited to a NoSQL database like Mongo. – Chris Hayes Sep 13 '13 at 05:39

1 Answers1

-1

As per MySql Documentation, Maximum number of tables in single join is 61. This is also applicable for views too.

I think you can play with procedures as per your business logic.

Md Ismail
  • 159
  • 1
  • 6