|
| Actually, the LIKE version is faster (on 8.1.7.3.0 anyway). To get
| accurate timings, use SQL_TRACE and TKPROF and look at the CPU
| timings. But in this case the difference is so dramatic you can see
| it using SET TIMING ON in SQL Plus (presumably Toad has a similar
| function?):
|
| SQL> -- Large table I happen to have to hand:
| SQL> select count(*) from sdd_elements;
|
| COUNT(*)
| ----------
| 1703608
|
| SQL> set timing on
| SQL> -- Using LIKE:
| SQL> select count(*)
| 2 from sdd_elements
| 3 where el_name like '%NS';
|
| COUNT(*)
| ----------
| 8031
|
| real: 5562
| SQL> -- Again
| SQL> /