How can multi-table federated queries be efficient?

the company"s product tables currently have 3, and there may be 20 + in the future, and the amount of data varies from tens of thousands to millions, each of which needs to be maintained separately and cannot be merged together. At present, I want to combine all tables for fuzzy query, how to write sql to build the index the fastest?
table A:
id:1, pn:max12389531,
id:2, pn:max12389698,
id:3, pn:max12389a59,

table B:
id:1, pn:max12389984,
id:2, pn:max12389124,
id:3, pn:max12389a59,

table C:
id:1, pn:max12389asd,
id:2, pn:max12389c58,
id:3, pn:max12389a95,

Mar.23,2021

1. To write SQL, you can first where the index field. For example, if status is a table index, then where status = 1 and xxx (fuzzy search)
2. If it is still slow, it is recommended to build a table, write some frequently queried data into it, and then write a script to update it regularly

.
Menu