Does the order of columns in a WHERE clause matter?

前端 未结 7 1640
-上瘾入骨i
-上瘾入骨i 2020-11-28 14:29

Does the order of the columns in a WHERE clause effect performance?

e.g.

Say I put a column that has a higher potential for uniqueness first or visa versa?

7条回答
  •  孤城傲影
    2020-11-28 14:36

    With a decent query optimiser: it shouldn't.

    But in practice, I suspect it might.

    You can only tell for your cases by measuring. And the measurements will likely change as the distribution of data changes in the database.

提交回复
热议问题