Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Merge join cartesian

RE: Merge join cartesian

From: Siva_Chintalapati <Siva_Chintalapati_at_satyam.com>
Date: Wed, 2 Aug 2000 15:21:28 +0530
Message-Id: <10577.113563@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFFC67.38636F80
Content-Type: text/plain

Hi,
How toanalize in this way.How will we get the output as
> Statistics
> ----------------------------------------------------------
> 17 recursive calls
> 238 db block gets
> 180267 consistent gets
> 69442 physical reads
> 0 redo size
> 32982 bytes sent via SQL*Net to client
> 1413 bytes received via SQL*Net from client
> 30 SQL*Net roundtrips to/from client
> 2 sorts (memory)
> 1 sorts (disk)
> 298 rows processed

.

        Can U pl give me the syntax.

Regards
Siva

> ----------
> From: ARUN K C[SMTP:arun_k_c_at_hotmail.com]
> Reply To: ORACLE-L_at_fatcity.com
> Sent: Wednesday, August 02, 2000 4:15 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Merge join cartesian
>
> Hello all,
> I have a particular query down below which is doing a Merge join Cartesian
>
> on one of the tables below
> Can somebody please let me know how to solve this issue
> The Table Bl_trans has 10 million rows and the bl_order has 3 million rows
>
> and the bl_billing_date has only one row
> select /*+ / substr(bl.fulfilling_florist,1,8) ,
> substr(bl.sending_florist,1,8) ,
> substr(to_char(bl.delivery_date,'mmddyy'),1,6) ,
> substr(upper(bl.to_last_name),1,3) ,
> 'ordr' ,
> to_char(bl.order_value *100,'000000000') ,
> to_char(bl.h_order_number,'0000000') ,
> lpad(substr(bl.internal_po,1,10),10,0) ,
> to_char(bl.inwire_seq_no,'00000') ,
> '00000000' ,
> bl.h_sequence_no
> from flowers.bl_order bl,
> bl_billing_dates dt
> where bl.h_order_number=bt.h_order_number
> and MESSAGE_TYPE=6 AND bl.delivery_date
> between dt.from_date and dt.to_date
> and bl.message_type = 0
> and bl.wire_service = 'AFS'
> Down below is the Explain plan
> Execution Plan
> ----------------------------------------------------------
> 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=223955 Card=171 Byte
> s=33516)
>
> 1 0 NESTED LOOPS (Cost=223955 Card=171 Bytes=33516)
> 2 1 MERGE JOIN (CARTESIAN) (Cost=19211 Card=68248 Bytes=3002
> 912)
>
> 3 2 TABLE ACCESS (FULL) OF 'BL_BILLING_DATES' (Cost=1 Card
> =1 Bytes=18)
>
> 4 2 SORT (JOIN)
> 5 4 TABLE ACCESS (BY ROWID) OF 'BL_TRANS'
> 6 5 INDEX (RANGE SCAN) OF 'BLT_MT' (NON-UNIQUE)
> 7 1 TABLE ACCESS (BY ROWID) OF 'BL_ORDER'
> 8 7 INDEX (RANGE SCAN) OF 'BLO_ONUM' (NON-UNIQUE)
>
>
>
>
> Statistics
> ----------------------------------------------------------
> 17 recursive calls
> 238 db block gets
> 180267 consistent gets
> 69442 physical reads
> 0 redo size
> 32982 bytes sent via SQL*Net to client
> 1413 bytes received via SQL*Net from client
> 30 SQL*Net roundtrips to/from client
> 2 sorts (memory)
> 1 sorts (disk)
> 298 rows processed
>
> Thanks in Advance
> Arun
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> --
> Author: ARUN K C
> INET: arun_k_c_at_hotmail.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

------_=_NextPart_001_01BFFC67.38636F80
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2650.12">
<TITLE>RE: Merge join cartesian</TITLE>
</HEAD>
<BODY>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Hi,</FONT> <BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">How toanalize in = this way.How will we get the output as</FONT>

<UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">Statistics</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">---------------------------------------------------------=
-</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 17&nbsp; recursive calls</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 238&nbsp; db = block gets</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 180267&nbsp; = consistent gets</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 69442&nbsp; physical reads</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0&nbsp; redo size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 32982&nbsp; bytes sent via SQL*Net to client</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1413&nbsp; bytes received via SQL*Net from client</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 30&nbsp; SQL*Net roundtrips to/from client</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 2&nbsp; sorts (memory)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1&nbsp; sorts (disk)</FONT>
</UL>
<P><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 298&nbsp; = rows processed</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">.</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT COLOR=3D"#0000FF" = SIZE=3D2 FACE=3D"Arial">Can U pl give me the syntax.</FONT> </P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Regards</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Siva</FONT>
</P>
<UL>
<P><FONT SIZE=3D1 FACE=3D"MS Sans Serif">----------</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"MS Sans Serif">From:</FONT></B> &nbsp; =
<FONT SIZE=3D1 FACE=3D"MS Sans Serif">ARUN K =
C[SMTP:arun_k_c_at_hotmail.com]</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"MS Sans Serif">Reply To:</FONT></B> = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D1 FACE=3D"MS Sans = Serif">ORACLE-L_at_fatcity.com</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"MS Sans Serif">Sent:</FONT></B> &nbsp; = <FONT SIZE=3D1 FACE=3D"MS Sans Serif">Wednesday, August 02, 2000 4:15 = AM</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"MS Sans Serif">To:</FONT></B> = &nbsp;&nbsp;&nbsp; <FONT SIZE=3D1 FACE=3D"MS Sans Serif">Multiple = recipients of list ORACLE-L</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"MS Sans Serif">Subject:</FONT></B> = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D1 FACE=3D"MS Sans = Serif">Merge join cartesian</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hello all,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">I have a particular query down below = which is doing a Merge join Cartesian </FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">on one of the tables below</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">Can somebody please let me know how = to solve this issue</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">The Table Bl_trans has 10 million = rows and the bl_order has 3 million rows </FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">and the bl_billing_date has only one = row</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">select /*+ / = substr(bl.fulfilling_florist,1,8) ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = substr(bl.sending_florist,1,8) ,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = substr(to_char(bl.delivery_date,'mmddyy'),1,6) ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = substr(upper(bl.to_last_name),1,3) ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 'ordr' ,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = to_char(bl.order_value *100,'000000000') ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = to_char(bl.h_order_number,'0000000')&nbsp; ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = lpad(substr(bl.internal_po,1,10),10,0) ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = to_char(bl.inwire_seq_no,'00000') ,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = '00000000' ,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = bl.h_sequence_no</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">from flowers.bl_order bl,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; = bl_billing_dates dt</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; where = bl.h_order_number=3Dbt.h_order_number</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">and&nbsp; MESSAGE_TYPE=3D6 AND = bl.delivery_date</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">between dt.from_date and dt.to_date</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">and bl.message_type =3D 0</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">and bl.wire_service =3D 'AFS'</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Down below is the Explain plan</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Execution Plan</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">---------------------------------------------------------=
-</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT STATEMENT Optimizer=3DCHOOSE = (Cost=3D223955 Card=3D171 Byte</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = s=3D33516)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; = 0&nbsp;&nbsp; NESTED LOOPS (Cost=3D223955 Card=3D171 = Bytes=3D33516)</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; = 1&nbsp;&nbsp;&nbsp;&nbsp; MERGE JOIN (CARTESIAN) (Cost=3D19211 = Card=3D68248 Bytes=3D3002</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 912)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp; = 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TABLE ACCESS (FULL) OF = 'BL_BILLING_DATES' (Cost=3D1 Card</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = =3D1 Bytes=3D18)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp; = 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SORT (JOIN)</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp; = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TABLE ACCESS (BY = ROWID) OF 'BL_TRANS'</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp; = 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INDEX = (RANGE SCAN) OF 'BLT_MT' (NON-UNIQUE)</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp; = 1&nbsp;&nbsp;&nbsp;&nbsp; TABLE ACCESS (BY ROWID) OF 'BL_ORDER'</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp; = 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INDEX (RANGE SCAN) OF 'BLO_ONUM' = (NON-UNIQUE)</FONT>

</P>
<BR>
<BR>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Statistics</FONT> <BR><FONT SIZE=3D2 =

FACE=3D"Arial">---------------------------------------------------------=
-</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 17&nbsp; recursive calls</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 238&nbsp; db = block gets</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 180267&nbsp; = consistent gets</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 69442&nbsp; physical reads</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0&nbsp; redo size</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 32982&nbsp; bytes sent via SQL*Net to client</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1413&nbsp; bytes received via SQL*Net from client</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 30&nbsp; SQL*Net roundtrips to/from client</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 2&nbsp; sorts (memory)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1&nbsp; sorts (disk)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 298&nbsp; = rows processed</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks&nbsp; in Advance</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Arun</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">_________________________________________________________=
_______________</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Get Your Private, Free E-mail from = MSN Hotmail at</FONT><U> <FONT COLOR=3D"#0000FF" SIZE=3D2 = FACE=3D"Arial"><A HREF=3D"http://www.hotmail.com" = TARGET=3D"_blank">http://www.hotmail.com</A></FONT></U> </P>
<P><FONT SIZE=3D2 FACE=3D"Arial">-- </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Author: ARUN K C</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; INET: =
arun_k_c_at_hotmail.com</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Fat City Network = Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) = 538-5051</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">San Diego, = California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT SIZE=3D2 =

FACE=3D"Arial">---------------------------------------------------------=
-----------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">To REMOVE yourself from this mailing = list, send an E-Mail message</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">to: ListGuru_at_fatcity.com (note EXACT = spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the message BODY, include a line = Received on Wed Aug 02 2000 - 04:51:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US