Which one is faster NVL or COALESCE in Redshift?

June 2024 ยท 1 minute read

I have a use case , where I have a choice to apply NVL or COALESCE .
ex: COALESCE(col_1,'alternate_string')

NVL(col_1,'alternate_string') 

I know about IS NULL and IS NOT NUll , but tell me how will I adapt it to this query : DELETE FROM TABLE_1 T1 USING TABLE_2 T2 WHERE T1.col_1 = T2.col1 t1.col2 = t2.col2 and so on . ..... Should I be using Cases for that ?
How will handle for boolean types. I want to know which one runs faster in terms of execution time in AWS Redshift ?

6

1 Answer

They are the same:

COALESCE

Synonym of the NVL expression.

NVL

An NVL expression is identical to a COALESCE expression

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobW5sYGuEc4SOsJ%2Bim5hivK%2BxjKKqZp6RqMGmvoynraVln6d6pLvApZysm5Vitq950Z6brKCZm8E%3D