Mailing List
Home
Forum Home
Oracle List - by freelists.org
Oracle on SUSE Linux - Runing Oracle on SUSE Linux
Oracle database error code ...
www.freelists.org
Subjects
ORA 12540: TNS:internal limit restriction exceeded
ORA 12838 please : Is possible to append two times to the same table befo
ORA 12838 please : Is possible to append two times to the same table before
ora 04031
ora 12500 on windows
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 01925: maximum of 30 enabled roles exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ora 12500 on windows
ORA 01650, one idea
ORA 01650
ORA 4030
ORA 12838 please : Is possible to append two times to thesametable before do
ORA 12838 please : Is possible to append two times to thesame table before d
ORA 01536
ORA 03113 end of file on communication channel
ORA 32004: obsolete and/or deprecated parameter(s) specified
ORA 00600:
ORA 00020: maximum number of processes (%s) exceeded
ORA 01925: maximum of 30 enabled roles exceeded
ORA 3113 while creating a cluster database 9201 RAC on Linux with OCFS
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 01650, one idea
ora 12500 on windows
ora 12500 on windows
ora 12500 on windows
ORA 2000 Error Using DBMS STATS GATHER SCHEMA STATS
ORA 01650, one idea
ORA 01650, one idea
ORA 01650, one idea
ORA 01650
ORA 01650
Subject: ora 01031
ORA 4030
ORA 4030
ORA 06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
Subject: Re: ORA 01722 invalid number
 
How a sort works?

How a sort works?

2007-12-01       - By Finn Jorgensen

 Back
Reply:     1     2  

What I often times do when I run into this is I wrap the statement including
the order by in a select count(*) from () like this :

select count(*) from (
select... original SQL
order by ...
)

and make sure the explain plan is the same. Whether that statement is fast
and slow, you'll know if the problem is the sort or the data return to the
client. Then you can act accordingly, or at least tell the customer what's
going on.

Finn

On Nov 30, 2007 5:45 PM, <DEEDSD@(protected)> wrote:

>
> First, allow me to apologize for our Lotus Notes throwing my ID in all
> caps.  If someone knows how to turn that annoyance off, please tell me!
>
> We have a fairly sizeable sort order-by (1.2 million rows).
>  V$session_longops shows that it takes a massive amount of time in this
> step.  I have traced the session with 10046.  I am working on tracing this
> with 10032 and 10033 events turned on, as well as statistics_level=all so I
> can get timings in the stat lines.
>
> I see a big long fetch, then a bunch (190) repetitions of more data to
> client of around 2,000 bytes (all but one are of short duration), with some
> direct path reads sprinkled in.  I see a more data to client of a very long
> duration (in the middle of the 190), more of short duration, and then
> another long fetch (these steps repeat).
>
>
> It looks like the really long "more data to client" time is suspiciously
> close to the fetch e - c time.
>
> The way I'm thinking is this:  Oracle sorts some of the data, building a
> partial resultset, spews a bunch or rows off to the client, and waits for
> some sort output buffer to clear before throwing more rows into it.  The c
> time in the fetch is primarily sort time, and v$session longops is
> attributing all the time to the sort, in a rather misleading fashion.  The
> bottleneck is really how much data the client can take.  Am I correct in
> this line of thinking?  I'm also not sure what the long-duration more data
> to client is telling me.
>
> Solaris 5.10, Oracle 9.2.0.8
>
> <snip>
> WAIT #3: nam='SQL*Net more data to client' ela= 19 p1=1413697536 p2=2000
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 84 p1=1413697536 p2=2001
> p3=0
> WAIT #3: nam='direct path read' ela= 104 p1=203 p2=16661 p3=1
> WAIT #3: nam='SQL*Net more data to client' ela= 148379 p1=1413697536
> p2=2001 p3=
> 0
> WAIT #3: nam='SQL*Net more data to client' ela= 22 p1=1413697536 p2=2003
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 33 p1=1413697536 p2=2005
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 38 p1=1413697536 p2=1997
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 35 p1=1413697536 p2=2004
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 36 p1=1413697536 p2=1996
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 31 p1=1413697536 p2=2003
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 32 p1=1413697536 p2=2002
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 28 p1=1413697536 p2=1998
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 28 p1=1413697536 p2=2001
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 36 p1=1413697536 p2=2001
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 29 p1=1413697536 p2=2005
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 30 p1=1413697536 p2=1997
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 29 p1=1413697536 p2=2002
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 45 p1=1413697536 p2=2000
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 30 p1=1413697536 p2=2001
> p3=0
> WAIT #3: nam='SQL*Net more data to client' ela= 37 p1=1413697536 p2=2006
> p3=0
> FETCH
> #3:c=80000,e=223197,p=48,cr=0,cu=0,mis=0,r=10000,dep=0,og=3,tim=3397704949
> 096
> *** 2007-11-27 14:27:24.028
> WAIT #3: nam='SQL*Net message from client' ela= 55007450 p1=1413697536
> p2=1 p3=0
>
>

<div>What I often times do when I run into this is I wrap the statement
including the order by in a select count(*) from () like this :</div>
<div>&nbsp;</div>
<div>select count(*) from (</div>
<div>select... original SQL</div>
<div>order by ...</div>
<div>)</div>
<div>&nbsp;</div>
<div>and make sure the explain plan is the same. Whether that statement is fast
and slow, you&#39;ll know if the problem is the sort or the data return to the
client. Then you can act accordingly, or at least tell the customer what&#39;s
going on.
</div>
<div>&nbsp;</div>
<div>Finn<br><br></div>
<div class="gmail_quote">On Nov 30, 2007 5:45 PM, &lt;<a href="mailto:DEEDSD
@(protected)">DEEDSD@(protected)</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0
.8ex; BORDER-LEFT: #ccc 1px solid"><br><font face="sans-serif" size="2">First,
allow me to apologize for our Lotus Notes throwing my ID in all caps. &nbsp;If
someone knows how to turn that annoyance off, please tell me!
</font> <br><br><font face="sans-serif" size="2">We have a fairly sizeable sort
order-by (1.2 million rows). &nbsp;V$session_longops shows that it takes a
massive amount of time in this step. &nbsp;I have traced the session with 10046
. &nbsp;I am working on tracing this with 10032 and 10033 events turned on, as
well as statistics_level=all so I can get timings in the stat lines.
</font> <br><br><font face="sans-serif" size="2">I see a big long fetch, then a
bunch (190) repetitions of more data to client of around 2,000 bytes (all but
one are of short duration), with some direct path reads sprinkled in. &nbsp;I
see a more data to client of a very long duration (in the middle of the 190),
more of short duration, and then another long fetch (these steps repeat).
</font> <br><br><br><font face="sans-serif" size="2">It looks like the really
long &quot;more data to client&quot; time is suspiciously close to the fetch e
- c time.</font> <br><br><font face="sans-serif" size="2">The way I&#39;m
thinking is this: &nbsp;Oracle sorts some of the data, building a partial
resultset, spews a bunch or rows off to the client, and waits for some sort
output buffer to clear before throwing more rows into it. &nbsp;The c time in
the fetch is primarily sort time, and v$session longops is attributing all the
time to the sort, in a rather misleading fashion. &nbsp;The bottleneck is
really how much data the client can take. &nbsp;Am I correct in this line of
thinking? &nbsp;I&#39;m also not sure what the long-duration more data to
client is telling me.
</font> <br><br><font face="sans-serif" size="2">Solaris 5.10, Oracle <a href=
"http://9.2.0.8/" target="_blank">9.2.0.8</a></font> <br><br><font face="sans
-serif" size="2">&lt;snip&gt;</font> <br><font face="sans-serif" size="2">
WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 19 p1=1413697536 p2
=2000 p3=0</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net
more data to client&#39; ela= 84 p1=1413697536 p2=2001 p3=0</font>
<br><font face="sans-serif" size="2">WAIT #3: nam=&#39;direct path read&#39;
ela= 104 p1=203 p2=16661 p3=1</font> <br><font face="sans-serif" size="2">WAIT
#3: nam=&#39;SQL*Net more data to client&#39; ela= 148379 p1=1413697536 p2=2001
p3=
</font> <br><font face="sans-serif" size="2">0</font> <br><font face="sans
-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 22 p1
=1413697536 p2=2003 p3=0</font> <br><font face="sans-serif" size="2">
WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 33 p1=1413697536 p2
=2005 p3=0</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net
more data to client&#39; ela= 38 p1=1413697536 p2=1997 p3=0</font>
<br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to
client&#39; ela= 35 p1=1413697536 p2=2004 p3=0</font> <br><font face="sans
-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 36 p1
=1413697536 p2=1996 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 31 p1=1413697536 p2=2003 p3=0</font> <br><font face=
"sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 32
p1=1413697536 p2=2002 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 28 p1=1413697536 p2=1998 p3=0</font> <br><font face=
"sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 28
p1=1413697536 p2=2001 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 36 p1=1413697536 p2=2001 p3=0</font> <br><font face=
"sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 29
p1=1413697536 p2=2005 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 30 p1=1413697536 p2=1997 p3=0</font> <br><font face=
"sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 29
p1=1413697536 p2=2002 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 45 p1=1413697536 p2=2000 p3=0</font> <br><font face=
"sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more data to client&#39; ela= 30
p1=1413697536 p2=2001 p3=0
</font> <br><font face="sans-serif" size="2">WAIT #3: nam=&#39;SQL*Net more
data to client&#39; ela= 37 p1=1413697536 p2=2006 p3=0</font> <br><font face=
"sans-serif" size="2">FETCH #3:c=80000,e=223197,p=48,cr=0,cu=0,mis=0,r=10000,dep
=0,og=3,tim=3397704949
</font> <br><font face="sans-serif" size="2">096</font> <br><font face="sans
-serif" size="2">*** 2007-11-27 14:27:24.028</font> <br><font face="sans-serif"
size="2">WAIT #3: nam=&#39;SQL*Net message from client&#39; ela= 55007450 p1
=1413697536 p2=1 p3=0
</font> <br><br></blockquote></div><br>