简体   繁体   中英

Oracle Nvl and to_char function

Now, I have to modify a SQL in proc, the only revision is to add a column in select clause with nvl and to_char function, no modification in the where clause.
My question is that, is this modification can cause any performance issue?

The SQL demo is like below:

original SQL:

Select a.c1, b.c2 from a, b where a.c3=b.c4

After modify:

Select a.c1, b.c2, nvl(to_char(b.c5,'FM00000000'), '.       ') As c5 from a, b where a.c3=b.c4

Thanks

This change is unlikely to cause noticable performance degradation.

The most costly part of the oracle query will be the selection of data as specified by your join and where clause. You are not changing that. Your number of rows returned will be the same. There will be a very slight cost per row returned caused by the two function calls and the slightly more data returned per row, but this is probably negligable compared to row selection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM