In MySQL, which is more efficient: IFNULL or NULLIF? -


these 2 mysql functions same thing:

ifnull(column_name, 'test') = 'test' 

or

nullif(column_name, 'test') null 

which 1 more efficient?

they both efficient each other - functions have same overhead each other.

but more efficient either:

(column_name null   or column_name = 'test') 

because function doesn't need invoked.

you may find putting more commonly encountered test first improves performance.


with questions this, simplest , more reliable way discover relative performance try them , compare query timings. make sure have production-sized , realistic-valued datasets test fair.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -