Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Query Performance: Using DECODE() instead of IN()
Guys, a question,
Which is the more effecient way of running a query:
select * from x where decode(y,'Y',1,'Q',1,0) = 1
or
select * from x where y in ('Y','Q')
I think I recall somewhere that using a decode uses an index scan where using IN() uses a full table scan, however I can't seem to prove this.
Trying to search for in and decode in google is not fun. Any ideas?
PT Received on Mon Oct 20 2003 - 09:39:28 CDT
![]() |
![]() |