Toad World® Forums

What exactly is the benefit when || '' is added?

AND dv.cis_division = sa.cis_division || ‘’

Thanks

The Optimizer is adding || ‘’. What exactly is the benefit when ||’ ’ is being added?
Here is an example.

Hi,

Concatenating an empty string to a character based database column can prevent the use of an index on that column - in your example, an index on sa.cis_division. The benefit of disabling an index is to force the optimizer to use a different execution plan than it might not otherwise choose. In some cases, such a different plan may result in better SQL execution performance.

Regards,
Greg