Re: Why such high buffer gets for a simple insert and inconsistent in every run

  • From: sachin pawar <getsach@xxxxxxxxx>
  • To: Krish Singh <krishsingh.111@xxxxxxxxx>
  • Date: Sun, 5 Aug 2018 12:17:19 -0400

hi Kunwar,

-Did you try tracing with 10200 event?
I have never used but saw it in few posts after google on it.

-Did you review this post from Jonathan Lewis?
http://www.jlcomp.demon.co.uk/buffer_usage.html
note: Not sure if still works for 12c because x$kcbsw structure has changed
, but you can go through it anyways.

-How about searching on MOS for troubleshooting it?
i quickly searched but no exact hits to suggest to you .

Rgds,
Sachin
https://twitter.com/sach_pwr




On Sun, Aug 5, 2018 at 12:07 PM, kunwar singh <krishsingh.111@xxxxxxxxx>
wrote:

Hello Performance Experts,

I always thought simple insert ( table doesnt have a LOB)  would always
return very few buffer gets ( if only 1 index on the table) . But below
testcase shows 9 or 11 buffer gets everytime i insert these records . If i
keep on repeating the same inserts it drops to ~6 gets/exec.
Can anyone tell why this is the case? I always thought it would be 3
gets/exec for every execution in such a simple insert into and single index
table.

Version:12.1.0.1.0

TESTCASE:
++++++ ++++++ ++++++

13:48:51 SQL> alter system flush shared_pool;
System altered.
Elapsed: 00:00:00.04
13:48:55 SQL> alter system flush buffer_cache;
System altered.
Elapsed: 00:00:00.17
13:49:03 SQL> create index emp_ix on emp(empno);
Index created.
Elapsed: 00:00:00.16
13:49:08 SQL> exec dbms_stats.gather_table_stats(user, upper('EMP'),
null, method_opt=>'FOR TABLE FOR ALL COLUMNS SIZE REPEAT', cascade=>true);
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.92
select *from user_tables where table_name='EMP'
============================================================
====================
TABLE_NAME                     --> EMP
TABLESPACE_NAME                --> USERS
CLUSTER_NAME                   -->
IOT_NAME                       -->
STATUS                         --> VALID
PCT_FREE                       --> 10
PCT_USED                       -->
INI_TRANS                      --> 1
MAX_TRANS                      --> 255
INITIAL_EXTENT                 --> 65536
NEXT_EXTENT                    --> 1048576
MIN_EXTENTS                    --> 1
MAX_EXTENTS                    --> 2147483645
PCT_INCREASE                   -->
FREELISTS                      -->
FREELIST_GROUPS                -->
LOGGING                        --> YES
BACKED_UP                      --> N
NUM_ROWS                       --> 14
BLOCKS                         --> 5
EMPTY_BLOCKS                   --> 0
AVG_SPACE                      --> 0
CHAIN_CNT                      --> 0
AVG_ROW_LEN                    --> 38
AVG_SPACE_FREELIST_BLOCKS      --> 0
NUM_FREELIST_BLOCKS            --> 0
DEGREE                         -->          1
INSTANCES                      -->          1
CACHE                          -->     N
TABLE_LOCK                     --> ENABLED
SAMPLE_SIZE                    --> 14
LAST_ANALYZED                  --> 05-AUG-18
PARTITIONED                    --> NO
IOT_TYPE                       -->
TEMPORARY                      --> N
SECONDARY                      --> N
NESTED                         --> NO
BUFFER_POOL                    --> DEFAULT
FLASH_CACHE                    --> DEFAULT
CELL_FLASH_CACHE               --> DEFAULT
ROW_MOVEMENT                   --> DISABLED
GLOBAL_STATS                   --> YES
USER_STATS                     --> NO
DURATION                       -->
SKIP_CORRUPT                   --> DISABLED
MONITORING                     --> YES
CLUSTER_OWNER                  -->
DEPENDENCIES                   --> DISABLED
COMPRESSION                    --> DISABLED
COMPRESS_FOR                   -->
DROPPED                        --> NO
READ_ONLY                      --> NO
SEGMENT_CREATED                --> YES
RESULT_CACHE                   --> DEFAULT
CLUSTERING                     --> NO
ACTIVITY_TRACKING              -->
DML_TIMESTAMP                  -->
HAS_IDENTITY                   --> NO
CONTAINER_DATA                 --> NO
select *from user_indexes where index_name='EMP_IX'
============================================================
====================
INDEX_NAME                     --> EMP_IX
INDEX_TYPE                     --> NORMAL
TABLE_OWNER                    --> TEST
TABLE_NAME                     --> EMP
TABLE_TYPE                     --> TABLE
UNIQUENESS                     --> NONUNIQUE
COMPRESSION                    --> DISABLED
PREFIX_LENGTH                  -->
TABLESPACE_NAME                --> USERS
INI_TRANS                      --> 2
MAX_TRANS                      --> 255
INITIAL_EXTENT                 --> 65536
NEXT_EXTENT                    --> 1048576
MIN_EXTENTS                    --> 1
MAX_EXTENTS                    --> 2147483645
PCT_INCREASE