Unanswered: query design (2 tables - same structure)
here are the facts:
- 2 tables: `table1` and `table2` that have the SAME structure
- `table1` about 30.000 rows
- `table2` about 170.000 rows - this table is updated more often
- i have to display the data in a grid with pagination with results from both `table1` and `table2`
i've did the following:
CREATE TEMPORARY TABLE `table_tmp` LIKE `table1`;
ALTER TABLE `table_tmp` ENGINE=MERGE UNION=(`table1`,`table2`);
ANALYZE TABLE `table_tmp`;
LIMIT 0, 20
is this the best method to work with the tables?
i find it kind of slow. please share your thoughts.
sometime i get this kind of error: Table 'table_tmp' is marked as crashed and should be repaired