Oracle NVL and NULL: Performance considerations

A recent query I had to tune had a WHERE clause similar to this: where t.myno = 1 and t.jz1 not in(3,4,5)           and (nvl(t.amount,0) != 0)           and nvl(t.status,'!') != 'J' Notice the NVL functions.  Let’s look at the first one. nvl(t.amount,0) != 0 In...

NOCACHE sequences come at a cost

Every so often I will look at an AWR report for a slow system, and updates to the data dictionary table SEQ$ will show up as a top resource consumer.  This is usually because sequences are defined using NOCACHE.  In this post we show why this matters and how to avoid...