开发者

Differences between "IS NULL" and "ISNULL()" in Mysql

开发者 https://www.devze.com 2023-01-12 22:22 出处:网络
Is there any difference in performance between the operator IS NULL and the function ISNULL()开发者_开发技巧?This thread is similar, though not exactly on MySQL. According to the test shown there:

Is there any difference in performance between the operator IS NULL and the function ISNULL()开发者_开发技巧?


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 */


Looking into the MySQL manual, they seem to be synonyms really.

  • MySQL manual on IS NULL

  • MySQL manual on ISNULL()

and even if they aren't, I would tend to trust the query optimizer to pick the best solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消