![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
For utility purposes, I have to use the like expression in the where clause. |
#4
| |||
| |||
|
|
Hello, I'm using Oracle 8i and trying to tune a sql statement that has six table joins. I have a numeric indexed column which is using 'LIKE' expression in the where clause. This expression is causing full table scans for all the six joined table. Instead, if I substitute the like with = then the response is almost instataneous. For utility purposes, I have to use the like expression in the where clause. What are my other options to explore to tune the sql statement? I would appreciate any input. |
#5
| |||
| |||
|
|
On 22 Sep 2003 09:43:22 -0700, letsconnect (AT) hotmail (DOT) com (Junaid) wrote: For utility purposes, I have to use the like expression in the where clause. No, you don't. There is no reason to use LIKE on a number column. Sybrand Bakker, Senior Oracle DBA To reply remove -verwijderdit from my e-mail address |
#6
| |||
| |||
|
|
Sybrand Bakker <gooiditweg (AT) sybrandb (DOT) demon.nl> wrote On 22 Sep 2003 09:43:22 -0700, letsconnect (AT) hotmail (DOT) com (Junaid) wrote: For utility purposes, I have to use the like expression in the where clause. No, you don't. There is no reason to use LIKE on a number column. Sybrand Bakker, Senior Oracle DBA To reply remove -verwijderdit from my e-mail address I know I don't have to but our shared client application's framework is forcing us to use it, for the time. Also, if I use numeric operator for this number column, only = utilizes the index on this column. If I use < or > then the associated index is not used. Any ideas? |
#7
| |||
| |||
|
|
"Junaid" <letsconnect (AT) hotmail (DOT) com> wrote in message news:dfb44909.0309220843.1b38843a (AT) posting (DOT) google.com... Hello, I'm using Oracle 8i and trying to tune a sql statement that has six table joins. I have a numeric indexed column which is using 'LIKE' expression in the where clause. This expression is causing full table scans for all the six joined table. Instead, if I substitute the like with = then the response is almost instataneous. For utility purposes, I have to use the like expression in the where clause. What are my other options to explore to tune the sql statement? I would appreciate any input. If the data is a number then use appropriate numeric operators =, > between etc. If the data is text then store it as text in a character column and use text operators. |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
"Niall Litchfield" <n-litchfield (AT) audit-commission (DOT) gov.uk> wrote "Junaid" <letsconnect (AT) hotmail (DOT) com> wrote in message news:dfb44909.0309220843.1b38843a (AT) posting (DOT) google.com... Hello, I'm using Oracle 8i and trying to tune a sql statement that has six table joins. I have a numeric indexed column which is using 'LIKE' expression in the where clause. This expression is causing full table scans for all the six joined table. Instead, if I substitute the like with = then the response is almost instataneous. For utility purposes, I have to use the like expression in the where clause. What are my other options to explore to tune the sql statement? I would appreciate any input. If the data is a number then use appropriate numeric operators =, > between etc. If the data is text then store it as text in a character column and use text operators. I have changed the query to use the numeric operators. But the query only uses the associated index if I use the = operator. Using any other numeric operator abandons the use of the index. Any ideas? Thanks Junaid |
|
, I surmise you do not have an exact value for your numeric value. IOW you really are looking for values within some range. |
![]() |
| Thread Tools | |
| Display Modes | |
| |