Strange block prefetch patterns in 11g

Hi.
I've detected that Oracle 11g is able to prefect blocks when using table access by index rowid. This is great for datawarehouses (DWH), but when/how Oracle uses block level prefetching is not clear.
This problem really affects performance on 11g datawareshouses as the results can be very different.
So far, where's what I've found (these results where collected for empty buffer caches):
Oracle is able to prefetch index and table blocks when doing table access by index rowid even if there's no nested loop join batching
After a tablespace being created, nested loops on table/index in the tablespace are done using single block reads (db file sequential read). This only goes away after the DB is bounced. Neither gathering statistics nor flushing buffer_cache/shared_pool solves the problem.
After the DB is bounced, when doing nested loops access by rowid, the first block of each extent is read using single block reads and the remaining of the extent is prefetched using 'db file scattered read' up to the end of the extend or DBFMRB (assuming the data is packed together sequentially in the extents)
Next time the data is requested from that extent, all data from table/index is read using db file scattered reads,  there are no longer single block reads for the extent header block.
Forcing full scans on index and tables is enough for Oracle to cache (somewhere) the extent header information. Flushing the cache/shared_pool will not invalidate that information and prefetches will read all extent wihout single block reads for the header block.
Where's how I've reproduced the problem, on Oracle 11.2.0.1.0, Windows 7 64 bits with local disks (no ASM), 8K block size, .
Creating a table+index in a 128K tablespace (each segment will have 16 blocks). The data in the table is sorted by ID, so filtering by ID will return the least number of block possible and all blocks are consecutive:
CREATE TABLESPACE TS_128K DATAFILE  'd:\ORADATA\TESTE\TS_128K_002.DBF' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128k
SEGMENT SPACE MANAGEMENT MANUAL ;
create table T tablespace TS_128K nologging as
select mod(rownum, 1e2) id, lpad('x', 1, 'x') x
from dual connect by level <= 1e6
order by id;
create index IDX_T on T(id) tablespace TS_128K nologging compress;
exec dbms_stats.gather_table_stats(user, 'T', estimate_percent=>null,method_opt=>'for all columns size 1')
Read the data from table using the index:
alter session set db_file_multiblock_read_count = 128 ;
alter system flush buffer_cache;
alter system flush shared_pool;
select count(length(x)) from T where id between 10 and 16 ;
Execution Plan
| Id  | Operation                    | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |       |     1 |     5 |   251   (1)| 00:00:04 |
|   1 |  SORT AGGREGATE              |       |     1 |     5 |            |          |
|   2 |   TABLE ACCESS BY INDEX ROWID| T     | 80606 |   393K|   251   (1)| 00:00:04 |
|*  3 |    INDEX RANGE SCAN          | IDX_T | 80606 |       |   127   (1)| 00:00:02 |
Predicate Information (identified by operation id):
   3 - access("ID">=10 AND "ID"<=16)
This is what I get when until I bounce the DB (all reads are db file sequential reads)
WAIT #11: nam='SQL*Net message to client' ela= 4 driver id=1413697536 #bytes=1 p3=0 obj#=74261 tim=96925045642
WAIT #11: nam='db file sequential read' ela= 6208 file#=7 block#=1665 blocks=1 obj#=74470 tim=96925051918
WAIT #11: nam='db file sequential read' ela= 4851 file#=7 block#=2171 blocks=1 obj#=74470 tim=96925056835
WAIT #11: nam='db file sequential read' ela= 5796 file#=7 block#=1819 blocks=1 obj#=74470 tim=96925062678
WAIT #11: nam='db file sequential read' ela= 7091 file#=7 block#=280 blocks=1 obj#=74469 tim=96925069857
WAIT #11: nam='db file sequential read' ela= 282 file#=7 block#=281 blocks=1 obj#=74469 tim=96925070204
WAIT #11: nam='db file sequential read' ela= 270 file#=7 block#=1820 blocks=1 obj#=74470 tim=96925070601
WAIT #11: nam='db file sequential read' ela= 218 file#=7 block#=282 blocks=1 obj#=74469 tim=96925070971
After I bounce the database, then it starts to read the first block using single reads and the remaining blocks on the extent using multiblock reads:
EXEC #5:c=0,e=15,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1883549804,tim=98054723327
WAIT #5: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=98054723367
WAIT #5: nam='Disk file operations I/O' ela= 72 FileOperation=2 fileno=7 filetype=2 obj#=74474 tim=98054723486
WAIT #5: nam='db file sequential read' ela= 12960 file#=7 block#=1665 blocks=1 obj#=74474 tim=98054736474
WAIT #5: nam='db file sequential read' ela= 21410 file#=7 block#=2171 blocks=1 obj#=74474 tim=98054757983
WAIT #5: nam='db file sequential read' ela= 22377 file#=7 block#=1819 blocks=1 obj#=74474 tim=98054780424
WAIT #5: nam='db file sequential read' ela= 15349 file#=7 block#=280 blocks=1 obj#=74473 tim=98054795897
WAIT #5: nam='db file scattered read' ela= 13822 file#=7 block#=281 blocks=7 obj#=74473 tim=98054809899
WAIT #5: nam='db file scattered read' ela= 488 file#=7 block#=1820 blocks=4 obj#=74474 tim=98054857456
WAIT #5: nam='db file sequential read' ela= 34925 file#=7 block#=1824 blocks=1 obj#=74474 tim=98054894002
WAIT #5: nam='db file scattered read' ela= 171842 file#=7 block#=1825 blocks=15 obj#=74474 tim=98055066371
WAIT #5: nam='db file sequential read' ela= 261 file#=7 block#=288 blocks=1 obj#=74473 tim=98055067476
WAIT #5: nam='db file scattered read' ela= 1328 file#=7 block#=289 blocks=15 obj#=74473 tim=98055069298
WAIT #5: nam='db file sequential read' ela= 24779 file#=7 block#=1840 blocks=1 obj#=74474 tim=98055098838
WAIT #5: nam='db file scattered read' ela= 1257 file#=7 block#=1841 blocks=15 obj#=74474 tim=98055100636
WAIT #5: nam='db file sequential read' ela= 24738 file#=7 block#=304 blocks=1 obj#=74473 tim=98055126180
WAIT #5: nam='db file scattered read' ela= 15299 file#=7 block#=305 blocks=15 obj#=74473 tim=98055142016
WAIT #5: nam='db file sequential read' ela= 34570 file#=7 block#=1856 blocks=1 obj#=74474 tim=98055181298
WAIT #5: nam='db file scattered read' ela= 1309 file#=7 block#=1857 blocks=15 obj#=74474 tim=98055183144
WAIT #5: nam='db file sequential read' ela= 13036 file#=7 block#=320 blocks=1 obj#=74473 tim=98055197077
If I flush the caches and ask for the same data , now the full extent is read using multiblock reads (if I change the filter on ID to read from extents that where never visited before, I'll get that single block read on header + remaining extent multiblock reads)
WAIT #6: nam='SQL*Net message to client' ela= 4 driver id=1413697536 #bytes=1 p3=0 obj#=0 tim=98237022295
WAIT #6: nam='db file sequential read' ela= 12608 file#=7 block#=1665 blocks=1 obj#=74474 tim=98237034964
WAIT #6: nam='db file sequential read' ela= 4829 file#=7 block#=2171 blocks=1 obj#=74474 tim=98237039883
WAIT #6: nam='db file scattered read' ela= 7116 file#=7 block#=1808 blocks=16 obj#=74474 tim=98237047101
WAIT #6: nam='db file scattered read' ela= 7359 file#=7 block#=272 blocks=16 obj#=74473 tim=98237054586
WAIT #6: nam='db file scattered read' ela= 1359 file#=7 block#=1824 blocks=16 obj#=74474 tim=98237057773
WAIT #6: nam='db file scattered read' ela= 1358 file#=7 block#=288 blocks=16 obj#=74473 tim=98237060271
WAIT #6: nam='db file scattered read' ela= 11341 file#=7 block#=1840 blocks=16 obj#=74474 tim=98237076799
Can anyone explain the rules for block prefetching/batching ? This is happening even without the query plan using nested loop batch joins as you can see in the plan above.
Thanks in advance.

Hi,
I don't think you should expect db file scattered read waits with TABLE ACCESS BY ROWID -- this is not the normal behavior. I think the only reason you're getting them after you bounce the database is because Oracle "sees" that the buffer cache is empty and wants to fill it using multiblock reads -- so multiblock reads don't help the performance of this particular query, rather, they're supposed to help the global database performance.
Did you measure elapsed time in both cases?
Best regards,
  Nikolay

Similar Messages

  • Block route pattern

    Hello,
    I ran the dial number analyzer and it says a router pattern is blocking the extension im trying to dial on my VOIP network.  I tried tracing what partition and calling search space might cause the blocking but cant tell.  Where in cucm on version 8 can I know the name of the router pattern that is blocking me from dial that extension?
    Thanks,

    You need to collect the detailed callmanager traces and look at the Digit Analysis ( DA ) portion. The list of partitions in the 'pss' field should contain the partition of the Route pattern and further the 'RouteBlockFlag' in the DA DA will say 'Route this pattern' or ' Block this pattern ' , here is an example
    |StationD - stationOutputActivateCallPlane tcpHandle=0x53563d0
    |Digit analysis: match(fqcn="", cn="1000", pss="", dd="")
    |Digit analysis: analysis results
    |PretransformCallingPartyNumber=1000
    |CallingPartyNumber=1000
    |DialingPartition=
    |DialingPattern=
    |DialingRoutePatternRegularExpression=
    |DialingWhere=
    |PatternType=Unknown
    |PotentialMatches=PotentialMatchesExist
    |DialingSdlProcessId=(0,0,0)
    |PretransformDigitString=
    |PretransformTagsList=
    |PretransformPositionalMatchList=
    |CollectedDigits=
    |TagsList=
    |PositionalMatchList=
    |RouteBlockFlag=BlockThisPattern
    HTH
    manish

  • Optimal NTFS block size for Oracle 11G on Windows 2008 R2 (OLTP)

    Hi All,
    We are currently setting up an Oracle 11G instance on a Windows 2008 R2 server and were looking to see if there was an optimal NTFS block size. I've read the following: http://docs.oracle.com/cd/E11882_01/win.112/e10845/specs.htm
    But it only mentioned the block sizes that can be used (2k - 16k). And basically what i got out of it, was the different block szes affect the max # of database files possible for each database.
    Is there an optimal NTFS block size for Oracle 11G OLTP system on Windows?
    Thanks in advance

    Is there an optimal NTFS block size for Oracle 11G OLTP system on Windows?ideally FS block size should be equal to Oracle tablespace block size.
    or at least be N times less than Oracle block size.
    For example - if Oracle BS=8K then NTFS BS better to be 8K but also can be 4K or 2K.
    Also both must be 1 to N times of Disk sector size. Older disks had sectors 512 bytes.
    Contemporary HDDs have internal sector size 4K. Usually.

  • Black has red lines and strange red color pattern in it!

    I have an HP Touchsmart 520 - 1030 windows 7 all in one. When I turn on my computer and the Windows icon in the middle of the screen appears what should be a black backrground behind the icon is dark red. Once it boots up completely, everything black has a strange red lines and patterns in it.
    Is there a fix for this?

    Hi Lysa13,
    You could try re-installing the graphics driver. If that doesn't work, it's possible the screen hardware could be starting to have problems.
    Here is a link to the graphics driver:
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloa​dIndex?softwareitem=cp-98005-1&cc=us&dlc=en&lc=en&​...=
    If that doesn't work, you may want to try running a screen test in the hardware diagnostics. Here is a support document that explains how to do the tests:
    http://h10025.www1.hp.com/ewfrf/wc/document?docnam​e=c02491515&cc=us&dlc=en&lc=en&product=5157108
    ...an HP employee just trying to help where I can, but not speaking on behalf of HP.

  • Strange Entries in 'Pattern Analysis' results

    I'm using the Pattern Discovery feature of Data Profiling and I'm getting strange characters in the results for Dominant Character Pattern and Dominant Word Pattern. For instance, two of the patterns returned are ^(9+)$ and ^(Aa((4))$ And the data that supposedly conforms to these patterns are simple integers or words.
    Does any one know what could be going on here? Some kind of corruption in the result set? Or am I missing how to interpret these strange entries? Thanks.

    The patterns discovered are regular expressions. Are you looking for common format discovery? If you want to know something is a number or a date or en email address look at the common format discovery (under the hood a common format may be a number of reg expression also). You will have to select 'Enable Common Format Discovery' and reprofile. The common format is another column in this pattern discover table.
    Cheers
    David

  • Initialization Blocks and Variables in 11G

    I'm trying to set up an Initialization Block and Variable so my dashboard data can be filtered by User.
    I did the following, but all the data is still being shown (instead of the data being filtered).
    - In my Repository I went to Manage - Variables
    - Under Session I created a variable 'VAR_EMPLOYEE_NUMBER'
    - Under Intialization Blocks I created 'INIT_VAR_EMPLOYEE_NUMBER' and set variable target as 'VAR_EMPLOYEE_NUMBER'
    - I added the following SQL:
    select A.employee_number
    from staff A, sis_user B
    where B.fk_staff = A.pk_id
    and B.user_name = upper(':USER')
    - When I hit the 'Test' button (offline mode). I put in the value on the USER and it returns me the appropriate employee_number, so I believe my SQL and connection info is correct.
    Am I missing something?

    As a test, I tried to add the filter to the individual user first. In the Repository I went under Manage-Identity. Clicked on my User and hit permissions button.
    I created the filter of:
    "Testing and Assessments"."Student SOL Testing"."Teacher Employee Number" = VALUEOF(NQ_SESSION."VAR_EMPLOYEE_NUMBER")
    That didn't work. I still see all data when I log in as that user. If I hard-code it to the users Employee Number (see below), it does work. What now?
    "Testing and Assessments"."Student SOL Testing"."Teacher Employee Number" = '19983758'

  • Very strange dark tall pattern stains on two Apple Cinema 20"

    First time I purchased brand new Apple Cinema HD 20" in Feb 2005 and couple of months later these dark stains starting to appear. Within two months they being spreading and made any graphical work impossible so I claimed for the replacement. Local Apple distributer has provided me with new monitor (this time it was in technical packaging, not retail).
    But half a year ago these strange dark stains appeared again.
    Two month ago I replaced my PC to the another one (sorry, I use PC, not Mac with that monitor) but the stains were unstoppable.
    The only way to reduce them a little - to don't use the monitor within few hours.
    This picture shows the stains right after power on at the morning:

    If you had said: YES, then I would have said: Have Apple fix it.
    We had a similar problem with the display on our 20-inch iMac and Apple replaced the LCD.
    I always recommend buying AppleCare for monitors as you can buy it from http://www.lacomputercompany.com/applecare.html for only $79 USD.
    ,dave

  • IMac won't boot, cursor has strange block of 'text'

    My iMac crashed during simple timeline editing in Final Cut Pro X. Upon reboot, it would get stuck at the grey apple logo screen. It would boot in safe mode, but the cursor has a mysterious square of 'text' following it around. All hardware tests indicate no problems.
    A friend who has worked on Macs for years suggested that it was a fried graphics card and that the whole logic board needed to be replaced. I ordered a logic board that claimed to be fully tested, replaced it myself, and reassembled the machine. To my shock and amazement the same exact problem presented itself: won't boot past the apple logo, and a square of 'text' is following the cursor around.
    I also reinstalled OSX 10.8.3 to no avail.
    Any suggestions for diagnostics or potential fixes would be greatly appreciated. I'm nearing my wits' end.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • More Table Blocks in 11g with same number of rows as in 9i

    I was using SQL performance analyzer to compare performance difference between 9i and 11g databases.
    For this purpose I generated a trace file in 9i database and used it to build STS in 11g database.
    After runing two trials and comparison the report showed performance regression (comparing "buffer gets") while using following SQL statement
    *"SELECT * FROM EMP";*
    There were total 14 rows in emp table in both databases( i.e 9i and 11g)
    There was no plan change for above SQL statement in 11g database but still there was performance regression in 11g.
    After querying dba_tables view for number of blocks in emp table on both sides i found that EMP table in 9i database had 1 block where as in 11g emp table had 5 blocks (Even after using alter table emp move;)
    I am unable to understand why emp table has more number of blocks in 11g with same number of rows as in 9i emp table?

    user8916506 wrote:
    Below query was executed in 9i database.
    SQL> select extent_management,initial_extent,allocation_type from dba_tablespaces where tablespace_name='SYSTEM';
    EXTENT_MAN INITIAL_EXTENT ALLOCATIO
    LOCAL 65536 SYSTEM
    Results shows that SYSTEM tablespace in 9i database is locally managed.
    Where as results of below query from 11g database is indicating that users tablespace in 11g is also locally managed.
    SQL> select extent_management,initial_extent,allocation_type from dba_tablespaces where tablespace_name='USERS';
    EXTENT_MAN INITIAL_EXTENT ALLOCATIO
    LOCAL 65536 SYSTEMGood to see that you also picked up the allocation_type at the same time.
    So you have shown that the discrepancy between 9i and 11g isn't down to the difference in extent management.
    Are there any other differences between the tablespaces when you compare 9i system with non-system, and 9i system with 11g non-system ? (Hint - we have an anomaly with space allocation.)
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Author: <b><em>Oracle Core</em></b>

  • Vision assistant steps to be followed for pattern matching

    I am acquiring color images of hands movement using web camera of laptop.
    I want to process the acquired images to use for pattern matching.
    What are the steps to be followed to achieve the above mentioned task.

    In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
    Atom
    Certified LabVIEW Associate Developer

  • Strange dotted screen at start-up

    After getting a dead video card replaced at the local AppleStore my iMac now exhibits a strange black dot pattern on white screen just before the log-in window at start up.
    The mac was returned to the store, video card replaced again, no change, they decided to replace the
    logic board. The dot pattern during start-up now appears intermittently, so I photographed it and found the pattern is the same every time.
    • See the pattern here: http://dl.dropbox.com/u/14311256/iMac%20dotted%20screen%20%3F.JPG
    The iMac seems to work OK so I am reluctant to return it to the repair shop and be landed with yet another bill. I paid £318.00 for the logic board job but feel this may have been an unnecessary expense.
    Q1. what can this dot pattern mean?
    Q2. Does it indicate a serious problem?
    Q3. Should I just live with it?

    I've got the same sort of issue and may have a solution. I noticed it would do it more regularly on startup if my Time Machine external HDD was connected and switched on before powering on the computer. By chance, I forgot to do this a few times and in those circumstances, I switched the external on after the login screen...no dotted white screen before login!
    As a result I've done this ever since and no screen issue whatsoever.
    It may be that the drive is confusing the iMac during it's startup process, although why that would affect the graphics, I don't know. It works for me, though.
    So if you have an external connected all the time, try it without it for a few weeks, only connecting it after you log in.
    If you don't have any external peripherals switched on and connected while you get this odd screen, then I'm sorry, I don't know what it could be.
    Let us know how you get on, as I'm sure there are many of us out there who would like to know what gets rid of it and what doesn't.
    If your Mac works fine other than that, I'd say it's just a glitch in the startup process that doesn't affect the computer. When I was getting the screen you describe, the iMac would operate normally, so I don't think it's anything to worry about.

  • Strange squares and stripes

    Hi,
    I just got my new mbp and it doesn't work properly.
    When I'm browsing or doing other stuff, these strange blocks appear.
    http://i52.tinypic.com/2cibbyw.png
    When I switch between windows, or something onscreen changes, I see stripes.
    Sometimes, when I try to take a screenshot of those blocks, the screenshot appears to be all black.
    What's wrong with it? DOA?
    It's up to date, restarted, and I've reset the pram.
    Thanks.
    Message was edited by: Jasperf

    AHT can't test the video cable or the LCD panel, but it does test the GPU. I would conclude, at least tentatively, from what you report that there's a problem with your LCD or its video cable.
    I would test that hypothesis by connecting an external display to the MBP. If the external display image is fine while the built-in display image acts up, the hypothesis will be confirmed.

  • Programatically extract x,y posisition found by Vision Builder pattern match

    I would like to write the cordinates found by doing pattern match to a file.  Can this be done with the Vision Builder?

    In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
    Atom
    Certified LabVIEW Associate Developer

  • Call Blocking via CUCM

    Currently we use translation profiles on our H.323 gateways and apply them to ports/dial-peers to reject specific calls coming inbound from the PSTN. I can see us getting closer to the 15 rule maximum for the translation rules and would like to know what would be the cleanest way to block specific calls from the PSTN by ANI. The only option I could think of was to create a different translation pattern for each with the route option "block this pattern"  We are currently on call manager ver. 8.6.2.23900-10. Thanks!!

    James:
    Very interesting, thanks for the reply.  We are running IOS Version 15.2(4)M4 on our 3925Es.  Good to know this version of code supports more rules.  I am still going to look into doing what Jaime and Dennis suggested as I would like to have a central location to manage call blocking.  Thanks!!

  • Dirty Blocks

    Hi everybody,
    What are dirty blocks and I've read somewhere that Database Buffer Cache will send
    file id,block id,pattern to Redo's why it will send.
    Cheers,
    Sailesh

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/memory.htm#sthref1271

Maybe you are looking for