order by question
From: <sbrkic_at_yahoo.com>
Date: Thu, 23 Oct 2008 07:34:51 -0700 (PDT)
Message-ID: <f7ab79b4-a12c-49ea-bb82-06a5c2624500@s50g2000hsb.googlegroups.com>
and rownum < 10;
Date: Thu, 23 Oct 2008 07:34:51 -0700 (PDT)
Message-ID: <f7ab79b4-a12c-49ea-bb82-06a5c2624500@s50g2000hsb.googlegroups.com>
Hi,
I wonder if following result set would be sorted according to x.z. Or
is it possible that the optimizer for some reason, based on the outer
conditions, decides to get the result unsorted because it would be
more performant.
select sub.*
from (select x from y order by x.z) sub
where ... and ... and ...
and rownum < 10;
If this works the (select x from y order by x.z ) would be a view.
I have not been able to get a resultset which is unsorted acording to x.z but need to know that this would not happen in a productive environment.
With regards
Slavko
Received on Thu Oct 23 2008 - 09:34:51 CDT