Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: am I reading this SQL correctly?
Nigel,
You are right on point 1. The SQL will go through ALL the calls. My usage of the "current call" was very misleading. The users do want to go through all the calls. Analytical functions are a good idea. I'll look into that.
What I wonder also is whether this SQL is kind of a Cartesian join query in
its current design. Not a pure CJ
because we do have a join between two tables, but with a need to join each
row of table 'a' to each row
of table 'b'. If that it the case, then on a 3.9 mil rows table, this SQL
is going to run for a long time. Does
this make any sense?
thank you
Gene Gurevich
Nigel Thomas <nigel_cl_thomas@ yahoo.com> To genegurevich_at_discover.com, oracle-l 09/20/2007 11:13 <oracle-l_at_freelists.org> AM cc Subject Re: am I reading this SQL correctly?
Gene
You have identified:
A: ---- | -- | ---- | ----
B:---- | ------ | ---- | ----
but not other variants eg
A:---- | ------ | ----
B: ---- | --- | ----
(view in a monotype font or this will look silly)
5) In a procedural loop (within a pipeline function) I think you could do
this in a single pass (ordered by CALL_START_TS)
start with an empty in memory collection of calls (start time, end time,
overlap count)
for all records
- read a record
Having described that, is it possible to do the same with a analytic functions (eg WINDOW)?
HTH Regards Nigel
I am trying to tune the following SQL (in 10.2.0.3)
SELECT a.CALL_STRT_TS, count(b.Call_STRT_TS)
from IVR.IVC_IVR_CMS_CALL a, IVR.IVC_IVR_CMS_CALL where a.CALL_STRT_TS >= b.CALL_STRT_TS and a.CALL_STRT_TS <= b.CALL_END_TS
The goal of this is to count the number of calls that overlap timewise with a current call.
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Sep 20 2007 - 13:55:54 CDT