Wednesday, November 11, 2015

NSSQL TIPS #2

Functions in search-conditions

Do not use functions on table-columns in a search-condition. This may result in a scan because the optimizer will not consider any available index on this column.
Rather use a function on the host-variable.

Example:
WHERE JULIANSTIMESTAMP(datum_kolom) = :hostvariabele
Results in a full table scan

Alternative:

WHERE datum_kolom = converttimestamp(:hostvariabele)

No comments: