What's "consistent gets - examination"?
http://www.dba-oracle.com/m_consistent_gets.htm
says it is a special consistent gets which only need one latch instead of 2 latches(for normal consistent gets). Could you anyone put more information on this? Under what condition which this stats happens? such as access the root block of the index?
user646745,
Thanks for supplying your test case to demonstrate your point.
My original comment was:
Blocks from a suitably defined single table hash cluster make another case because (if there have been no hash collisions) the location of the correct row-pointer is implied by the hash-key value requested.
You also need a unique index on the hash key (which won't be used for the access, even though it exists) and have to query with equality on the hash key.
I modified your test case to demonstrate this - running on 9.2.0.8:
SQL> set echo on
SQL> @temp
SQL> drop table t_hashed;
Table dropped.
SQL> drop cluster hash_cluster;
Cluster dropped.
SQL>
SQL> create cluster hash_cluster
2 ( hash_key number(10) )
3 hashkeys 100
4 size 60
5 single table
6 hash is HASH_KEY;
Cluster created.
SQL>
SQL> create table t_hashed
2 cluster hash_cluster(a)
3 as
4 select cast( rownum as number(10) ) a from all_objects where rownum <= 100;
Table created.
SQL>
SQL> create unique index t_pk on t_hashed(a);
Index created.
SQL> alter table t_hashed add constraint t_pk primary key (a);
Table altered.
SQL>
SQL> execute dbms_stats.gather_schema_stats('test_user', cascade=>true);
PL/SQL procedure successfully completed.
SQL>
SQL> select name,value from v$mystat a , v$statname b where a.STATISTIC#=b.STATISTIC# and b.NAME like 'consistent%';
NAME VALUE
consistent gets 7393
consistent changes 24
consistent gets - examination 611
3 rows selected.
SQL>
SQL> declare
2 a int;
3 begin
4 for i in 1 .. 10000 loop
5 select a into a from t_hashed where a = 1 + mod(i,100);
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL>
SQL> select name,value from v$mystat a , v$statname b where a.STATISTIC#=b.STATISTIC# and b.NAME like 'consistent%';
NAME VALUE
consistent gets 17417
consistent changes 24
consistent gets - examination 10620
3 rows selected.
SQL>
SQL>
SQL> ed temp.lst
SQL> spool offThe "examination" seems to be about doing a minimal amount of work while holding the latch - so reading every row from the block doesn't count.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"The greatest enemy of knowledge is not ignorance,
it is the illusion of knowledge." Stephen Hawking.
Similar Messages
-
" 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
-
What causes BUFFER GETS and PHYSICAL READS in INSERT operation to be high?
Hi All,
Am performing a huge number of INSERTs to a newly installed Oracle XE 10.2.0.1.0 on Windows. There is no SELECT statement running, but just INSERTs one after the other of 550,000 in count. When I monitor the SESSION I/O from Home > Administration > Database Monitor > Sessions, I see the following stats:
BUFFER GETS = 1,550,560
CONSISTENT GETS = 512,036
PHYSICAL READS = 3,834
BLOCK CHANGES = 1,034,232
The presence of 2 stats confuses. Though the operation is just INSERT in database for this session, why should there be BUFFER GETS of this magnitude and why should there by PHYSICAL READS. Aren't these parameters for read operations? The BLOCK CHANGES value is clear as there are huge writes and the writes change these many blocks. Can any kind soul explain me what causes there parameters to show high value?
The total columns in the display table are as follows (from the link mentioned above)
1. Status
2. SID
3. Database Users
4. Command
5. Time
6. Block Gets
7. Consistent Gets
8. Physical Reads
9. Block Changes
10. Consistent Changes
What does CONSISTENT GETS and CONSISTENT CHANGES mean in a typical INSERT operation? And does someone know which all tables are involved in getting these values?
Thank,
...Flake wrote:
Hans, gracias.
The table just have 2 columns, both of which are varchar2 (500). No constraints, no indexes, neither foreign key references are in place. The total size of RAM in system is 1GB, and yes, there are other GUI's going on like Firefox browser, notepad and command terminals.
But, what does these other applications have to do with Oracle BUFFER GETS, PHYSICAL READS etc.? Awaiting your reply.Total RAM is 1GB. If you let XE decide how much RAM is to be allocated to buffers, on startup that needs to be shared with any/all other applications. Let's say that leaves us with, say 400M for the SGA + PGA.
PGA is used for internal stuff, such as sorting, which is also used in determing the layout of secondary facets such as indexes and uniqueness. Total PGA usage varies in size based on the number of connections and required operations.
And then there's the SGA. That needs to cover the space requirement for the data dictionary, any/all stored procedures and SQL statements being run, user security and so on. As well as the buffer blocks which represent the tablespace of the database. Since it is rare that the entire tablespace will fit into memory, stuff needs to be swapped in and out.
So - put too much space pressure on the poor operating system before starting the database, and the SGA may be squeezed. Put that space pressure on the system and you may enbd up with swapping or paging.
This is one of the reasons Oracle professionals will argue for dedicated machines to handle Oracle software. -
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 -
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. -
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. -
Consistent gets/physical reads issue
Dear all,
There are not any of DML on table tb_hxl_user.
First Select:
SQL> select count(1) from tb_hxl_user;
COUNT(1)
286435658
Elapsed: 00:04:03.67
Statistics
357 recursive calls
0 db block gets
2106478 consistent gets
2106316 physical reads
0 redo size
422 bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
6 sorts (memory)
0 sorts (disk)
1 rows processed Second Select:
SQL> select count(1) from tb_hxl_user;
COUNT(1)
286435658
Elapsed: 00:03:02.29
Statistics
0 recursive calls
0 db block gets
2106395 consistent gets
2106273 physical reads
0 redo size
422 bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed After the first,I know that all the blocks have been flushed to SGA,
but the second select,it generated many " 2106395 consistent gets" and " 2106273 physical reads" also,
why?What exactly is consistent gets read below link:
http://jonathanlewis.wordpress.com/2009/06/12/consistent-gets-2/
Which is similar to docs clearity and authenticity.
What exactly is physical read read below link:
http://download.oracle.com/docs/cd/B16240_01/doc/doc.102/e16282/oracle_database_help/oracle_database_instance_throughput_physreads_ps.html
Regards
Girish Sharma -
I would like to get a better understanding of what exactly this statistic means. Oracle documentation states:
Consistent Gets is the number of times a consistent read was requested for a block.
Is the data included in Consistent Gets coming from a Rollback Segment of from a DB Cache?
In the datawarehousing environment with very heavy reporting and ETL running at the same time, when Consistent Gets statistic is 5 times higher than Physical Reads, is that a reason for concern?In the datawarehousing environment with very heavy reporting and ETL running at the same time, when Consistent Gets statistic is 5 times higher than Physical Reads, is that a reason for concern? <<It doesn't sound relevant -- if your reporting is using parallel query then it is bypassing the buffer cache, hence a logical i/o against the table being parallel-scanned is going to be a physical i/o also. So, much would depend on how much use you are making of parallel query.
The parallel query LIO/PIO effect is easy to demonstrate by querying a chunk of data twice with a noparallel hint and twice with a parallel hint, and having autotrace turned on. you'll see the PIO's drop down on the second execution of the noparallel query, but on the parallel query they'll remain pretty much the same on the second execution. -
Consistent gets and db block gets
Hi...
I wanted to know the difference between consistent gets and db block gets in v$sess_io.I have read that consistent gets is the blocks in consistent mode..so here what does consistent mode means????
Thanks in Advance,
AnandHere's the complete text of the answer I originally wrote nearly 5 years ago on the Oracle-L mailing list:
A 'db block get' is a current mode get. That is, it's the most up-to-date copy of the data in that block, as it is right now, or currently. There can only be one current copy of a block in the buffer cache at any time. Db block gets generally are used when DML changes data in the database. In that case, row-level locks are implicitly taken on the updated rows. There is also at least one well-known case where a select statement does a db block get, and does not take a lock. That is, when it does a full table scan or fast full index scan, Oracle will read the segment header in current mode (multiple times, the number varies based on Oracle version).
A 'consistent get' is when Oracle gets the data in a block which is consistent with a given point in time, or SCN. The consistent get is at the heart of Oracle's read consistency mechanism. When blocks are fetched in order to satisfy a query result set, they are fetched in consistent mode. If no block in the buffer cache is consistent to the correct point in time, Oracle will (attempt to) reconstruct that block using the information in the rollback segments. If it fails to do so, that's when a query errors out with the much dreaded, much feared, and much misunderstood ORA-1555 "snapshot too old".
As to latching, and how it relates, well, consider that the block buffers are in the SGA, which is shared memory. To avoid corruption, latches are used to serialize access to many linked lists and data structures that point to the buffers as well as the buffers themselves. It is safe to say that each consistent get introduces serialization to the system, and by tuning SQL to use more efficient access paths, you can get the same answer to the same query but do less consistent gets. This not only consumes less CPU, it also can significantly reduce latching which reduces serialization and makes your system more scalable.
Well, that turned out longer than I planned. If you're still reading, I hope it helped!
Hope that helps,
-Mark
PS The original question asked about latching as well, which explains the reason for the third paragraph.
Edited by: mbobak on Sep 2, 2008 11:07 PM -
Consistent gets and buffer gets
Hi,
what is the difference between Consistent gets and buffer gets ?
Many thanks before.plz the documentation is your friend. You can search from tahiti.oracle.com or 10.2 (or your version) docu library.
-
Hello,
Consistent GetsAman.... 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 -
High Consistent Gets and memory settings
What is actually high consistent gets?
I get High Consistent Gets for certain sessions. Following are some of my parameter settings.
db_16k_cache_size = 0
db_2k_cache_size = 0
db_32k_cache_size = 0
db_4k_cache_size = 0
db_8k_cache_size = 0
db_block_size = 8192
sga_max_size = 7632M
sga_target = 7632M
shared_pool_reserved_size = 119957094
shared_pool_size = 48M
pga_aggregate_target = 1500M
Will setting AMM by configuring following parameter help Oracle to manage the memory in terms of workload and reduce CONSISTENT GETS?
Or do I need to manually configure parameter such as "db_8k_cache_size".?
memory_max_target = my SGA+PGA: 9.5G
memory_target = my SGA+PGA: 9.5G
sga_target = 0
pga_agreegate_target =0
Regards, LilyLily wrote:
What is actually high consistent gets?These are the logical IO's . If the logical IOs are high, it may mean that you have selected a lot of data which is now supposed to be given back to you. The high Logical IOs is not something that you should try to minimize using a high amount of memory since its already cached data. That sort of workaround works or would work if the physical IOs are high. If the session is doing more logical IO's check the query and the selectivity of the data and see if you can limit it further.
I get High Consistent Gets for certain sessions. Following are some of my parameter settings.
db_16k_cache_size = 0
db_2k_cache_size = 0
db_32k_cache_size = 0
db_4k_cache_size = 0
db_8k_cache_size = 0
db_block_size = 8192
sga_max_size = 7632M
sga_target = 7632M
shared_pool_reserved_size = 119957094
shared_pool_size = 48M
pga_aggregate_target = 1500M
Will setting AMM by configuring following parameter help Oracle to manage the memory in terms of workload and reduce CONSISTENT GETS?
Or do I need to manually configure parameter such as "db_8k_cache_size".?
memory_max_target = my SGA+PGA: 9.5G
memory_target = my SGA+PGA: 9.5G
sga_target = 0
pga_agreegate_target =0
As I said, instance tuning is not something that you should aim for .
Aman.... -
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 -
Hi all,
I have a query about consistant gets. When we see statistics or the output when autotrace is on, we see a value "consistant gets".
According to docs, its the number of blocks read in "consistant read" mode. I am confused here.
Say, a query began to run. The process looked through the database buffers for data, for a SCN number. Lets say, the result of my query was in 1000 blocks. Out of which 500 were taken by rolling back some data, as it was mofified by another process while my query was executing.
Now, should we say Buffer Gets=500 and Consistant gets=500
OR
all 1000 blocks were consistant gets.
If I am getting too many consistant gets, what should I do ? increase DB_BLOCK_BUFFERS ( DB_CACHE_SIZE in 9i ) ? or what ?
Please explain.
RegardsFor any SELECT query, all reads will be done as consistent gets. A consistent get means that Oracle is reading the blocks (whether out of cache or from disk) at a particular point in time. It may or may not need to look into rollback segments to so this. In a query, the read is consistent as at the time your query started
A block get is a read of the current value of a block. Typically, when Oracle reads the data dictionary (not you querying, but Oracle reading it as recursive sql) it reads the current values. Also, when you do an update, Oracle will use consistent gets to find the candidate rows, then a block get just before updating.
In your example, all 1000 blocks would be consistent gets, although there may be a few block gets as well, particularly if Oracle needed to do physical reads.
If you are getting too many consistent gets (actually logical I/O's) then you need to re-write the query to be more efficient. Although, the question of what is "too many" is often very difficult to answer.
HTH
John -
If you traded in your mac mini for a windows pc, what would you get?
I have a late 2009 Mac Mini and am just chafing to upgrade. It's slow as molasses. But at the same time, I'm not willing to pay full price for 2012 model, and Apple is way behind in releasing an update. In fact I'm hearing speculation that Apple may be just discontinuing the Mac Mini.
I don't know... But I'm getting tired of waiting. And getting a different model of Mac doens't work for me, because I want to use my own screens. (I'm running two large screens in "portrait" mode.)
Also, I have a Windows 7 PC at work, and I've come to realize that I don't mind Windows 7 and don't see it as intrinsically better than the Apple OS. In fact Windows & has generally been mariginally more stable, and a lot faster then the OS on my Mac. In fact I got both systems around the same time and the Windows 7 system did better with less RAM and is "aging" better.
HOWEVER, what I really love about the Mac Mini is how QUIET it is. I have it in my bedroom, next to my bed, and it's noise is barely noticeable. So I guess I should look into seeing if there area any desktop PC's that are as quiet.
Have you considered switching back to a PC, and if you did what would you get?I moved away from Apple in 2007 and have never looked back !
I use the ASRock Vision X 420D http://www.asrock.com/nettop/Intel/VisionX%20Series%20(Haswell)/
Its the same size as the current Mini but a bit taller - BUT it is FULLY user upgradeable and about the same price once you make a mini upto the same spec.
I run Windows 8.1 on it and love it - yes there are lots of people bleating on about the 'metro' style of Win 8 but if you configure it (which has been a feature from launch, not a 3rd party hack) you never have to see the metro interface and you have a standard desktop.
As to woodmeister50 comment of : Also, with Win8, many third party add on companies have dropped support etc. is that not the same for Mavericks ?!
Custom mini
ASRock Vision X 420D, 16Gb Ram, 3x 512Gb SSD, AMD Radeon R270X, WiFi (n, ac)
Maybe you are looking for
-
HP will not print to my printer on my network
I was using Motoprint until i upgraded my droid 4 phone. i downloaded HP eprint. It see my printer but will not print to it. the printer is a officejet 6310 all-in-one. It is connected to my wirerless router and has its own IP address. the app see it
-
My tracker pad has stopped working. I've changed the batteries twice to no gain. The indicator light isn't opereating. Its 18 months old and up until now I've had no problems. Could anyone advise if this is a common problem, is there a fix or do
-
Hi, if anyone had any DOCUMENT on previous project implementation of FI , please forward it to [email protected] , i will reward points. Thanks. venkat.
-
How to write JDBC code in a java thread? for network programming
Hii guys, i am new to java network programming. I developed small swing application for stock controlling in a shop, so i need to run the database in a server. i try the peer to peer scenario, but the response is too late and the application get stuc
-
How do I open an iview in a FULL pop up window
I am trying to open an iview in a new window, and I want to display this new window in full page. I tried "FULL_PAGE" in the drop down option for Height Type. But it didn't work. I know that you can display the pop window in a full screen mode in "Wi