View previous topic :: View next topic
|
Author |
Message |
prasadplease
New User
Joined: 02 Sep 2006 Posts: 31 Location: Mumbai
|
|
|
|
Hi below is my query...it is taking a lot of time...can anyone suggest ways to optimise this query
select a,b,c,d
from view1
where digits(a*10 + b) in (:t1, :t2, :t3)
order by a,b,c,d
Thanks. |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Try to avoid calculations in the query. It may yield better results if you break it down to two queries. |
|
Back to top |
|
|
rajnikantvanpratiwar
New User
Joined: 01 Jul 2009 Posts: 5 Location: Pune
|
|
|
|
check once whether you are using index part in you query or not and if not then try using it so tht query retrieves data in fast way.... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
why not make t1, t2 and t3 non-char datatype?
the digits scalar function should be removed. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Try not to use calculations in where clause ...
Code: |
select a,b,c,d from (
select a,b,c,d, digits(a*10 + b) as s
from view1 ) as a
where s in (:t1, :t2, :t3)
order by a,b,c,d
|
|
|
Back to top |
|
|
|