Introduction to ROWID High speed paging

Source: Internet
Author: User
Tags extend
--Paging the first step to get the data physical address  
Select T.rowid RID, t.lastdate from t_test t order by t.lastdate DESC;  
      
--page Two gets the maximum number  
of pages Select RowNum RN, RID  
  from (select T.rowid RID, t.lastdate from t_test T-order by  
         T.lastdat E desc)  
 where rownum <=;  
       
 --Page Three gets the minimum number of pages  
 select Rn,rid  
   from (select RowNum RN, the RID  
           from (select T.rowid RID, t.lastdate from T_test t ORDER BY t.lastdate Desc)  
          where rownum <=  
  where rn > 5;  
        
  --page fourth and then according to the physical address, query the specific data  
  select T1.*,t1.rowid from  
    t_test T1  
   where T1.rowid in
         (select Rid  
            From (select RowNum RN, RID  
                    from (select rowID rids, t.lastdate from T_test T-order by t.lastdate Desc)  
                   where row Num <= 10000)  
           where RN > 5000);

Before 8i, ROWID consisted of file#+block#+row#, occupying 6 bytes spaces, the file# of bit, the block#,16 of bit row# bit.

Oracle's DBA (Data block address) is the bits, including the bit file# and bit block#.

The maximum number of files in Oracle 2^10-1=1023 because no 0 numbered files exist

And the maximum size that datafile can achieve is 2^22*db_block_size.

datafile Max size is 16G if db_block_size is 4k.

datafile Max size is 32G if Db_block_size is 8k.

Starting with Oracle 8, ROWID became extend rowID, composed of data_object_id#+rfile#+block#+row#, occupying 10 bytes of space,

32bit data_object_id#,10 bit rfile#,22bit block#,16 bit row#. Since rowID became file# from rfile#,

So the number of data file limits from the entire library can not exceed 1023 to each data_object_id can not exceed 1023 data files. Of course, you might want to ask,

Why does Oracle not adjust the bit number of file# in rowID, which should be caused by compatibility, stored in Oracle7 index rowID

is file# + block# + row#, because the storage of the index after such processing, Oracle8 and Oracle7 have not changed.

Although Oracle uses extend ROWID, it still stores bytes rowID in the normal index, only 10bytes is stored in global index

Extend rowID, and extend rowID is also a necessary condition for global index to appear.

1. ROWID Basic Concepts:

1 rowID is a pseudo column that is used to ensure the uniqueness of rows in a table, it does not indicate the physical location of the trip, but can be used to locate rows

2) ROWID is an established set of values stored in the index (when the row is determined). We can pick it up like a regular column in a table.

3 using ROWID is the quickest way to access a row in the table

4) rowID requires 10 bytes to store, displayed as a 18-bit string.

2. Under what circumstances will the ROWID change?

In general, ROWID does not change when the rows in the table are determined. However, the ROWID will change when the following conditions occur:

1 after a table to do the movement of the table space

2 after the exp/imp of a table

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/storage/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.