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: hash join extremely slow

Re: hash join extremely slow

From: Gints Plivna <gints.plivna_at_gmail.com>
Date: Mon, 18 Dec 2006 22:47:43 +0200
Message-ID: <6e49b6d00612181247g316e82a7r5ed76dda84090b53@mail.gmail.com>


Look if the hash join isn't actually doing something behind the scenes. All long operations like Table scan, Hash join, Sort output can do many other things behind the scenes.
For example for hash joins you can write a cursor that is doing hash join and you see the hash join in v$session_longops. But in the cursor you can do infinite other things.

So the simple example is
CURSOR c IS
SELECT *
FROM a, b
WHERE a.id = b.id;
FOR i in c LOOP
  do whatever you like here that takes hours and hours END LOOP; I doubt that your box is soooooooooooooo overloaded that a simple hash join without any other extra work can work so long. And BTW these sequential reads point that you have probably some other logic inside the cursor.

Gints Plivna
http://www.gplivna.eu

2006/12/18, LS Cheng <exriscer_at_gmail.com>:
> Hi
>
> To my surprise it is not reading the temporary tablespace, it is doing db
> file sequential read.
>
> However my point is why almos 5 hours is needed to perform a 75789 block
> hash join!
>
> TIA
>
> --
> LSC
>
>
>
> On 12/18/06, Michael McMullen <ganstadba_at_hotmail.com> wrote:
> > I would guess it's writing out to disk. What does v$sort_usage show?
> > --
> > http://www.freelists.org/webpage/oracle-l
> >
> >
> >
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Dec 18 2006 - 14:47:43 CST

Original text of this message

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