![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a query that involves joining 4 tables. Each of the tables has many columns but my query involves a small subset of the columns from each of the 4 tables. Would it be more efficient if I created 4 temporary tables, each containing the columns of interest and then doing the join on the temporary tables? My original query is fast enough, I just want to be kind to the MySQL server. Thank you, Joe |
#3
| |||
| |||
|
|
On 3/21/2011 1:55 PM, Joe Hesse wrote: I have a query that involves joining 4 tables. Each of the tables has many columns but my query involves a small subset of the columns from each of the 4 tables. Would it be more efficient if I created 4 temporary tables, each containing the columns of interest and then doing the join on the temporary tables? My original query is fast enough, I just want to be kind to the MySQL server. Thank you, Joe Why fix something that isn't broken? Think about it - you'll make 4 queries to create temporary tables, selecting all rows and the columns you want from the permanent tables. Then you'll make another query from the temporary tables, selecting specific rows. How can this be faster than selecting those columns from a subset of the rows in each table? |

#4
| |||
| |||
|
|
Would it be more efficient if I created 4 temporary tables, each containing the columns of interest and then doing the join on the temporary tables? |
#5
| |||
| |||
|
|
I have a query that involves joining 4 tables. Each of the tables has many columns but my query involves a small subset of the columns from each of the 4 tables. Would it be more efficient if I created 4 temporary tables, each containing the columns of interest and then doing the join on the temporary tables? My original query is fast enough, I just want to be kind to the MySQL server. Thank you, Joe |
![]() |
| Thread Tools | |
| Display Modes | |
| |