|
-
Some additional notes to additional notes....
Originally posted by Shestakov
1. sort_area --> part of PGA not UGA:
Not quite, or at least not so simple. Sort area memory is allcated partly from CGA (which is allways part of PGA) and partly from UGA (which is sometimes part of PGA and sometimes part of SGA. SORT_AREA_RETAINED_SIZE is the size of sort area that must retain its contents over session migration from one shared server to the other in MTS because this sort size might be used later for the fetch phase, so this part of sort memory is allways allocated from UGA. The actual "single sort runs" are finished in one call, so there is no need for them to be available to other processes (even in MTS mode), so they are simply allocated from PGA (up to the SORT_AREA_SIZE).
I think best resources regarding sorting can be found in Steve Adams and/or Jonathan Lewis's book and their web sites. Here are some links to their thoughts about sorting:
http://www.ixora.com.au/newsletter/2000_11.htm
http://www.ixora.com.au/q+a/0011/08114657.htm
http://www.jlcomp.demon.co.uk/faq/uga.html
Shestakov, regarding your metrics, there are some isues that are unclear.
1. It is not very clear what your pga_uga_sesssize.sql script is actually doing (although I suspect it simply queries v$sesstat for UDA nad PGA statistics) and the output is hard to read.
2. You have set your SORT_AREA_SIZE to a very large number, but you haven't give us any clue what was the size of SORT_AREA_RETAINED_SIZE when the query was run
3. What release are you using? Because your query
select 1 from (select 1 from dba_objects order by object_name) where rownum=1;
in newer releases (8i and higher) will actually not perform any ORDER BY sort! It will only perform ORDER BY STOPKEY sort, which actuall requires almost no sort size at all!
Change the query to
select count(*) from (select 1 from dba_objects order by object_name);
if you wan't to prevent a lenthy query output, that wil actually perform ORDER BY sort. Or if using sqlplus script simply use SET TERMOUT OFF or SET AUTOTRACE TRACEONLY and run simple query
select 1 from dba_objects order by object_name;
to force oracle to perform a sort.
Now, regarding the demonstration which shows in which part of memory sort is performed, here is mine, in a dedicated server mode in 9.0.1. Both SORT_AREA_SIZE and SORT_AREA_RETAINED_SIZE are set to 1M.
Code:
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> select a.name, b.value
2 from v$statname a, v$mystat b
3 where a.statistic# = b.statistic#
4 and a.name like 'session _ga%';
NAME VALUE
---------------------------------------------------------------- ----------
session uga memory 68476
session uga memory max 68476
session pga memory 221944
session pga memory max 221944
SQL> select count(*) from (select 1 from dba_objects order by object_name);
COUNT(*)
----------
28006
SQL> select a.name, b.value
2 from v$statname a, v$mystat b
3 where a.statistic# = b.statistic#
4 and a.name like 'session _ga%';
NAME VALUE
---------------------------------------------------------------- ----------
session uga memory 60008
session uga memory max 1147292
session pga memory 2318488
session pga memory max 2318488
SQL>
We can see that UGA size used for the sort was approx 1M (the size of SORT_AREA_RETAINED_SIZE) while the size of PGA increased for 2M. The first meg of PGA was used from CGA for two ore more sort runs (the size of SORT_AREA_SIZE), while the other meg is the one from UGA as explained above, which was needed for the final sort. If this was MTS configuration, then I belive both "uga memory max" and "pga memory max" wold each be raised for approx. 1M, as in that case UGA would not be part of PGA.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|