Kbase P90631: Discrepancy between promon and VSTs for buffer hits
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/12/2009 |
|
Status: Verified
SYMPTOM(s):
Discrepancy between promon and VSTs for buffer hits
promon and VSTs show different values for buffer hits
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
CAUSE:
The calculation (cf. 4GL Program to calculate APW, BIW and AIW activity from VST) -
DISPLAY ((_Buffer-LogicRds - _Buffer-OSRds) * 100.0) / _Buffer-LogicRds
- and the various promon options where Buffer Hits can be seen -
promon > 5. Activity
promon > R&D > 2. Activity Displays ... > 3. Buffer Cache
- are measuring different things. Both read the values of counters in the database that are incremented as work is done with the database, but the _Buffer-LogicRds includes reads of index blocks, whereas the promon is reading just data blocks.
Without access to the Progress source code (which technical support had to check to narrow down the issue), it can only be shown indirectly that this is the case. The following example was tested using OpenEdge 10.0A01 on AIX 5.2 -
1. prodb sports sports
2. proserve sports
3. proutil sports -C ixanalys Information for the Cust-Num index for table Customer can be seen -
Table Index Fields Levels Blocks Size % Util Factor
PUB.Customer
Cust-Num 12 1 1 1 755.0B 75.8 1.0
4. mpro sports - p checkreads.p
/* checkreads.p */
DEF VAR iBefore AS INTEGER.
/* Collect data before finding the record. */
FIND FIRST _ActBuffer.
iBefore = _Buffer-LogicRds.
/* Do whatever. */
FIND customer WHERE Cust-Num = 1 NO-LOCK.
/* Collect data after finding the record. */
FIND FIRST _ActBuffer.
/* Display the difference. */
DISPLAY _Buffer-LogicRds - iBefore.
The displayed result will be 2, and this can be taken as indicating that _Buffer-LogicRds are also including index block reads. If the data in _Buffer-LogicRds, that is, was indeed only counting the number of data [record] reads, the displayed result would have been 1. Instead, the result of 2 is the number of levels for the Cust-Num index plus 1.
Basically, _Buffer-LogicRds reflects the fact that what Progress does when retrieving a record is that it starts off by looking into the index root node and navigates the index down to the leaf node (which implies reading as many index blocks as the number of index levels); once in the leaf node the key entry with the value being looked for is found, and then the record is retrieved thanks to the recid stored in the key entry itself, giving one more read.
FIX:
There will be some variation between values given by the suggested VST-based calculation for buffer hits and values returned by the various ways of checking buffer hits using promon. VSTs measure the same type of information as promon, but that doesn't entail that the information will be exactly the same.
Using VSTs there is currently no means to mirror the exact calculation used in promon.