![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
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. |
#6
| |||
| |||
|
|
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. |
|
Id | Operation | Name |Rows |Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ 0 | SELECT STATEMENT | | 3 | 372 | 4 (25)| 00:00:01 | * 1 | COUNT STOPKEY | | | | | | 2 | VIEW | | 5 | 620 | 4 (25)| 00:00:01 | * 3 | SORT ORDER BY STOPKEY| | 5 | 80 | 4 (25)| 00:00:01 | 4 | TABLE ACCESS FULL | PERSON | 5 | 80 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ |
#7
| |||
| |||
|
|
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. |
|
Id | Operation | Name |Rows |Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ 0 | SELECT STATEMENT | | 3 | 372 | 4 (25)| 00:00:01 | * 1 | COUNT STOPKEY | | | | | | 2 | VIEW | | 5 | 620 | 4 (25)| 00:00:01 | * 3 | SORT ORDER BY STOPKEY| | 5 | 80 | 4 (25)| 00:00:01 | 4 | TABLE ACCESS FULL | PERSON | 5 | 80 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ |
#8
| |||
| |||
|
|
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. |
|
Id | Operation | Name |Rows |Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ 0 | SELECT STATEMENT | | 3 | 372 | 4 (25)| 00:00:01 | * 1 | COUNT STOPKEY | | | | | | 2 | VIEW | | 5 | 620 | 4 (25)| 00:00:01 | * 3 | SORT ORDER BY STOPKEY| | 5 | 80 | 4 (25)| 00:00:01 | 4 | TABLE ACCESS FULL | PERSON | 5 | 80 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ |
#9
| |||
| |||
|
|
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. |
|
Id | Operation | Name |Rows |Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ 0 | SELECT STATEMENT | | 3 | 372 | 4 (25)| 00:00:01 | * 1 | COUNT STOPKEY | | | | | | 2 | VIEW | | 5 | 620 | 4 (25)| 00:00:01 | * 3 | SORT ORDER BY STOPKEY| | 5 | 80 | 4 (25)| 00:00:01 | 4 | TABLE ACCESS FULL | PERSON | 5 | 80 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ |
#10
| |||
| |||
|
|
On Thu, 23 Oct 2008 07:34:51 -0700 (PDT), sbr... (AT) yahoo (DOT) com wrote: 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. By definition all SQL prodiuces a set. The set is always an *unordered* collection *by design*, because that is mathematical theory. Ergo: Oracle does NOT guarantee any resultset is according to any order, when there is no order by clause in the top level of the query. It would be very silly to 'rely' on a specific ordering, and raises suspicions your 'productive environment' is not so productive, as it is processing a set as a bunch of records. Which it shouldn't as that wouldn't scale. -- Sybrand Bakker Senior Oracle DBA |
![]() |
| Thread Tools | |
| Display Modes | |
| |