is having millions of tables and millions of rows within them a common practice in MySQL database design?

前端 未结 7 665
死守一世寂寞
死守一世寂寞 2021-01-05 20:27

I am doing database design for an upcoming web app, and I was wondering from anybody profusely using mysql in their current web apps if this sort of design is efficient for

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-05 20:46

    In addition to what others have said, don't forget that finding the right table based on the given table name also takes time. How much time? Well, this is internal to DBMS and likely not documented, but probably more than you think.

    So, a query searching for a row can either take:

    1. Time to find the table + time to find the row in a (relatively) small table.
    2. Or, just the time to find a row in one large table.

    The (2) is likely to be faster.

    Also, frequently using different table names in your queries makes query preparation less effective.

提交回复
热议问题