duangangmo0583 2016-06-06 10:51
浏览 24

MySQL效率 - 2个单独的表或连接

I have a question about MySQL efficiency.

If I had 2 very large tables of data, which are similar in columns. And I need to display the data together, would it be better to combine the tables into 1 or use a join?

Bear in mind over time there could be millions of rows in each table, so combining would double the table size.

What is the best way to do this efficiency wise?

Is it worth separating the data?

  • 写回答

2条回答 默认 最新

  • duanniling0018 2016-06-06 10:58
    关注

    Depends on the actual data. If the type of data is the same in both tables, put them together in one table.

    MySQL is able to handle millions of rows. You should ask again when you are actually witnessing performance issues.

    You mean "use a union"? By using join you add columns to the resultset, seems like you rather want to add rows.

    评论

报告相同问题?