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

Home -> Community -> Usenet -> c.d.o.server -> Re: Poor hash Join performance

Re: Poor hash Join performance

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 27 Jan 2001 08:32:39 -0000
Message-ID: <980584173.17940.0.nnrp-07.9e984b29@news.demon.co.uk>

As a very general guideline, a hash join is better when one of the tables is going to return a much smaller result set than the other table, and a sort/merge is better when the two tables are going to return similar volumes of data.

The ideal for a hash join is that Oracle should be able to turn the first data set into an in-memory hash of 2^N buckets. Where this cannot happen it is sometimes possible for a relatively small change in the hash_area_size and hash read size (I've can't remember the exact name) to make a huge
difference in performance. There is a brief note about this on my web site in the Addenda to Appendix C of the book, but I will be writing up a detailed example eventually.

--
Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases

Publishers:  Addison-Wesley
More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html



cshelt_at_acxiom.com wrote in message <94sn7j$cf3$1_at_nnrp1.deja.com>...

>Hi all-
>
>I am extracting from and Oracle DB that is not running parallel
>server. I've noticed that Merge/Sort Joins are running at fair speeds
>while Hash joins are running insanely slow (1.5 million table and 2.5
>million table was going to take around 60 hours for hash and 1 hour for
>Merge). Here are some of the parameters
>
>Hash_Area_Size =20 meg
>Sort_Area_Size = 10 meg
>Hash_Multiblock_IO_count = 16 db_file_multiblock_read_count = 32
>db_block_size = 16k
>
>Is there anything else that might cause such a large difference in
>performance?
>
>
>Sent via Deja.com
>http://www.deja.com/
Received on Sat Jan 27 2001 - 02:32:39 CST

Original text of this message

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