How to compare two queries?

前端 未结 4 991
面向向阳花
面向向阳花 2021-01-30 14:07

How can I compare two queries X and Y and say that X is better than Y, when they both take almost the same time in small cases scenarios?

The problem is that I have two

4条回答
  •  天涯浪人
    2021-01-30 14:43

    Evaluating query performance on a significantly different data set generally makes very little sense. Query plans and their efficiency can vary greatly depending on the data stats.

    So to get any realistic estimates, you need a database as close to the "real" one as possible. Best of all, take a copy of your "big database" and tune your queries to it.

提交回复
热议问题