performance - Can anyone explain how the oracle "hash group" works? -


i've come across feature of doing large query in oracle, changing 1 thing resulted in query used take 10 minutes taking 3 hours.

to briefly summarise, store lot of coordinates in database, each coordinate having probability. want 'bin' these coordinates 50 metre bins (basically round coordinate down nearest 50 metres) , sum probability.

to this, part of query 'select x,y,sum(probability) .... group x,y'

initially storing large number of points probability of 0.1 , queries running reasonably ok, taking 10 minutes each one.

then had request change how probabilities calculated adjust distribution, rather of them being 0.1, different values (e.g. 0.03, 0.06, 0.12, 0.3, 0.12, 0.06, 0.03). running same query resulted in queries of 3 hours.

changing 0.1 brought queries 10 minutes.

looking @ query plan , performance of system, looked problem 'hash group' functionality designed speed grouping in oracle. i'm guessing creating hash entries each unique x,y,probability value , summing probability each unique x,y value.

can explain behaviour better?

additional info

thanks answers. allowed me verify going on. i'm running query , tempseg_size v$sql_workarea_active @ 7502561280 , growing rapidly.

given development server i'm running on has 8gb of ram, looks query needs use temporary tables.

i've managed workaround changing types of queries , precalculating of information.

hash group (and hash joins, other operations such sorts etc.) can use either optimal (i.e. in-memory), one-pass or multi-pass methods. last 2 methods use temp storage , slower.

by increasing number of possible items might have exceeded number of items fit in memory reserved type of operations.

try looking @ v$sql_workarea_active whilst query running, see if case. or @ v$sql_workarea historical information. give indication of how memory and/or temp space needed operation.

if turns out actual problem - try increasing pga_aggregate_target initialization parameter, if possible. amount of memory available optimal hash/sort operations around 5% fraction of pga_aggregate_target.

see performance tuning guide more detail.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -