Consistent Gets Doubt

Hello,
Consistent Gets

Aman.... wrote:
Well, as I said before, there is an overhead that would be always there, ALWAYS, when you would be reading the data from the table and this would be there with per execution! What does this mean that whenever you would read the data of the query, oracle would read the extent map of the table and for this , would incur additional ios and then will start fetching the data of the table. This overhead is going to be there when you have the data or won't have the data in the table. See the below demo and tell me what you have understood, forget your demo for a moment,I understood the point that there will ALWAYS be overhead but I am trying to find out how much of the total work is overhead.
Not sure what you are trying to show with your demo. It is similar to my test case except with more data spread over multiple blocks (which I want to avoid)
So here is your demo, executed on my environment
SQL> select * from v$version ;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE     10.2.0.1.0     Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> drop table t_new purge ;
Table dropped.
SQL> create table t_new(a number) ;
Table created.
SQL> exec dbms_stats.gather_table_stats(user, 'T_NEW') ;
SQL> exec hr.show_space('T_NEW','HR') ;
Unformatted Blocks .....................            0
FS1 Blocks (0-25)  .....................            0
FS2 Blocks (25-50) .....................            0
FS3 Blocks (50-75) .....................            0
FS4 Blocks (75-100).....................            0
Full Blocks        .....................            0
Total Blocks............................            8
Total Bytes.............................       65,536
Total MBytes............................            0
Unused Blocks...........................            5
Unused Bytes............................       40,960
Last Used Ext FileId....................            6
Last Used Ext BlockId...................          169
Last Used Block.........................            3
PL/SQL procedure successfully completed.
SQL> set autotrace traceonly statistics
SQL> select * from t_new ;
no rows selected
Statistics
          1  recursive calls
          0  db block gets
          3  consistent gets
          0  physical reads
          0  redo size
        270  bytes sent via SQL*Net to client
        374  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          0  rows processed
SQL> /
no rows selected
Statistics
          0  recursive calls
          0  db block gets
          3  consistent gets
          0  physical reads
          0  redo size
        270  bytes sent via SQL*Net to client
        374  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          0  rows processed
SQL> select count(*) from t_new ;
Statistics
          1  recursive calls
          0  db block gets
          3  consistent gets
          0  physical reads
          0  redo size
        410  bytes sent via SQL*Net to client
        385  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL> /
Statistics
          0  recursive calls
          0  db block gets
          3  consistent gets
          0  physical reads
          0  redo size
        410  bytes sent via SQL*Net to client
        385  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL> set autotrace off
SQL> begin
  2  for i in 1..1000 loop
  3    insert into t_new values (i);
  4  end loop;
  5  end;
  6  /
PL/SQL procedure successfully completed.
SQL> commit ;
Commit complete.
SQL> exec dbms_stats.gather_table_stats(user, 'T_NEW') ;
PL/SQL procedure successfully completed.
SQL> exec hr.show_space('T_NEW','HR') ;
Unformatted Blocks .....................            0
FS1 Blocks (0-25)  .....................            0
FS2 Blocks (25-50) .....................            0
FS3 Blocks (50-75) .....................            0
FS4 Blocks (75-100).....................            4
Full Blocks        .....................            1
Total Blocks............................            8
Total Bytes.............................       65,536
Total MBytes............................            0
Unused Blocks...........................            0
Unused Bytes............................            0
Last Used Ext FileId....................            6
Last Used Ext BlockId...................          169
Last Used Block.........................            8
PL/SQL procedure successfully completed.
SQL> show arrays
arraysize 100
SQL> set autotrace traceonly statistics
SQL> select * from t_new ;
1000 rows selected.
Statistics
          0  recursive calls
          0  db block gets
         17  consistent gets
          0  physical reads
          0  redo size
      10495  bytes sent via SQL*Net to client
        484  bytes received via SQL*Net from client
         11  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
       1000  rows processed
SQL> select count(*) from t_new ;
Statistics
          0  recursive calls
          0  db block gets
          7  consistent gets
          0  physical reads
          0  redo size
        411  bytes sent via SQL*Net to client
        385  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL> set autotrace off
SQL> select blocks,empty_blocks from user_tables where table_name = 'T_NEW' ;
    BLOCKS EMPTY_BLOCKS
         5            0
SQL> select count(distinct dbms_rowid.rowid_block_number(rowid)) from t_new ;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID))
                                                  2

Similar Messages

  • Which consistent get for which block

    Hello Experts,
    I have conducted an experiment at SQL*PLUS. I created a small table with 100 rows and then create an ununique index on the id column.
    SQL> alter system flush shared_pool;
    Sistem dei■tirildi.
    SQL> create table small as
    2 select rownum id, 'BOWIE' name from dual connect by level <= 100;
    SQL> create index small_id_i on small(id);
    SQL> alter session set tracefile_identifier = '100114_deneme2';
    Oturum dei■tirildi.
    SQL> exec dbms_monitor.session_trace_enable(waits => true);
    PL/SQL yordam² ba■ar²yla tamamland².
    SQL> select * from small where id = 44;
            ID NAME
            44 BOWIE
    SQL> exec dbms_monitor.session_trace_disable;
    PL/SQL yordam² ba■ar²yla tamamland².
    After executed the above, I looked the trace file. The following excerpt was taken from end of the trace file.
    =====================
    PARSING IN CURSOR #4 len=210 dep=1 uid=0 oct=3 lid=0 tim=7391216619 hv=864012087 ad='7ff5f8385a8' sqlid='96g93hntrzjtr'
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#, sample_size, minimum, maximum, distcnt, lowval, hival, density, col#, spare1, spare2, avgcln from hist_head$ where obj#=:1 and intcol#=:2
    END OF STMT
    EXEC #4:c=0,e=19,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=3,plh=2239883476,tim=7391216618
    FETCH #4:c=0,e=10,p=0,cr=2,cu=0,mis=0,r=0,dep=1,og=3,plh=2239883476,tim=7391216713
    CLOSE #4:c=0,e=2,dep=1,type=3,tim=7391216749
    =====================
    PARSING IN CURSOR #5 len=33 dep=0 uid=85 oct=3 lid=85 tim=7391217024 hv=1889534919 ad='7ff5f503f40' sqlid='c97q0gdsa00y7'
    select * from small where id = 44
    END OF STMT
    PARSE #5:c=46800,e=121273,p=0,cr=52,cu=0,mis=1,r=0,dep=0,og=1,plh=1841720936,tim=7391217023
    EXEC #5:c=0,e=17,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1841720936,tim=7391217119
    WAIT #5: nam='SQL*Net message to client' ela= 1 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=7391217185
    FETCH #5:c=0,e=21,p=0,cr=2,cu=0,mis=0,r=1,dep=0,og=1,plh=1841720936,tim=7391217243
    WAIT #5: nam='SQL*Net message from client' ela= 304 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=7391217590
    FETCH #5:c=0,e=13,p=0,cr=1,cu=0,mis=0,r=0,dep=0,og=1,plh=1841720936,tim=7391217673
    STAT #5 id=1 cnt=1 pid=0 pos=1 obj=76014 op='TABLE ACCESS BY INDEX ROWID SMALL (cr=3 pr=0 pw=0 time=0 us cost=2 size=20 card=1)'
    STAT #5 id=2 cnt=1 pid=1 pos=1 obj=76015 op='INDEX RANGE SCAN SMALL_ID_I (cr=2 pr=0 pw=0 time=0 us cost=1 size=0 card=1)'
    WAIT #5: nam='SQL*Net message to client' ela= 1 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=7391217792
    *** 2014-01-10 15:10:36.712
    WAIT #5: nam='SQL*Net message from client' ela= 23061079 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=7414278895
    CLOSE #5:c=0,e=27,dep=0,type=0,tim=7414279115
    =====================
    PARSING IN CURSOR #1 len=48 dep=0 uid=85 oct=47 lid=85 tim=7414281226 hv=3585424577 ad='7ff5f6ea810' sqlid='fypj2tgavag61'
    BEGIN dbms_monitor.session_trace_disable; END;
    END OF STMT
    PARSE #1:c=15600,e=2045,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=7414281224
    EXEC #1:c=0,e=1052,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=0,tim=7414282442
    My question is; Although this is very small table, I created an index. As you can see there are 3 consistent gets arise (cr=3). There is no doubt that the first consistent get happen on leaf block and the other on the table block. However, Does the third consistent get happen on which block?
    In my opinion, The last consistent get should be on table block. Becacuse, according to the following thread  (https://community.oracle.com/message/10711767). As far as I know from Solomon, there is fetch and there is prefetch. SQL*PLUS is written in OCI and in OCI prefetch defaults to 1. So, if you issue a query on SQL*PLUS and if this query returns one or more rows the first fetch and the second fetch should be on the same table block.
    Also, can't we say that the last cr happen on table block by looking explain plan? Because, as it can be seen, cr was icreamented when table access by index rowid small line.
    STAT #5 id=1 cnt=1 pid=0 pos=1 obj=76014 op='TABLE ACCESS BY INDEX ROWID SMALL (cr=3 pr=0 pw=0 time=0 us cost=2 size=20 card=1)'
    STAT #5 id=2 cnt=1 pid=1 pos=1 obj=76015 op='INDEX RANGE SCAN SMALL_ID_I (cr=2 pr=0 pw=0 time=0 us cost=1 size=0 card=1)'
    My second question, What can we do in order to understand which consistent get happen on which block (file# block# etc.)? Can't we understand by looking the trace file?
    My third question is, before issue the select query on table. I flushed the shared pool. Does it make the parse 52 cr (Because of recursive calls)???
    PARSE #5:c=46800,e=121273,p=0,cr=52,cu=0,mis=1,r=0,dep=0,og=1,plh=1841720936,tim=7391217023
    I also trace 10200 event, if you want I also can show 10200 trace file. I didn't show it because I don't know how to read 10200 trace event.
    Thanks in advance.

    For example following 10200 trace event arised by select * from small where id = 42;
    *** 2014-01-10 14:56:58.492
    *** SESSION ID:(135.468) 2014-01-10 14:56:58.492
    *** CLIENT ID:() 2014-01-10 14:56:58.492
    *** SERVICE NAME:(SYS$USERS) 2014-01-10 14:56:58.492
    *** MODULE NAME:(SQL*Plus) 2014-01-10 14:56:58.492
    *** ACTION NAME:() 2014-01-10 14:56:58.492
    ktrget2(): started for block  <0x0004 : 0x010006bb> objd: 0x000128ee
    env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 97sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexf(): returning 9 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgcm(): completed for block  <0x0004 : 0x010006bb> objd: 0x000128ee
    ktrget2(): completed for  block <0x0004 : 0x010006bb> objd: 0x000128ee
    ktrgtc2(): started for block <0x0004 : 0x010006c3> objd: 0x000128ef
      env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 97sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexc(): returning 8 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgtc2(): completed for block <0x0004 : 0x010006c3> objd: 0x000128ef
    ktrgtc2(): started for block <0x0000 : 0x00400b49> objd: 0x000001aa
      env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 96sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexc(): returning 2 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgtc2(): completed for block <0x0000 : 0x00400b49> objd: 0x000001aa
    ktrget2(): started for block  <0x0000 : 0x00415c82> objd: 0x000001aa
    env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 96sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexf(): returning 9 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgcm(): completed for block  <0x0000 : 0x00415c82> objd: 0x000001aa
    ktrget2(): completed for  block <0x0000 : 0x00415c82> objd: 0x000001aa
    ktrgtc2(): started for block <0x0004 : 0x010006c3> objd: 0x000128ef
      env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 97sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexc(): returning 8 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgtc2(): completed for block <0x0004 : 0x010006c3> objd: 0x000128ef
    ktrget2(): started for block  <0x0004 : 0x010006bb> objd: 0x000128ee
    env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 97sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexf(): returning 9 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgcm(): completed for block  <0x0004 : 0x010006bb> objd: 0x000128ee
    ktrget2(): completed for  block <0x0004 : 0x010006bb> objd: 0x000128ee
    ktrget2(): started for block  <0x0004 : 0x010006c3> objd: 0x000128ef
    env: (scn: 0x0000.004d5549  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0  parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 96sch: scn: 0x0000.00000000  mascn: (scn: 0x0000.004d550c)
    ktrexf(): returning 9 on:  0000000021DD1524  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  scn: 0xffff.ffffffff  sfl: 0
    ktrgcm(): completed for block  <0x0004 : 0x010006c3> objd: 0x000128ef
    ktrget2(): completed for  block <0x0004 : 0x010006c3> objd: 0x000128ef

  • I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error.

    I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error. "Failed to Continue Activity" Cocoa Error 4609.  Handoff is working for phone calls and text messages. By email just crashes each time. It was also doing it under 8.0.2.  My iPhone and iPad handle this fine. It's only the MacBook to the iPhone that fails, and only on email.

    Handoff Continuity Troubleshooting

  • I consistently get this messsage and have to restart the system - "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system". When I look at the Task Manager no Fire

    I consistently get this message and have to re'boot my system. "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system"
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.04506; InfoPath.2; Media Center PC 5.0; SLCC1)

    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: [http://kb.mozillazine.org/Kill_application Kill Application]
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    [[Firefox hangs]]
    [http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit]
    [[Firefox is already running but is not responding]]
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.

  • Consistent gets and physical reads

    Hi all,
    I am tuning a DM SQL query, by comparing execution plans with STAR TRANSFORMATION enabled or disabled. I got the following results:
    STAR TRANSFORMATION ON
    74889 consistent gets
    254365 physical reads
    STAR TRANSFORMATION OFF
    1945892 consistent gets
    168028 physical reads
    I thought a physical read would be counted as a logical read as well, because the data block would be read from disk (1 physical IO), placed in the buffer cache and then read from there (1 more logical IO or consistent get).
    So, one physical IO does not cause a logical IO?
    Thanks!
    Edited by: user10634835 on 12-Jul-2011 08:40

    But shouldn't consistent gets be >= physical reads (Since, as per my understanding, 1 PIO causes at least 1 LIO)? In this case it is not.
    74889 consistent gets
    254365 physical readsJust clarifying for my knowledge.
    regards

  • Consistently getting an error in custom reports "an error occurred" is the only msg displayed...my c

    Consistently getting an error in custom reports "an error occurred" is the only msg displayed...my clients are screaming...what is the problem?

    Hi,
    Please log a ticket with BC support for this issue. Please provide the exact steps, preferably a video. You can log the ticket from your admin panel > help & support.
    Kind Regards,
    Aish

  • Consistently getting invalid URL error

    I'm consistently getting following with Safari 6.02.  The URLs I'm trying to go to are such uncommon web sites as facebook.com and ebay.com.  Seems once Safari sets it's mind to it there is no way around this "error"?  I've tried clearing history, closing/reopening safari...still no worky.
    The requested URL "/", is invalid.
    Reference #9.ac6d19b8.1359073068.1022326c

    you must install a peer id registration/lookup service compatible with VideoPhoneLabs' queries onto your web server.  a sample service is the "reg.cgi" python script included with VideoPhoneLabs. you must create the database it'll use according to the schema in the script comment and place the database (and the script) in your filesystem with appropriate permissions for your OS and web server. then you give the URL to that web service as the WebServiceUrl constant.

  • Trying to understand consistent gets

    1. We were very surprised to observe that the consistent gets for a query (shown below) changed (from 120K to 18K) when the only modification was adding a comment to it. How can this happen?
    2. Furthermore, the plans for the two queries were identical. How can consistent gets differ if the plan is the same?
    3. Is consistent gets the best metric for comparing the performance of two versions of a query, or is there a better one? (In the past we've tried to use execution timing for comparison, but the timing of a single query can vary greatly between runs.)
    select
           count(*) from (
    SELECT source_id, project_id,
           max_score,
           fields_matched
    FROM (SELECT source_id, project_id, MAX(scoring) as max_score,
                 apidb.tab_to_string(set(CAST(COLLECT(table_name) AS apidb.varchartab)), ', ')  fields_matched,
                 max(index_name) keep (dense_rank first order by scoring desc, source_id, table_name) as index_name,
                 max(oracle_rowid) keep (dense_rank first order by scoring desc, source_id, table_name) as oracle_rowid
          FROM (  SELECT  SCORE(1) * (select nvl(max(weight), 1) from apidb.TableWeight where table_name = 'Blastp')
                           as scoring,
                        'apidb.blastp_text_ix' as index_name, b.rowid as oracle_rowid, b.source_id, b.project_id,
                        external_database_name as table_name
                  FROM apidb.Blastp b
                  WHERE CONTAINS(b.description, 'protein', 1) > 0
                    AND 'Blastp' IN ('Product', 'Notes', 'Comments', 'InterPro', 'EcNumber', 'GoTerms', 'Phenotype', 'Notes', 'and the rest')
                    AND 'gene' = 'gene'
                    AND b.pvalue_exp < -30
                    AND b.query_organism IN ('Plasmodium falciparum', 'Plasmodium vivax', 'Plasmodium yoelii', 'Plasmodium berghei', 'Plasmodium chabaudi', 'Plasmodium knowlesi')
                UNION
                  SELECT
                         SCORE(1)* nvl(tw.weight, 1)
                           as scoring,
                         'apidb.gene_text_ix' as index_name, gt.rowid as oracle_rowid, gt.source_id, gt.project_id, gt.field_name as table_name
                  FROM apidb.GeneDetail gt, apidb.TableWeight tw, apidb.GeneAttributes ga
                  WHERE CONTAINS(content, 'protein', 1) > 0
                    AND gt.field_name IN ('Product', 'Notes', 'Comments', 'InterPro', 'EcNumber', 'GoTerms', 'Phenotype')
                    AND 'gene' = 'gene'
                    AND gt.field_name = tw.table_name(+)
                    AND gt.source_id = ga.source_id
                    AND ga.species IN ('Plasmodium falciparum', 'Plasmodium vivax', 'Plasmodium yoelii', 'Plasmodium berghei', 'Plasmodium chabaudi', 'Plasmodium knowlesi')
                UNION
                  SELECT SCORE(1) * nvl(tw.weight, 1) 
                           as scoring,
                        'apidb.isolate_text_ix' as index_name, wit.rowid as oracle_rowid, wit.source_id, wit.project_id, wit.field_name as table_name
                  FROM apidb.IsolateDetail wit, apidb.TableWeight tw
                  WHERE CONTAINS(content, 'protein', 1) > 0
                    AND wit.field_name in ('fred')
                    AND 'gene' = 'isolate'
                    AND wit.field_name = tw.table_name(+)
          GROUP BY source_id, project_id
          ORDER BY max_score desc, source_id
    );

    1. We were very surprised to observe that the consistent gets for a query (shown below) changed (from 120K to 18K) when the only modification was adding a comment to it. How can this happen?Adding a comment and getting a different anything makes no sense, but you already know this. Did you toggle the comment on and off to see any changes in performance?
    2. Furthermore, the plans for the two queries were identical. How can consistent gets differ if the plan is the same?Clearly something odd happened. Possibilities include
    * wrong execution plan reported in one case (unlikely, but possible)
    * system resource availability was different at different times
    3. Is consistent gets the best metric for comparing the performance of two versions of a queryI use consistent gets, but also look at disk reads (not useful after data has been cached), CPU, and overall execution time. On rare occasions queries can be CPU-bound
    Edited by: riedelme on Mar 3, 2010 1:06 PM

  • When I download photos from my PC to my iPad I can't consistently get them to appear in order. Any suggestions

    When I download photos from my PC to my iPad I cannot consistently get them to appear in the order I want them even after changing their file names and arranging them in the order I want. Any suggestions would be greatly appreciated

    Maybe this will help you; http://support.apple.com/kb/HT4221
    Best way is to use another App, something like Photo Manager Pro which is an excelent app. You can do everything you can't with Apple's sofware: order pictures in the order you want, any order; copy, paste, transfer... you name it, it does it.

  • Consistent gets are reduced by 50% but the query taking more elapsed time.

    Hi All,
    While tuning a application my consistent gets are reduced by 50% but the query is still taking the same time.
    In a Warehouse env data is coming from With clause that is having some 40000 rows .Then these 40K rows are joined to a table that is having 2 Billion records having indexes on primary key and date column(bitmap)indexes .
    It is using Hash Joining method.

    Try forcing a hash join, if possible:
    http://dba-oracle.com/tips_oracle_hash_joins.htm
    Can you post the plans?
    http://www.dba-oracle.com/plsql/t_plsql_plans.htm

  • Query 1 shows less consistent gets but more cost than Query 2..

    Hi ,
    SQL> select dname from scott.dept where deptno not in (select deptno from scott.emp)
    Ðñüãñáììá åêôÝëåóçò
    Plan hash value: 3547749009
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    1 |    22 | 4 (0)| 00:00:01 |
    |*  1 |  FILTER            |      |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| DEPT |     4 |    88 | 2 (0)| 00:00:01 |
    |*  3 |   TABLE ACCESS FULL| EMP  |    11 |   143 |  2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "SCOTT"."EMP" "EMP"
                  WHERE LNNVL("DEPTNO"<>:B1)))
       3 - filter(LNNVL("DEPTNO"<>:B1))
    Note
       - dynamic sampling used for this statement
    ÓôáôéóôéêÜ
              0  recursive calls
              0  db block gets
             15 consistent gets
              0  physical reads
              0  redo size
            416  bytes sent via SQL*Net to client
            384  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL>
    SQL> select dname from scott.dept,scott.emp where dept.deptno=emp.deptno(+)
      2    and emp.rowid is null;
    Ðñüãñáììá åêôÝëåóçò
    Plan hash value: 2146709594
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |      |   12 |   564 | 5 (20)| 00:00:01 |
    |*  1 |  FILTER             |      |       |       |            |          |
    |*  2 |   HASH JOIN OUTER   |      |    12 |   564 | 5 (20)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| DEPT |     4 |    88 | 2 (0)| 00:00:01 |
    |   4 |    TABLE ACCESS FULL| EMP  |    12 |   300 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("EMP".ROWID IS NULL)
       2 - access("DEPT"."DEPTNO"="EMP"."DEPTNO"(+))
    Note
       - dynamic sampling used for this statement
    ÓôáôéóôéêÜ
              0  recursive calls
              0  db block gets
              6 consistent gets
              0  physical reads
              0  redo size
            416  bytes sent via SQL*Net to client
            384  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedI have two questions:
    1) which one is preferable.... the first which is less costy to the system or the second which causes less consistent gets to the system and so is considered to be more scalable..????
    2)Whereas the number of rows returned by both queries is 1.. why the is difference in the underlined values in the two queries (values 1 and 12 respectively)?
    I use Oracle10g v.2
    Thanks.. a lot
    Sim

    The less logical I/O's the better.
    So always do it like your query 2 (btw. your title is the wrong way)
    Your example is probably flawed. If I try it in SQL*Plus I get correct results:
    SQL> get t
      1* select dname from dept where deptno not in (select deptno from emp)
    SQL> /
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=3 Bytes=39)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'DEPT' (TABLE) (Cost=2 Card=4 Bytes=52)
       3    1     TABLE ACCESS (FULL) OF 'EMP' (TABLE) (Cost=2 Card=1 Bytes=3)
    Statistics
              0  recursive calls
              0  db block gets
             15  consistent gets
              0  physical reads
              0  redo size
            537  bytes sent via SQL*Net to client
            660  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> get tt
      1  select dname from dept,emp where dept.deptno=emp.deptno(+)
      2* and emp.rowid is null
    SQL> /
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=5 Card=14 Bytes=322)
       1    0   FILTER
       2    1     HASH JOIN (OUTER) (Cost=5 Card=14 Bytes=322)
       3    2       TABLE ACCESS (FULL) OF 'DEPT' (TABLE) (Cost=2 Card=4 Bytes=52)
       4    2       TABLE ACCESS (FULL) OF 'EMP' (TABLE) (Cost=2 Card=14 Bytes=140)
    Statistics
              0  recursive calls
              0  db block gets
              6  consistent gets
              0  physical reads
              0  redo size
            537  bytes sent via SQL*Net to client
            660  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> I'm wondering for instance why you have there 11 rows in emp for query 1 (should be only 1 row) and why you have only 12 rows in query 2 (should be 14 rows)

  • Consistent gets examination

    " You have 3,847.1 consistent gets examination per second. "Consistent gets - examination" is different than regular consistent gets. It is used to read undo blocks for consistent read purposes, but also for the first part of an index read and hash cluster I/O. To reduce logical I/O, you may consider moving your indexes to a large blocksize tablespace. Because index splitting and spawning are controlled at the block level, a larger blocksize will result in a flatter index tree structure.
    Can you explain the above and help me understand it?
    What is index split and spawning? why does it happen and what is the fix?
    Which indexes are affected? Is there a query to find out? What is an optimal block size to use for these affected index table spaces?

    I'd strongly suggest you start reading the Oracle DBA manual to get a bit more basics behind you before you get into the advanced tuning stuff. It's at http://docs.oracle.com

  • Reduce Logical IO [db block gets/consistent gets]

    Hi,
    Still I'm unsure about the Logical IO (db block gets + consistent gets).
    I want to reduce 'consistent gets' for this query
    SQL> set autotrace traceonly
    SQL> select * from cm_per_phone_vw;
    905 rows selected.
    Execution Plan
    Plan hash value: 524433310
    | Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |              |   868 | 38192 |     8   (0)| 00:00:01 |
    |   1 |  SORT GROUP BY NOSORT        |              |   868 | 38192 |     8   (0)| 00:00:01 |
    |   2 |   TABLE ACCESS BY INDEX ROWID| CI_PER_PHONE |  1238 | 54472 |     8   (0)| 00:00:01 |
    |   3 |    INDEX FULL SCAN           | CM172C0      |  1238 |       |     1   (0)| 00:00:01 |
    Statistics
              8  recursive calls
              0  db block gets
            922  consistent gets
              4  physical reads
              0  redo size
          39151  bytes sent via SQL*Net to client
           1045  bytes received via SQL*Net from client
             62  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
            905  rows processedFollowing is the view it's accessing
    CREATE OR REPLACE VIEW CM_PER_PHONE_VW
    AS
    SELECT
      per_id
      , MAX(DECODE(TRIM(phone_type_cd), 'MOB', phone)) AS MOB
      , MAX(DECODE(TRIM(phone_type_cd), 'HOME', phone)) AS HOME
      , MAX(DECODE(TRIM(phone_type_cd), 'BUSN', TRIM(phone) || ' ' || TRIM(extension))) AS BUSN
      , MAX(DECODE(TRIM(phone_type_cd), 'FAX', phone)) AS FAX
      , MAX(DECODE(TRIM(phone_type_cd), 'INT', phone)) AS INT
    FROM
      ci_per_phone
    GROUP BY
      per_idI have following indexes on table ci_per_phone
    INDEX_NAME                     COLUMN_NAME                    COLUMN_POSITION
    XM172P0                        PER_ID                                       1
    XM172P0                        SEQ_NUM                                      2
    XM172S1                        PHONE                                        1
    CM172C0                        PER_ID                                       1I tried creating indexes on PER_ID and PHONE_TYPE_CD but the consistent gets reduces to 920 instead of 922.
    Just for curiosity, how can I reduce this?
    secondly, is there any explanation on 'OPERATION' break of the plan, e.g. TABLE ACCESS BY INDEX ROWID ?
    Please advice.
    Luckys.

    Further I'm having problem with another query which is a view
    CREATE OR REPLACE VIEW CM_PER_CHAR_VW
    AS
    SELECT
    /*+ full (a) */
      a.acct_id
      , MAX(DECODE(a.char_type_cd, 'ACCTYPE', a.char_val)) acct_type
      , MAX(DECODE(a.char_type_cd, 'PRVBLCYC', a.adhoc_char_val)) prev_bill_cyc
    FROM
      ci_acct_char a
    WHERE
      a.effdt =
        (SELECT
          MAX(a1.effdt)
        FROM
          ci_acct_char a1
        WHERE a1.acct_id = a.acct_id
        AND a1.char_type_cd = a.char_type_cd)
    GROUP BY
      a.acct_idI'm not able to reduce the consistent gets and even the filter appears.
    I've analyzed the table as well as the index on the table.
    cisadm@CCBDEV> select * from cm_acct_char_vw;
    2649 rows selected.
    Execution Plan
    Plan hash value: 132362271
    | Id  | Operation              | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT       |              |    27 |  4536 |    14   (8)| 00:00:01 |
    |   1 |  HASH GROUP BY         |              |    27 |  4536 |    14   (8)| 00:00:01 |
    |   2 |   VIEW                 |              |    27 |  4536 |    14   (8)| 00:00:01 |
    |*  3 |    FILTER              |              |       |       |            |          |
    |   4 |     HASH GROUP BY      |              |    27 |  2916 |    14   (8)| 00:00:01 |
    |   5 |      NESTED LOOPS      |              |  2686 |   283K|    13   (0)| 00:00:01 |
    |   6 |       TABLE ACCESS FULL| CI_ACCT_CHAR |  2686 |   157K|    12   (0)| 00:00:01 |
    |*  7 |       INDEX RANGE SCAN | XM064P0      |     1 |    48 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter("A"."EFFDT"=MAX("A1"."EFFDT"))
       7 - access("A1"."ACCT_ID"="A"."ACCT_ID" AND
                  "A1"."CHAR_TYPE_CD"="A"."CHAR_TYPE_CD")
    Statistics
              0  recursive calls
              0  db block gets
           2754  consistent gets
              0  physical reads
              0  redo size
          76517  bytes sent via SQL*Net to client
           2321  bytes received via SQL*Net from client
            178  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           2649  rows processedhere's the tkprof
    select *
    from
    cm_acct_char_vw
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch      178      0.07       0.05          0       2754          0        2649
    total      181      0.07       0.05          0       2754          0        2649
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: 63  (CISADM)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: CHOOSE
          0   HASH (GROUP BY)
          0    VIEW
          0     FILTER
          0      HASH (GROUP BY)
          0       NESTED LOOPS
          0        TABLE ACCESS   MODE: ANALYZED (FULL) OF 'CI_ACCT_CHAR'
                       (TABLE)
          0        INDEX   MODE: ANALYZED (RANGE SCAN) OF 'XM064P0'
                       (INDEX (UNIQUE))
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                     179        0.00          0.00
      SQL*Net message from client                   179        0.00          0.08
    ********************************************************************************I've an similar query for another table, where there are 1110 rows, but in the explain, no filter appears in the predicate
    Predicate Information (identified by operation id):
       2 - access("P"."EFFDT"="VW_COL_1" AND "PER_ID"="P"."PER_ID" AND
                  "CHAR_TYPE_CD"="P"."CHAR_TYPE_CD")Both the queries have somewhat similar views.
    I've got 2 questions,
    Is there a way I can reduce the consistent gets( I've tried with/without HINTS),
    secondly whats the predicate access shows as 'VW_COL_1'
    please advice.

  • HT1338 How do you consistently get the scroll bar on the right side of the page

    How do you consistently get the scroll bar on the right side of the page.

    Go into System Preferences, select General and set "Show scroll bars" to "Always".

  • No physical reads, plenty of consistant gets

    Hi All,
    Oracle v11.2 on Linux.
    Please have a look at the query I ran and the output. The SQL_ID is of a SELECT command.
    What does this situation represents, where there are zero physical reads and plenty of consistant gets ?
    For consistant gets, we do read undo information (correct ??), if that undo is read from disk, will that be a "physical read"? i.e. if we read disks for consistant gets, will that be counted under physical reads or not ?
    How can I describe the exact data retrival of the command here? Is it the case of "everything it needs is found in the buffer cache" ?
    select a.sid, a.value , B.NAME ,  s.sql_id
    from v$sesstat a, v$statname b, v$session s
    where A.STATISTIC# = B.STATISTIC#
    and b.name in ( 'redo size','physical read bytes','physical reads cache','consistent gets' )
    and a.sid = s.sid
    and a.sid=1018
    order by a.sid;
           SID      VALUE NAME                                                             SQL_ID
          1018    7281396 consistent gets                                                  434u36htuz0s9
          1018          0 physical reads cache                                             434u36htuz0s9
          1018          0 physical read bytes                                              434u36htuz0s9
          1018       4448 redo size                                                        434u36htuz0s9
    4 rows selected.Thanks in advance.

    >
    There are no physical reads, so weather its doing consistant-gets or not, can I say, all data required for the SELECT was in buffer cache ?
    >
    The data for those system views is cached in memory so Oracle does not read the disk (except at startup) to gather the information.
    Some static information, like dictionary objects, is stored stored on disk in the system tablespace but this data is read when the database is mounted and stored in memory structures.
    Other dynamic information, like session info, is only stored in memory structures (similar to C arrays) and Oracle can query these as if they were tables.
    So no, the data was not in the buffer cache. It was already in system memory.

Maybe you are looking for

  • How to get to know that the given OBJECT is a drop-down or check box?

    I put a drop-down object in my_form, the details are, drop-down name = my_drop_down data binded with my_data caption = my_caption For some, reason, some one has given me this objects (my_drop_down)... i want to figure it out that Whether its a drop-d

  • Can't get an image on my HDTV...

    I got a mini-DVI to HDMI adapter and an HDMI cord that connects to my tv. When I plugged it in my Macbook Pro flashed blue but I got no image on any of the inputs on my tv. I also checked the system preferences to detect displays but got nothing to s

  • Firefox (3.5) compatibility in this forum?

    Apologies for posting here, but I don't see a forum entry for the forum software itself and no mention of the issue elsewhere - and this is a software related board... I get error messages when trying to login to the forums under native firefox.  I h

  • SPPF_MEDIA002 Error when triggering B2B output to Carrier

    We are getting this /BOFU/PPF_STANDARD SPPF_MEDIA002 error and the output generated is in red status. There is no documentation available on how to resolve. If anyone has faced this issue, please let us know the resolution.

  • Sharing with Latest iTunes

    Anyone else having problems sharing/playing playlists between two computers with the latest iTunes. I use to be able to see my laptop's and desktop's playlists. But now, for some unknown reason, the two computers can't "see" each other's playlists fr