It is best to determine which table to use for query based on the query conditions of the order, so that there is no need to query multiple tables. If this is not possible, the general approach is to query multiple tables separately, and then use union all to put them into one result set.
There are several ways: 1. Partition, partition according to the conditions of your partitioning. After partitioning, the corresponding partition will be found according to your partitioning conditions 2. The tables of the myisam storage engine can be merged into one surface. However, the table structure is required to be consistent, see MRG_MYISAM 3. Multiple tables union all. It is more appropriate to require an index 4. Application judgment processing.
Inline query, join condition plus index, and all fields related to where need to be indexed
It is best to determine which table to use for query based on the query conditions of the order, so that there is no need to query multiple tables.
If this is not possible, the general approach is to query multiple tables separately, and then use union all to put them into one result set.
There are several ways:
1. Partition, partition according to the conditions of your partitioning. After partitioning, the corresponding partition will be found according to your partitioning conditions
2. The tables of the myisam storage engine can be merged into one surface. However, the table structure is required to be consistent, see MRG_MYISAM
3. Multiple tables union all. It is more appropriate to require an index
4. Application judgment processing.