Home » RDBMS Server » Server Administration » How Oracle Read blocks (9i,windows)
How Oracle Read blocks [message #289717] Tue, 25 December 2007 21:20 Go to next message
lzfhope
Messages: 69
Registered: July 2006
Member
hi,
In a windows os system,How oracle Read Blocks of a table?
Given a sql like this : "select * from Test_Table" .Test_Table is a table object .
Suppose that ,the table test_table has 10 extents and each extent has 10 blocks .Which order will the oracle use to read this blocks?
Re: How Oracle Read blocks [message #289720 is a reply to message #289717] Tue, 25 December 2007 21:48 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Which order will the oracle use to read this blocks?
It depends.
Why does it matter to you the order in which the locks are read?
Re: How Oracle Read blocks [message #289748 is a reply to message #289720] Wed, 26 December 2007 00:30 Go to previous messageGo to next message
lzfhope
Messages: 69
Registered: July 2006
Member
Under greatly parts of circumstances,i do not care the orders,
But,sometimes this decides order of the query result .
Assume the table has records like these below:
1 ,100
2 ,300
3 ,400
4 ,600
.....
n ,n*100
------
I want that the output will list in order.So the order of reading blocks is important.
Maybe ,somebody say why not using "order by".Yeah,Using the "order by" clause , the oracle will produce the necessary result. But ,I do not want to use the "order by" clause ,neithor the sorted index.

Re: How Oracle Read blocks [message #289762 is a reply to message #289748] Wed, 26 December 2007 01:20 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

THE ONLY WAY TO GET A SPECIFIC ORDER IS TO USE "ORDER BY" CLAUSE.

This is a definitive rule.
I already posted examples that show that extents may be read in random fashion.

Regards
Michel

Previous Topic: What is the error?
Next Topic: opatch help
Goto Forum:
  


Current Time: Sat Nov 30 01:25:08 CST 2024