Differences between “IS NULL” and “ISNULL()” in Mysql

后端 未结 2 1428
死守一世寂寞
死守一世寂寞 2021-01-04 00:37

Is there any difference in performance between the operator IS NULL and the function ISNULL()?

2条回答
  •  一生所求
    2021-01-04 01:14

    This thread is similar, though not exactly on MySQL. According to the test shown there:

    IS NULL is more efficient as it doesn't require a scan.

    Seek is generally faster than a scan as it only includes qualifying records, while scan includes every row. It is explained in more detail here.

    Another difference (though it's not performance) is their negation syntax:

    IS NOT NULL  /* using NOT operator */
    ! ISNULL()  /* using exclamation mark */
    

提交回复
热议问题