MySQL Is there a limit to InnerJoin?

后端 未结 4 1499
孤街浪徒
孤街浪徒 2021-01-19 00:26

I have this query for gathering the information about a single order and its become quite complex.

I don\'t have any data to test with so i\'m asking, if anyone has

4条回答
  •  执念已碎
    2021-01-19 00:47

    I do not have any general advice, just my own expirience.

    I had once a problem with very bad performance where I added tonz of tables using JOIN. Was around 20 JOIN I did. When I removed a few JOINS in a test the speed went up again. Due the fact I just needed single information I was able to replace most of the JOINS with sub selects. This solved my problem from 25 seconds for my query down to less then 1 second.

    It is probably a fact of your table design, your amount of columns of the joined tables, and your indexes on the joined where clauses.

提交回复
热议问题