I don't know which solution. Fortunately, we can see in the book that table sharding queries are generally used. it is helpful for caching. I don't know which solution is better.
In the book, we can see that table sharding queries are generally used to facilitate caching.
Reply content:
I don't know which solution is better.
In the book, we can see that table sharding queries are generally used to facilitate caching.
It mainly depends on the data volume and application scenarios. when the data volume is small, the two are similar.
Which of the following is a better efficiency for where in () queries or multi-table left join queries?
You are talking about an SQL problem. using left join is far more than using in.
These two syntaxes are used in different scenarios. in knows the id to filter records that match your id group, while left join is an associated table. If I do paging, check whether the associated table is a large table (hundreds of thousands of millions of records), and then decide whether to use left join. even if we use join, we 'd better explain whether it is optimal, if not, check the explain results for optimization. We recommend that you do not join large tables. if you use in, extract IDs and query sub-tables to assemble data into the master table dataset without repeating multiple cycles, and the efficiency is not necessarily slow.