Select buffer gets
Hi all,
can anyone help me to format the number readable ?!.
SELECT a.value + b.value from gv$sysstat a, gv$sysstat b where a.name = 'db block gets' AND b.name = 'consistent gets';
A.VALUE+B.VALUE
1.3580E+10
SQL>
Thanks !.
use SET NUMWIDTH:
SQL> select 1000000000000000 from dual;
1000000000000000
1.000E+15
SQL> set numwidth 20
SQL> /
1000000000000000
1000000000000000http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch6.htm#sthref1149
Similar Messages
-
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. -
I've found this page
[http://www.billmagee.co.uk/oracle/sqltune/080_identify.html]
in which is said:
BUFFER_GETS Cumulative total of memory blocks read for this statement
so if I want to see how many blocks a query read per execution I must do ((disk_reads+buffer_gets)/executions) as suggested from the query on the same page.
select sql_text,
executions,
to_char((((disk_reads+buffer_gets)/executions) * 8192)/1048576,
'9,999,999,990.00') as total_gets_per_exec_mb,
to_char((( disk_reads /executions) * 8192)/1048576,
'9,999,999,990.00') as disk_reads_per_exec_mb,
to_char((( buffer_gets /executions) * 8192)/1048576,
'9,999,999,990.00') as buffer_gets_per_exec_mb,
parsing_user_id
from v$sqlarea
where executions > 0
order by 6 descThis is correct?
Buffer gets refers only to the block found in the buffer cache (not loaded from disk) or to the total amount of db block on which the query works (indipendetly if they are found immediately in the buffer cache or must be read from disk) ?
Hope you can help me.
Thanks
Adriano AristarcoYes, the index is appearing on the dba_indexes table, however its state is 'UNUSABLE'.
It looks impdp takes its state from origin metadata, puts into destination, and even is not trying to rebuild it.
Of course, after running ALTER INDEX REBUILD its status was changed to VALID.
So, what's the point impdp tells about its state? It can be hundreds of unusable indexes, why it's not just rebuilding it? -
Error -200609 occurred at DAQmx Write: Selected Buffer Size Too Small
Hello, I'm writing some simple test VI's that I will eventually build upon to make an externally clocked analog output VI. I started with a very simple program to output finite samples using the onboard clock with the DAQmx Timing.VI. When I run the program, I almost immediately get an error. The error message is below.
Error -200609 occurred at DAQmx Write (Analog DBL 1Chan 1Samp).vi:1
Possible reason(s):
Generation cannot be started, because the selected buffer size is too small.
Increase the buffer size.
Conflicting Property
Property: Output.BufSize
Corresponding Value: 1
Minimum Supported Value: 2
Task Name: _unnamedTask<1C>
I have used DAQmx VI's before in similar applications and never encountered this error. Additionally, I read at the link below that DAQmx Timing.VI should be generating the buffer automatically. Any ideas as what could be causing this?
Specs:
Windows 7
Labview 2012
PCIe-6353 as DAQ board
Below is a picture of my block diagram and the VI is attached.
Solved!
Go to Solution.
Attachments:
FiniteSamplesTest.vi 18 KBOops. Just realized my very silly mistake: I forgot to add the Start Task VI. I did so and it works as designed.
-
Dear All,
My query is taking 575,618,610, executions 86,114 and CPU Time is 3982.59s which i found in the statspack report.
Then i checked the query to tune, but it's execution plan is showing only CPU cost 5.
So, what is the problem and what is the solution. Please let me know.
Thanks in advance
MahiHi Richard Foote,
The below is the function, in that i am using a cursor with the SQL in Bold letters.
That SQL query is taking more buffer gets as i expalined previously.
FUNCTION get_shortcuts(
p_org_id IN VARCHAR2,
p_usr_id IN VARCHAR2,
p_sws_id IN VARCHAR2,
p_lan_id IN VARCHAR2)
RETURN pglobal.g_ref_cur
AS
c_1 pglobal.g_ref_cur;
BEGIN
IF NVL(p_lan_id, 'ENG') = 'ENG' THEN
OPEN c_1
FOR
SELECT amnu.url_value, swssh.sws_id_1, sws.title
FROM SOFTWARE_SERVICE_SHORTCUTS swssh, SERVICE_PROVISIONS sp, SOFTWARE_SERVICES sws, APPLICATION_MENUS amnu
WHERE swssh.sws_id = p_sws_id
AND swssh.sws_id_1 = sp.sws_id
AND sp.rol_org_id = p_org_id
AND sp.sws_id = sws.id
AND sws.id = swssh.sws_id_1
AND sws.sws_id = amnu.sws_id
AND EXISTS(SELECT rol_id
FROM USER_ROLES
WHERE rol_org_id = p_org_id
AND usr_id = p_usr_id
AND rol_id = sp.rol_id); ELSE
OPEN c_1
FOR
SELECT sws.url_value, swssh.sws_id_1, sws.title
FROM SOFTWARE_SERVICE_SHORTCUTS swssh,
SERVICE_PROVISIONS sp,
SOFTWARE_SERVICES sws,
SOFTWARE_SERVICE_LANGUAGES swsl
WHERE swssh.sws_id = p_sws_id
AND swssh.sws_id_1 = sp.sws_id
AND swsl.sws_id = sws.id
AND swsl.lan_id = p_lan_id
AND sp.rol_id = p_org_id
AND sp.sws_id = sws.id
AND EXISTS(SELECT rol_id
FROM USER_ROLES
WHERE rol_org_id = p_org_id
AND usr_id = p_usr_id
AND rol_id = sp.rol_id)
GROUP BY sws.url_value, swssh.sws_id_1, sws.title;
END IF;
RETURN c_1;
END;
So, please can u explain me is there any possiblity to reduce the buffer gets after checking the above function.
Thanks in advance
Mahi -
Hi,
I have the table my_log in a 9.2.0.7 database. This table is used only for select and insert purposes (there are no deletions). The insertions are simple insert statement without any append hint. From Enterprise Manager I see that the insert performs a lot of buffer gets. This is reasonable because oracle must read the segment to find blocks to write (I imagine that it must also read dictionary and the indexes segments). In this scenario I imagine that the number of buffer getscan only grow over time. The strange thing is that the number of buffer gets can also decrease!
For example:
at 7:00 am => 9966 buffer gets
at 8:00 am => 9422 buffer gets
at 9:00 am => 8912 buffer gets
at 10:00 am => 9543 buffer gets
Why the number of buffer gets is so variable? I expected it to be increasing...Have Checked below checklist
No joins can be made between a stored procedure and a table in a universe
No Query Filters can be used
No predefined conditions
The procedure itself may contain a variable that will prompt, but it cannot be manipulated.
They cannot be used in Linked Universes.
Not All Databases support stored procedures
These SQL Commands are not ALLOWED: COMPUTE, PRINT, OUTPUT or STATUS
The stored procedures do not support OUT or dynamic result sets parameters
An IF statement cannot be used in the where clause.
You can only create a new universe based on the stored procedure. You cannot add it to an existing universe.
The stored procedure creates all objects in the universe automatically. If there is a long text object it will not generate an object.
If a change is made on the database to the stored procedure. The universe view will not update the schema. The stored procedure must be re-inserted. (This causes the object id to change!)
In order to avoid parsing errors on stored procedures columns, it is recommended that you alias result columns based on complex SQL, for example using the aggregate functions - sum, count. The creation of aliased objects cannot be constrained. -
Most buffer gets and disk reads on table "CRMD_BRELVONAI"
hello friends,
we have to much buffer gets and disk reads on this table. se11 says:
2 indexes on this table:
first:
OBJKEY_A -
Index CRMD_BRELVONAI~1 exist on DB ORACLE
second:
OBJKEY_B-
Index not exist on DB ORACLE
Has anbody created the second index and good experience? OSS has no information.
thanks,
christophHo Christioph,
If you double click on secondary index OBJECT_B you will get to index screen. Note that secondary index OBJECT_B as been set to <b>No database index</b>.
For your information, here is a copy of the related documentation.
Create the index in the database (selection)
Whether an index improves or worsens performance often depends on the database system. You can therefore set whether an index defined in the ABAP Dictionary should be created in the database.
This makes it easier to install a platform-specific customer system.
You can set this option as follows:
<b>Index in all database systems:</b> The index is always created in the database.
<b>In selected database systems:</b> The index is created depending on the database system used. In this option, you must specify the databases in which the indexes are to be created. You can do this either on an inclusive (list of systems on which it should be created) or an exclusinve (list of systems on which it should not be created) basis. In either case, you can list up to four different database systems.
<b>No database index:</b> The index is not created in the database. If you set this option for an index that already exists in the database, it is deleted when you activate the table in the ABAP Dictionary.
Note: Unique indexes have an extra function, and must therefore always be created in the database. The database system prevents entries or index fields being duplicated. Since programs may rely on this database function, you cannot delete unique indexes from the database.
Hopping this answer your question.
Sincerely,
Alain Gauthier -
Help me to reduce buffer gets of following query
Buffer gets with this query is 460K.
We want to reduce it drastically.
SELECT temp21.resource_code
,temp21.employee_type employee_type
,temp21.resource_name resource_name
,temp21.manager_id
,temp21.manager_name
,temp21.period_start
,temp21.period_finish
,temp21.avail_hours
,temp21.act_hours
,temp21.timesheet_status timesheet_status
,temp21.email,temp21.ouc
,temp21.work_country
,f.level1_unit_id level1_id
,f.level2_unit_id level2_id
,f.level3_unit_id level3_id
,f.level4_unit_id level4_id
,f.level5_unit_id level5_id
,f.level6_unit_id level6_id
,f.level7_unit_id level7_id
,f.level8_unit_id level8_id
,f.level9_unit_id level9_id
,f.level10_unit_id level10_id
,f.level1_name
,f.level2_name
,f.level3_name
,f.level4_name
,f.level5_name
,f.level6_name
,f.level7_name
,f.level8_name
,f.level9_name
,f.level10_name
FROM (SELECT avail.res_id
,avail.resource_code
,avail.employee_type
,avail.person_type
,avail.resource_name
,avail.manager_id
,avail.manager_name
,avail.period_start
,avail.period_finish
,avail.avail_hours
,NVL(act.act_hours,0) act_hours
,act.timesheet_status
,avail.prid
,avail.email
,avail.ouc
,avail.work_country
FROM (SELECT /*+ALL_ROWS*/r.id res_id
,lk.name employee_type
,r.unique_name resource_code
,r.person_type
,r.first_name||' '||r.last_name resource_name
,r.manager_id manager_id
,r1.first_name||' '||r1.last_name manager_name
,TRUNC(tp.prstart) period_start
,TRUNC(tp.prfinish - 1) period_finish
,NVL(o.gs_hrs_avail_week,0) avail_hours
,r.email
,o.ouc
,o.work_country
,tp.prid
FROM niku.ODF_CA_RESOURCE o
,niku.SRM_RESOURCES r
,niku.SRM_RESOURCES r1
,niku.PRTIMEPERIOD tp
,niku.CMN_SEC_USER_GROUPS usr_grp
,niku.CMN_SEC_GROUPS grp
,(SELECT
NLS.NAME
,LKP.ID
FROM CMN_CAPTIONS_NLS NLS,CMN_LOOKUPS LKP
WHERE NLS.PK_ID=LKP.ID
AND LKP.LOOKUP_TYPE='SRM_RESOURCE_TYPE'
AND NLS.TABLE_NAME='CMN_LOOKUPS'
AND NLS.LANGUAGE_CODE='en') lk
WHERE r.id=o.id
AND r1.user_id(+)=r.manager_id
AND r.user_id=usr_grp.user_id
AND usr_grp.GROUP_ID=grp.id
AND r.person_type=lk.id
AND r.is_active = 1
AND r1.is_active = 1
AND grp.GROUP_CODE='gs_tb'
AND tp.prisopen = 1
) avail
,(SELECT r.id
,tp.prid
,SUM(NVL(practsum,0)/3600) act_hours
,ts.prstatus timesheet_status
FROM niku.SRM_RESOURCES r
,niku.PRTIMESHEET ts
SELECT /*+ALL_ROWS*/ MAX(prid) prid
,prtimeperiodid
,prresourceid
FROM niku.prtimesheet
GROUP BY prtimeperiodid,prresourceid
) ts_new
,niku.PRTIMEENTRY te
,niku.PRTIMEPERIOD tp
,niku.CMN_SEC_USER_GROUPS usr_grp
,niku.CMN_SEC_GROUPS grp
WHERE ts.prid=ts_new.prid
AND ts.prtimeperiodid=ts_new.prtimeperiodid
AND ts.prresourceid=ts_new.prresourceid
AND r.id=ts.PRRESOURCEID
AND ts.PRID=te.PRTIMESHEETID
AND ts.PRTIMEPERIODID=tp.prid
AND usr_grp.USER_ID=r.USER_ID
AND grp.id=usr_grp.group_id
AND r.is_active=1
AND tp.PRISOPEN=1
AND ts.prstatus not in(0,2,5)
AND grp.group_code='gs_tb'
AND TRUNC(tp.PRSTART) >= TRUNC(TO_DATE('7/24/2006','MM/DD/YYYY HH:MI:SS AM'))
AND TRUNC(tp.PRFINISH-1) <= TRUNC(TO_DATE('9/25/2006','MM/DD/YYYY HH:MI:SS AM'))
GROUP BY r.ID
,tp.PRID
,ts.prstatus) act
WHERE act.id(+) = avail.res_id
AND act.prid(+) = avail.prid
AND (avail.avail_hours - NVL(act.act_hours,0) > 0))temp21
,prj_obs_associations o1
,nbi_dim_obs f
WHERE 1=1
AND temp21.prid in (SELECT prid
FROM PRTIMEPERIOD
WHERE TRUNC(PRSTART) >= TRUNC(TO_DATE('7/24/2006','MM/DD/YYYY HH:MI:SS AM'))
AND TRUNC(PRFINISH-1) <= TRUNC(TO_DATE('9/25/2006','MM/DD/YYYY HH:MI:SS AM'))
AND
temp21.res_id = o1.record_id
AND o1.unit_id = f.obs_unit_id
AND o1.table_name = 'SRM_RESOURCES'
AND f.obs_type_id = 5000009
AND f.level5_unit_id = 5013334
ORDER BY temp21.manager_name
,temp21.manager_id
,temp21.resource_name
,temp21.resource_code
,temp21.period_start
,temp21.period_finish
,temp21.timesheet_status...Also
AND TRUNC(tp.PRSTART) >= TRUNC(TO_DATE('7/24/2006','MM/DD/YYYY HH:MI:SS AM'))
AND TRUNC(tp.PRFINISH-1) <= TRUNC(TO_DATE('9/25/2006','MM/DD/YYYY HH:MI:SS AM'))Although this won't fail, you have specified the time portion of the date without supplying data to be converted....which you don't need as it will automatically be set to midnight if you don't specify it.
In addition, you are applying the TRUNC function to the column you are comparing which will prevent any indexes from being used. You should perform the arithmetic on the litterals, not the columns, and set up the range correctly:
AND tp.PRSTART >= TO_DATE('7/24/2006','MM/DD/YYYY)
AND tp.PRFINISH < TO_DATE('9/25/2006','MM/DD/YYYY) + 2This should yeild the same result and will allow any indexes to be used.
Without a formatted execution plan and more info from you, this is just a wild guess as to what part of the problem might be.
HTH
David
After a further look, the cartesian product appears to be in the bold section:
SELECT
temp21.resource_code
,temp21.employee_type employee_type
,temp21.resource_name resource_name
,temp21.manager_id
,temp21.manager_name
,temp21.period_start
,temp21.period_finish
,temp21.avail_hours
,temp21.act_hours
,temp21.timesheet_status timesheet_status
,temp21.email,temp21.ouc
,temp21.work_country
,f.level1_unit_id level1_id
,f.level2_unit_id level2_id
,f.level3_unit_id level3_id
,f.level4_unit_id level4_id
,f.level5_unit_id level5_id
,f.level6_unit_id level6_id
,f.level7_unit_id level7_id
,f.level8_unit_id level8_id
,f.level9_unit_id level9_id
,f.level10_unit_id level10_id
,f.level1_name
,f.level2_name
,f.level3_name
,f.level4_name
,f.level5_name
,f.level6_name
,f.level7_name
,f.level8_name
,f.level9_name
,f.level10_name
FROM ( SELECT
avail.res_id
,avail.resource_code
,avail.employee_type
,avail.person_type
,avail.resource_name
,avail.manager_id
,avail.manager_name
,avail.period_start
,avail.period_finish
,avail.avail_hours
,NVL(act.act_hours,0) act_hours
,act.timesheet_status
,avail.prid
,avail.email
,avail.ouc
,avail.work_country
FROM ( SELECT /*+ALL_ROWS*/
r.id res_id
,lk.name employee_type
,r.unique_name resource_code
,r.person_type
,r.first_name||' '||r.last_name resource_name
,r.manager_id manager_id
,r1.first_name||' '||r1.last_name manager_name
,TRUNC(tp.prstart) period_start
,TRUNC(tp.prfinish - 1) period_finish
,NVL(o.gs_hrs_avail_week,0) avail_hours
,r.email
,o.ouc
,o.work_country
,tp.prid
FROM
niku.ODF_CA_RESOURCE o
,niku.SRM_RESOURCES r
,niku.SRM_RESOURCES r1
,niku.PRTIMEPERIOD tp
,niku.CMN_SEC_USER_GROUPS usr_grp
,niku.CMN_SEC_GROUPS grp
,( SELECT
NLS.NAME
,LKP.ID
FROM
CMN_CAPTIONS_NLS NLS,
CMN_LOOKUPS LKP
WHERE
NLS.PK_ID=LKP.ID
AND LKP.LOOKUP_TYPE='SRM_RESOURCE_TYPE'
AND NLS.TABLE_NAME='CMN_LOOKUPS'
AND NLS.LANGUAGE_CODE='en'
) lk
WHERE r.id=o.id
AND r1.user_id(+)=r.manager_id
AND r.user_id=usr_grp.user_id
AND usr_grp.GROUP_ID=grp.id
AND r.person_type=lk.id
AND r.is_active = 1
AND r1.is_active = 1
AND grp.GROUP_CODE='gs_tb'
AND tp.prisopen = 1
) avail
,( SELECT
r.id
,tp.prid
,SUM(NVL(practsum,0)/3600) act_hours
,ts.prstatus timesheet_status
FROM
niku.SRM_RESOURCES r
,niku.PRTIMESHEET ts
,( SELECT /*+ALL_ROWS*/
MAX(prid) prid
,prtimeperiodid
,prresourceid
FROM
niku.prtimesheet
GROUP BY
prtimeperiodid,
prresourceid
) ts_new
,niku.PRTIMEENTRY te
,niku.PRTIMEPERIOD tp
,niku.CMN_SEC_USER_GROUPS usr_grp
,niku.CMN_SEC_GROUPS grp
WHERE
ts.prid=ts_new.prid
AND ts.prtimeperiodid=ts_new.prtimeperiodid
AND ts.prresourceid=ts_new.prresourceid
AND r.id=ts.PRRESOURCEID
AND ts.PRID=te.PRTIMESHEETID
AND ts.PRTIMEPERIODID=tp.prid
AND usr_grp.USER_ID=r.USER_ID
AND grp.id=usr_grp.group_id
AND r.is_active=1
AND tp.PRISOPEN=1
AND ts.prstatus not in(0,2,5)
AND grp.group_code='gs_tb'
AND TRUNC(tp.PRSTART) >= TRUNC(TO_DATE('7/24/2006','MM/DD/YYYY HH:MI:SS AM'))
AND TRUNC(tp.PRFINISH-1) <= TRUNC(TO_DATE('9/25/2006','MM/DD/YYYY HH:MI:SS AM'))
GROUP BY r.ID
,tp.PRID
,ts.prstatus
) act
WHERE act.id(+) = avail.res_id
AND act.prid(+) = avail.prid
AND (avail.avail_hours - NVL(act.act_hours,0) > 0)
)temp21
,prj_obs_associations o1
,nbi_dim_obs f
WHERE 1=1
AND temp21.prid in ( SELECT prid
FROM PRTIMEPERIOD
WHERE TRUNC(PRSTART) >= TRUNC(TO_DATE('7/24/2006','MM/DD/YYYY HH:MI:SS AM'))
AND TRUNC(PRFINISH-1) <= TRUNC(TO_DATE('9/25/2006','MM/DD/YYYY HH:MI:SS AM'))
AND
temp21.res_id = o1.record_id
AND o1.unit_id = f.obs_unit_id
AND o1.table_name = 'SRM_RESOURCES'
AND f.obs_type_id = 5000009
AND f.level5_unit_id = 5013334
ORDER BY temp21.manager_name
,temp21.manager_id
,temp21.resource_name
,temp21.resource_code
,temp21.period_start
,temp21.period_finish
,temp21.timesheet_status Message was edited by:
david_tyler -
Tuning (SQL Query has radically different Buffer GETS in each instance)
I have been noticing that on Node2 of my 10.2.0.3 RAC cluster CPU has been running 90% for the past couple of days and on Node1 we are at the normal 20-30%. I was comparing AWR for both instances and noticed that the same exact SQL was showing different GETS on each instance.
Both Instances are configured exactly the same. SGA 3GB, 2 dual core 1.5Ghz CPU on Solaris 10.
AWR For Node 1
SQL ordered by Gets
Resources reported for PL/SQL code includes the resources used by all SQL statements called by the code.
Total Buffer Gets: 8,199,224
Captured SQL account for 94.2% of Total
Buffer Gets Executions Gets per Exec %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
4,834,470 16,465 293.62 58.96 442.34 459.42 cs3w0nz7uanhc BEGIN HRW_EC_QUERY.CHECK_STUDE...
4,561,082 16,469 276.95 55.63 411.10 430.16 6vbpbvfburc4x SELECT COUNT(SECURE_PROGRAMS.P... AWR For Node 2
Buffer Gets Executions Gets per Exec %Total CPU Time (s) Elapsed Time (s) SQL Id SQL Module SQL Text
219,779,881 9,306 23,617.01 99.26 11791.62 32202.99 cs3w0nz7uanhc BEGIN HRW_EC_QUERY.CHECK_STUDE...
219,320,634 9,302 23,577.79 99.05 11760.22 32137.23 6vbpbvfburc4x SELECT COUNT(SECURE_PROGRAMS.P... Gets on Node 2 are about 45 times what they are on node 1. We are using bind variables in the SQL. The statements are completely identical. Anyone seen this before?
Thanks,
BrianAll parameters are the same between instances. Here is the result of the query.
PLAN_TABLE_OUTPUT
SQL_ID 6vbpbvfburc4x
SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID
FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =
T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND
SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2
Plan hash value: 25280318
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 730 (100)| |
| 1 | SORT AGGREGATE | | 1 | 57 | | |
| 2 | HASH JOIN | | 116 | 6612 | 730 (1)| 00:00:09 |
| 3 | COLLECTION ITERATOR PICKLER FETCH| | | | | |
| 4 | NESTED LOOPS | | 48596 | 2610K| 705 (1)| 00:00:09 |
| 5 | INDEX RANGE SCAN | SECURE_PROGRAMS_IDX_04 | 4 | 76 | 2 (0)| 00:00:01 |
| 6 | INDEX RANGE SCAN | HRW_EC_ACTIVE_ITEM_IDX_03 | 10984 | 386K| 176 (1)| 00:00:03 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$62A3881B
5 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1
6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1
SQL_ID 6vbpbvfburc4x
SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID
FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =
T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND
SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2
Plan hash value: 219484150
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 4845 (100)| |
| 1 | SORT AGGREGATE | | 1 | 57 | | |
| 2 | HASH JOIN | | 2066 | 115K| 4845 (2)| 00:00:59 |
| 3 | INDEX RANGE SCAN | SECURE_PROGRAMS_IDX_04 | 79 | 1501 | 2 (0)| 00:00:01 |
| 4 | HASH JOIN | | 3284 | 121K| 4843 (2)| 00:00:59 |
| 5 | COLLECTION ITERATOR PICKLER FETCH| | | | | |
| 6 | INDEX FAST FULL SCAN | HRW_EC_ACTIVE_ITEM_IDX_03 | 1373K| 47M| 4803 (2)| 00:00:58 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$62A3881B
3 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1
6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1
Note
- SQL profile "SYS_SQLPROF_014414387fd00001" used for this statement
SQL_ID 6vbpbvfburc4x
SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID
FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =
T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND
SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2
Plan hash value: 740005210
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 4845 (100)| |
| 1 | SORT AGGREGATE | | 1 | 57 | | |
| 2 | HASH JOIN | | 7 | 399 | 4845 (2)| 00:00:59 |
| 3 | COLLECTION ITERATOR PICKLER FETCH| | | | | |
| 4 | HASH JOIN | | 2992 | 160K| 4821 (2)| 00:00:58 |
| 5 | INDEX RANGE SCAN | SECURE_PROGRAMS_IDX_04 | 33 | 627 | 2 (0)| 00:00:01 |
| 6 | INDEX FAST FULL SCAN | HRW_EC_ACTIVE_ITEM_IDX_03 | 1373K| 47M| 4803 (2)| 00:00:58 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$62A3881B
5 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1
6 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1
Note
- SQL profile "SYS_SQLPROF_014414387fd00001" used for this statement
SQL_ID 6vbpbvfburc4x
SELECT COUNT(SECURE_PROGRAMS.PROG_ID) FROM SECURE_PROGRAMS,HRW_EC_ACTIVE_ITEM, (SELECT ACTIVE_ITEM_ID
FROM TABLE(CAST(:B1 AS HRW_EC_ACTIVE_ITEM_ID_TABLE_T)) ) T WHERE HRW_EC_ACTIVE_ITEM.ACTIVE_ITEM_ID =
T.ACTIVE_ITEM_ID AND HRW_EC_ACTIVE_ITEM.SPROG_ID = SECURE_PROGRAMS.PROG_ID AND
SECURE_PROGRAMS.STUDENT_RESOURCES_URL = :B2
Plan hash value: 1418188916
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2136 (100)| |
| 1 | SORT AGGREGATE | | 1 | 57 | | |
| 2 | HASH JOIN | | 3 | 171 | 2136 (1)| 00:00:26 |
| 3 | NESTED LOOPS | | 1103 | 60665 | 2111 (1)| 00:00:26 |
| 4 | INDEX RANGE SCAN | SECURE_PROGRAMS_IDX_04 | 12 | 228 | 2 (0)| 00:00:01 |
| 5 | INDEX RANGE SCAN | HRW_EC_ACTIVE_ITEM_IDX_03 | 10984 | 386K| 176 (1)| 00:00:03 |
| 6 | COLLECTION ITERATOR PICKLER FETCH| | | | | |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$62A3881B
4 - SEL$62A3881B / SECURE_PROGRAMS@SEL$1
5 - SEL$62A3881B / HRW_EC_ACTIVE_ITEM@SEL$1 Thanks,
Brian -
How to tune "Buffer Get" offender
QUESTION: How to tune following sql
SELECT *
FROM trans
WHERE accountid = NVL (NULL, accountid)
AND transtypeid = 171
AND NVL (description, '-1') = NVL ('Card Activation Fee ', '-1')
AND ABS (transamt) = ABS (9.95)
AND accountid <> 7689966
AND postdate BETWEEN ( TO_DATE ('03/14/2006 00:17:43',
'mm/dd/yyyy hh24:mi:ss'
- .00011574
AND ( TO_DATE ('03/14/2006 00:17:53',
'mm/dd/yyyy hh24:mi:ss'
+ .00011574
DETAILS:
Statspack has shown this piece of SQL as the largest contender for "Buffer Gets" chewing up 513.28 seconds of CPU time out of 3,475 (See Top 5 Timed Events below)
However, when I run the sql statement by itself in TOAD, it takes 90ms to complete and has a cost of 202 (See plan below). TRANS table has over 18m rows.
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 1 202
TABLE ACCESS BY INDEX ROWID SVOLTP.TRANS 1 65 202
INDEX RANGE SCAN SVOLTP.TRANS_POSTDATE_NIDX 1 K 7
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Ela Time
CPU time 3,475 49.99
db file sequential read 1,340,884 3,197 45.99
db file scattered read 180,048 70 1.01
db file parallel write 3,983 49 .70
log file sync 20,593 43 .63here is the actual statement taken from the package:
select transid
into lFromTransID
from trans
where accountid = nvl(lacctid, accountid)
and transtypeid = lToTrans.transtypeid
and nvl(description, '-1') = nvl(lToTrans.description, '-1')
and abs(transamt) = abs(lToTrans.transamt)
and accountid <> lToTrans.accountid
-- Transactions must be posted within 10 seconds of each other
and postdate between (lToTrans.postdate - .00011574) and (lToTrans.postdate + .00011574); -
INSERT causing lots of buffer gets
select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionSQL
desc tab
Name Null? Type
DEF_ID NOT NULL VARCHAR2(64)
INST_ID NOT NULL VARCHAR2(64)
BUSINESS_KEY NOT NULL VARCHAR2(64)
BUSINESS_DATA CLOB
TIME NOT NULL TIMESTAMP(6)
REQUEST_CXT NOT NULL VARCHAR2(4000)
IS_PROCESSED NOT NULL NUMBER(3)
ON_STATUS TIMESTAMP(6)
RVN NOT NULL NUMBER(10)
HV NUMBER(10)
ID NOT NULL VARCHAR2(128)
STATE CHAR(1)
insert into tab(def_id, inst_id, business_key,
businessdata, time, is_processed, next_retry_time, on_status, req_cxt, hv,
id, op_type, rvn ) values
(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, 'I', 0)
BUSINESS_DATA IS A clob datatype
table got two indexes
1.idx1(pk) on (inst_id,def_id,rvn)
2.idx2 on (id,state,op_type)
High buffer gets in past
select a.sql_id,TO_DATE(TO_CHAR(b.BEGIN_INTERVAL_TIME,'DD-MON-YY HH24:MI'),'DD-MON-YY HH24:MI') as sdate,a.PLAN_HASH_VALUE,a.EXECUTIONS_DELTA EXE_D,
case (executions_delta) when 0 then 0 else ceil(a.ROWS_PROCESSED_DELTA/a.EXECUTIONS_DELTA) end as RD,
case (executions_delta) when 0 then 0 else ceil(a.ELAPSED_TIME_DELTA/a.EXECUTIONS_DELTA) end as ELA_D_MCR_SEC,
case (executions_delta) when 0 then 0 else ceil(a.BUFFER_GETS_DELTA/a.EXECUTIONS_DELTA) end as BG_D,
case (executions_delta) when 0 then 0 else ceil(a.IOWAIT_DELTA/a.EXECUTIONS_DELTA) end as W_IO_D_MCR_SEC
from dba_hist_sqlstat a ,dba_hist_snapshot b where a.snap_id=b.snap_id and a.sql_id = 'ayzxbxqvp5dk3' and a.PARSING_SCHEMA_NAME='SAL_WORKFLOW'
and BEGIN_INTERVAL_TIME>=TO_DATE('27-MAR-2013 21:00', 'dd-mon-yyyy hh24:mi') AND END_INTERVAL_TIME<=TO_DATE('27-MAR-2013 23:00', 'dd-mon-yyyy hh24:mi')
order by 1,2;
SQL_ID SDATE PLAN_HASH_VALUE EXE_D RD ELA_D_MCR_SEC BG_D W_IO_D_MCR_SEC
ayzxbxqvp5dk3 27.Mar.13/21:00:00 0 2406 1 15876 1396 7052
ayzxbxqvp5dk3 27.Mar.13/21:10:00 0 2502 1 16401 1420 7001
ayzxbxqvp5dk3 27.Mar.13/21:20:00 0 3552 1 17444 1203 7183
ayzxbxqvp5dk3 27.Mar.13/21:30:00 0 2825 1 17860 1474 6310
ayzxbxqvp5dk3 27.Mar.13/22:00:00 0 1942 1 16250 1629 6510
ayzxbxqvp5dk3 27.Mar.13/22:10:00 0 2114 1 16276 1795 6170
ayzxbxqvp5dk3 27.Mar.13/22:20:00 0 2031 1 16769 1746 6604
ayzxbxqvp5dk3 27.Mar.13/22:40:00 0 2233 1 16435 1838 6348
8 rows selected.
select a.sql_id,TO_DATE(TO_CHAR(b.BEGIN_INTERVAL_TIME,'DD-MON-YY HH24:MI'),'DD-MON-YY HH24:MI') as sdate,a.PLAN_HASH_VALUE,a.EXECUTIONS_DELTA EXE_D,
case (executions_delta) when 0 then 0 else ceil(a.ROWS_PROCESSED_DELTA/a.EXECUTIONS_DELTA) end as RD,
case (executions_delta) when 0 then 0 else ceil(a.ELAPSED_TIME_DELTA/a.EXECUTIONS_DELTA) end as ELA_D_MCR_SEC,
case (executions_delta) when 0 then 0 else ceil(a.BUFFER_GETS_DELTA/a.EXECUTIONS_DELTA) end as BG_D,
case (executions_delta) when 0 then 0 else ceil(a.IOWAIT_DELTA/a.EXECUTIONS_DELTA) end as W_IO_D_MCR_SEC
from dba_hist_sqlstat a ,dba_hist_snapshot b where a.snap_id=b.snap_id and a.sql_id = 'ayzxbxqvp5dk3' and a.PARSING_SCHEMA_NAME='SAL_WORKFLOW'
and BEGIN_INTERVAL_TIME>=TO_DATE('26-MAR-2013 21:00', 'dd-mon-yyyy hh24:mi') AND END_INTERVAL_TIME<=TO_DATE('26-MAR-2013 23:00', 'dd-mon-yyyy hh24:mi')
order by 1,2;
SQL_ID SDATE PLAN_HASH_VALUE EXE_D RD ELA_D_MCR_SEC BG_D W_IO_D_MCR_SEC
ayzxbxqvp5dk3 26.Mar.13/21:00:00 0 2948 1 11052 21 10543
ayzxbxqvp5dk3 26.Mar.13/21:30:00 0 2042 1 12381 23 11857
ayzxbxqvp5dk3 26.Mar.13/21:40:00 0 2329 1 12089 23 11586
ayzxbxqvp5dk3 26.Mar.13/21:50:00 0 2421 1 12209 23 11684
ayzxbxqvp5dk3 26.Mar.13/22:00:00 0 2360 1 10889 22 10398
ayzxbxqvp5dk3 26.Mar.13/22:10:00 0 2081 1 11059 22 10562
ayzxbxqvp5dk3 26.Mar.13/22:20:00 0 2384 1 11464 22 10894
ayzxbxqvp5dk3 26.Mar.13/22:40:00 0 2196 1 11514 22 11021
8 rows selected.Table is a non partitioned table without any trigger.
select OWNER,TABLE_NAME,SEGMENT_NAME,COLUMN_NAME,INDEX_NAME,CHUNK,ENCRYPT,COMPRESSION,SECUREFILE from dba_lobs where TABLE_NAME='&TABLE_NAME';
OWNER TABLE_NAME SEGMENT_NAME COLUMN_NAME INDEX_NAME CHUNK ENCR COMPRE SEC
CLASS TAB SYS_LOB0000119958C00004$$ BUSINESS_DATA SYS_IL0000119958C00004$$ 8192 NONE NONE NO
COLUMN_NAME NUM_DISTINCT NUM_NULLS LAST_ANALYZED SAMPLE_SIZE AVG_COL_LEN HISTOGRAM DENSITY
BUSINESS_DATA 0 0 16.Apr.13/09:28:06 14584877 87 NONE .0000000000Can anyone help me troubleshoot such high spike in buffer_gets ?>
Can anyone help me troubleshoot such high spike in buffer_gets ?
>
You haven't posted anything indicating a 'high spike in buffer_gets'.
All you posted are two sets of data with one set having higher values. Nothing indicates that the values are wrong or larger than they should be.
When a new row is inserted it goes into a block. Oracle has to 'get' that block before it can put the row into it. The more rows you INSERT the more blocks that will likely be needed and the more 'gets' that will likely occur.
You need to post something to support your assertion that there has been a 'spike' and also need to post some reason why that would be an issue even if there has been a spike. -
Hi all,
possible someone could help me on following issue:
I'm working for a software vendor and one of our customers is reporting that especially 2 of the sql statements of our application are " executed ineffective" on their database environment.
They are especially saying that "These statements are consuming a lot of CPU and doing a lot of buffer gets in relation to the number of executions."
They provided following extracts out of the statspack report.
SQL1:
SQL Statistics
~~~~~~~~~~~~~~
-> CPU and Elapsed Time are in seconds (s) for Statement Total and in
milliseconds (ms) for Per Execute
% Snap
Statement Total Per Execute Total
Buffer Gets: 322,101 16.6 .89
Disk Reads: 631 0.0 .48
Rows processed: 19,444 1.0
CPU Time(s/ms): 19 1.0
Elapsed Time(s/ms): 26 1.3
Sorts: 0 .0
Parse Calls: -2 -.0
Invalidations: 0
Version count: 1
Sharable Mem(K): 43
Executions: 19,444 SQL2:
SQL Statistics
~~~~~~~~~~~~~~
-> CPU and Elapsed Time are in seconds (s) for Statement Total and in
milliseconds (ms) for Per Execute
% Snap
Statement Total Per Execute Total
Buffer Gets: 628,517 22.9 3.26
Disk Reads: 128 0.0 .18
Rows processed: 27,492 1.0
CPU Time(s/ms): 27 1.0
Elapsed Time(s/ms): 30 1.1
Sorts: 0 .0
Parse Calls: 0 .0
Invalidations: 0
Version count: 1
Sharable Mem(K): 39
Executions: 27,492 The SQL1 is an update and SQL2 an Insert on the same table.
The accessed table has 6 indexes and a primary key column. On SQL1, the update, the where condition is reffering to the primary key column.
Both statements are using bind variables.
From my point, I would say, that the customer should provide the execution plan of both statements to verify that SQL1 is using the primary key.
As far as I understand "buffer gets" this issn't an issue because it's only saying that the data coumes out of the cache (which would be good) instead of reading the data from disk.
But I don't really see there any bottleneck.
Could you please give me some suggestions?
Many Thanks
JoergHi,
Recently we have encountered one performance issue, which is most likely caused by a sudden increase in the buffer gets per execution.
The SQL is an update statement, updating a table using a primary key (we have checked to confirm the running execution plan is using the primary key), and one field being updated is a BLOB column.
As shown in the below statistics, there is no major change in the number of executions during the every 20 minutes monitoring interval. However, the buffer gets per executions has been more than double, and the CPU time is almost doubled, hence the exec_time (elapsed time) has been doubled.
The same SQL has been running for the past four years in multiple similar databases. The database is Oracle 9.2.0.4 running on Solaris 9. For the past 300 days, the average elapsed time per execution is about 0.0093s, while the average buffer gets per execution is about 670. The update statement has been executed about 9 times per second.
The question is why there is a sudden increase in the buffer gets? The sudden increase happened twice for the past two days.
<pre>
B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
2009-11-25-12:23 2009-11-25-12:43 9363 .0081 .008 530.04 671338
2009-11-25-12:43 2009-11-25-13:03 11182 .0083 .008 538.59 799772
2009-11-25-13:03 2009-11-25-13:23 10433 .0078 .0077 474.61 761970
2009-11-25-13:23 2009-11-25-13:43 10043 .008 .0078 496.65 713581
2009-11-25-13:43 2009-11-25-14:04 8661 .0076 .0074 401.22 598169
2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
2009-11-25-17:05 2009-11-25-17:24 9625 .0189 .0181 2214.07 745829
2009-11-25-17:24 2009-11-25-17:44 9764 .016 .0154 1877.34 679782
2009-11-25-17:44 2009-11-25-18:04 8812 .0167 .0163 1989.61 652405
2009-11-26-07:24 2009-11-26-07:43 8230 .0141 .014 1614.6 614051
2009-11-26-07:43 2009-11-26-08:04 11494 .0165 .0159 1833.1 785044
2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
2009-11-26-10:05 2009-11-26-10:24 10179 .0289 .0269 3597.24 764088
2009-11-26-10:24 2009-11-26-10:45 10216 .032 .0286 3879.47 681592
2009-11-26-10:45 2009-11-26-11:04 10277 .0286 .0263 3539.44 799219
2009-11-26-11:20 2009-11-26-11:23 1378 .0344 .0312 4261.62 688203
2009-11-26-11:23 2009-11-26-11:36 7598 .0299 .027 3675.36 805481
2009-11-26-11:36 2009-11-26-11:43 3345 .0298 .0272 3610.28 752625
2009-11-26-11:43 2009-11-26-12:03 10383 .0295 .0278 3708.36 728158
2009-11-26-12:03 2009-11-26-12:23 10322 .0332 .03 4002.33 745669
2009-11-26-12:23 2009-11-26-12:43 11847 .0316 .0292 3899.34 852273
2009-11-26-12:43 2009-11-26-13:03 10027 .0331 .0298 4030.5 722546
2009-11-26-13:03 2009-11-26-13:23 10130 .035 .0309 4199.08 730577
2009-11-26-13:23 2009-11-26-13:43 9783 .0331 .0306 4161.3 707915
2009-11-26-13:43 2009-11-26-14:03 10460 .0322 .0291 3947.63 753748
2009-11-26-14:03 2009-11-26-14:23 9452 .0333 .0309 4143.31 678283
2009-11-26-14:23 2009-11-26-14:43 9127 .0318 .03 4051.52 659341
2009-11-26-14:51 2009-11-26-15:03 5391 .0358 .0328 4358.58 652356
2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
</pre>
GaoYuan
Edited by: user12194561 on Nov 26, 2009 7:34 PM -
Sudden increase in buffer gets per executions in update statement
Hi,
Recently we have encountered one performance issue, which is most likely caused by a sudden increase in the buffer gets per execution.
The SQL is an update statement, updating a table using a primary key (we have checked to confirm the running execution plan is using the primary key), and one field being updated is a BLOB column.
As shown in the below statistics, there is no major change in the number of executions during the every 20 minutes monitoring interval. However, the buffer gets per executions has been more than double, and the CPU time is almost doubled, hence the exec_time (elapsed time) has been doubled.
The same SQL has been running for the past four years in multiple similar databases. The database is Oracle 9.2.0.4 running on Solaris 9. For the past 300 days, the average elapsed time per execution is about 0.0093s, while the average buffer gets per execution is about 670. The update statement has been executed about 9 times per second.
The question is why there is a sudden increase in the buffer gets? The sudden increase happened twice for the past two days.
<pre>
B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
</pre>
Yesterday I did a trace on one of the sessions running the update statement, and below is the tkprof output:
<pre>
call count cpu elapsed disk query current rows
Parse 76 0.03 0.00 0 0 0 0
Execute 76 4.58 5.14 0 567843 19034 76
Fetch 0 0.00 0.00 0 0 0 0
total 152 4.61 5.14 0 567843 19034 76
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 88
Rows Row Source Operation
1 UPDATE (cr=30 r=0 w=0 time=6232 us)
1 INDEX UNIQUE SCAN <PK Index Name> (cr=3 r=0 w=0 time=58 us)(object id 81122)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
Waited--------------------------------------------------------------------------------
SQL*Net message to client 152 0.00 0.00
SQL*Net message from client 152 0.00 0.22
SQL*Net more data from client 1894 0.00 0.03
SQL*Net break/reset to client 152 0.00 0.00
buffer busy waits 14 0.00 0.00
enqueue 1 0.61 0.61
</pre>
GaoYuanHi,
I've reformatted your output for better understanding (with {noformat}...{noformat}):
B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
call count cpu elapsed disk query current rows
Parse 76 0.03 0.00 0 0 0 0
Execute 76 4.58 5.14 0 567843 19034 76
Fetch 0 0.00 0.00 0 0 0 0
total 152 4.61 5.14 0 567843 19034 76
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 88
Rows Row Source Operation
1 UPDATE (cr=30 r=0 w=0 time=6232 us)
1 INDEX UNIQUE SCAN <PK Index Name(cr=3 r=0 w=0 time=58 us)(object id 81122)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
SQL*Net message to client 152 0.00 0.00
SQL*Net message from client 152 0.00 0.22
SQL*Net more data from client 1894 0.00 0.03
SQL*Net break/reset to client 152 0.00 0.00
buffer busy waits 14 0.00 0.00
enqueue 1 0.61 0.61
********************************************************************************Can you please provide a DDL for the table, indexes, type of the tablespace(s) they reside in (ASSM/MSSM, extents sizes), the UPDATE statement, how many sessions on average/peaks are doing the same thing concurrently, how many sessions are working this table concurrently and how do they use it? -
Please explain on what does these select statements get from these tables..
Hello Experts,
What does these select statements get?and what are these tables CDHDR and CDPOS used for?
The program that I am currently modifying lets users post documents and the ones that are not posted
are saved in a custom table. Now, we had a scenario in PROD server wherein certain items are not being
fetched as bypassed but we saved it in the bypassed table. Anyway, below is the select statements:
get all change document header within the selected dates
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
FROM cdhdr
WHERE udate IN s_udate
AND objectclas EQ 'CHARGE'
AND tcode IN (lc_tcode_msc1,
lc_tcode_msc2,
lc_tcode_msc1n,
lc_tcode_msc2n,
lv_tcode_vl33n,
'SE38',
'ZGENE').
IF NOT it_cdhdr[] IS INITIAL.
SELECT objectid changenr value_new
FROM cdpos
INTO TABLE it_cdpos
FOR ALL ENTRIES IN it_cdhdr
WHERE objectclas EQ it_cdhdr-objectclas
AND objectid = it_cdhdr-objectid
AND changenr = it_cdhdr-changenr
AND tabname = lc_tabname_mcha
AND fname IN (lc_fname_zustd,'LWEDT').
DELETE it_cdpos WHERE value_new+00(01) = 'X'.
LOOP AT it_cdpos ASSIGNING <fs_cdpos>.
l_matnr = <fs_cdpos>-objectid+00(18).
l_charg = <fs_cdpos>-objectid+22(10).
l_zustd = <fs_cdpos>-value_new+00(01).
READ TABLE it_batch INTO wa_batch
WITH KEY matnr = l_matnr
charg = l_charg.
IF sy-subrc EQ 0.
l_tabix = sy-tabix.
wa_batch-zustd = l_zustd.
MODIFY it_batch FROM wa_batch INDEX l_tabix
TRANSPORTING zustd.
ELSE.
wa_batch-matnr = l_matnr.
wa_batch-charg = l_charg.
wa_batch-zustd = l_zustd.
wa_batch-code = 'A'. "selected within period
APPEND wa_batch TO it_batch.
ENDIF.
ENDLOOP.
ENDIF.Hi,
The first select statement is for Change document header.CDHDR table contains this object class in your case if you change any batch number for any material number from the transaction for example (MB01) you can trace this .
From CDPOS you can trace which tables affected (EX : MCHA) and the new value(l_zustd ).
Regds,
Vinsa.R -
Good or bad to have buffer gets
Is it good to have high buffer gets?
In the manuals it seems they say it is not good ...There is not a query, application, database table or forum that can answer this question. You might see a statement that takes 10 hours to run, performs 42 billion consistent reads and 42 million disk reads...and it is running just fine. There might be a statement that takes 1 minute to run, performs 1000 consistent reads and no disk reads that is the worst performing sql in the application.
Before you decide that I am out of my mind...consider...
The first statement is an overnight batch job that performs an ETL process for the data warehouse. As long as it finishes by 7am the next morning, it does not matter how fast it runs (no one logs in to the system until 8am).
The second statement retrieves the customer account information that is used hundreds of thousands of times during the day by the sales force. I know that I would be an unhappy customer if I had to wait 1 minute every time I called in to place an order.
The only way to find the worst performing sql is to talk to the users and business, have them tell you what their important processes are and how they are impacted by response time.
There is nothing worse than spending hours tuning a sql statement that did not need to be tuned!
Regards,
Daniel Fink
Maybe you are looking for
-
Regarding PDF attachment in Mail
Hi , I have requirement like, Generate the XBRL file in to XHTML and convert it to PDF then send to mail as attachement as .pdf file. I have done upto PDF generating but i am sturck up to send a mail as attachement. main thing is i am not stored in l
-
hello experts How can I put a button into a select screen,beside parametres and select option? I know that is possible with screen painter, but in this case I can't use variant? and I need variant for my program. what is the solution I need help
-
Hi Guy,please take a look to the picture attached . I can't find the Find button to be able to search for directory numbers,instead of uing the drop down list. I have this button in different cucm servers other than this one i am working with now.
-
Merge two iBooks Author glossaries?
Hello, is it possible to merge glossaries from one book to another in one go? Imagine one book has 100 entries (Chemistry) and another has 150 entries (Physics) and these need to appear in a combined Chemistry + Physics book containing the same mater
-
Find by Name can't be set as default?
When I hit command+F I get the Find window but it always defaults to Find By Content. Can I make it default to Find By Name? From the search I did here in the forums there is no way but I thouht to ask again. Thanks in advance