Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Which one is faster?

Re: Which one is faster?

From: Chris \( Val \) <chrisval_at_bigpond.com.au>
Date: Wed, 7 Jul 2004 22:07:07 +1000
Message-ID: <2l27beF7neelU1@uni-berlin.de>

"Tony" <andrewst_at_onetel.net.uk> wrote in message news:c0e3f26e.0407070330.592c8012_at_posting.google.com... | "Oracle Newbie" <f93c0532_at_yahoo.com> wrote in message news:<2l1dfuF7cgu4U1_at_uni-berlin.de>...
| > "Sybrand Bakker" <sybrandb_at_hccnet.nl> wrote in message
| > news:phvme0p53ds1h41i8efbgmlqjqj034d6pq_at_4ax.com...
| > > On Wed, 7 Jul 2004 09:32:24 +0500, "Oracle Newbie"
| > > <f93c0532_at_yahoo.com> wrote:
| > >
| > > >I have a string of thousands of characters and I want to check if it ends
| > > >with '>>' There are 2 ways of doing it ( or more maybe)

[snip]

| > How can I test for speed? I'm using Toad 7.6

|
| 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> /

[snip]

Are bind variables of any help for this kind of situation ?

Cheers.
Chris Val Received on Wed Jul 07 2004 - 07:07:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US