Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Urgent help need for SQL statement tuning
I have the following problem: I have a Customer table and an Order table, both with
customer_id to join on. I write the following statement.
select a.customer_id
from customer a, order b
where a.customer_id=b.customer_id and
b.rec_date between '01-JUN-98' and '31-JUN-98' and a.Country_cd = 1 and a.state_cd in ('NC','SC','VA','MD','FL')
when the where clause contains references to Customer and Order it takes for ever to run. If the where clause has only Customer or only Order references, it comes back immediately. Both tables have about 250,000 records. I am missing something. respond to johnj_at_dbbasics.com or news.
John Jones
DB Basics Inc.
johnj_at_dbbasics.com
Received on Thu Jun 18 1998 - 13:27:57 CDT
![]() |
![]() |