Data Table based on multiple SQL tables
Data Table based on multiple SQL tables

I have 5 tables in mysql. Each table has 10 columns and approximately 1 million rows. Each table has the same structure but contains different data values. Does anyone have recommendations on how to query all five tables and how to speed up the process?
I think a VIEW using UNION will work. But I am not sure how to create an index in VIEW.
This discussion has been closed.
Answers
You cannot create in index in a MySQL view but normally the view will use the respective tables' indexes if they are properly designed.
I would create the VIEW using UNION ALL which normally has superior performance over UNION because it does not try to eliminate duplicates (so UNION should rather be called UNION DISTINCT ... but it isn't).