Salesforce

_tablestat-read statistics on wrong table when there is a lob

« Go Back

Information

 
Title_tablestat-read statistics on wrong table when there is a lob
URL Nametablestat-on-wrong-table-when-there-is-a-lob-000079373
Article Number000138151
EnvironmentProduct: OpenEdge
Version: 11.6, 11.7.0
OS: All supported platforms
Other: VST: _tablestat
Question/Problem Description
_tablestat-read shows results for unrelated tables when the table being queried contains a lob
PROMON (Activity Summary) confirms the total number of records read

Simple "FOR EACH" query does not show unrelated table's _tablestat-read
If  BUFFER-COPY uses no-lobs to populate the temp-table, unrelated table's do not show _tablestat metrics
Temp-Table or ProDataset FILL() shows unrelated table's _tablestat-read metrics

There are no triggers that reference the unrelated table's metrics
The ProDataset, DATA-SOURCE buffers does not reference the unrelated tables

The table contains LOB objects.
Database is started with appropriate values for -tablerangesize and -tttablerangesize


 
 
Steps to Reproduce
Clarifying Information
1. Add two BLOB fields to the SalesRep table (sports2000 database)
  • SmallImage
  • LargeImage
2. Run: proutil dbname -C zerostats

3. Run the following ABL code: 
DEF VAR mPtr AS MEMPTR.

FOR EACH salesrep:
    mPtr = salesrep.SmallImage.
    SET-SIZE(mPtr) = 0.
    mPtr = salesrep.LargeImage.
    SET-SIZE(mPtr) = 0.
END.

4. Query the _tablestat metrics.  Apart from SalesRep showing Reads, the unrelated Employee and Department tables also show the same number of reads.
FOR EACH _tablestat NO-LOCK  WHERE _tablestat-read  > 0:
   FIND _file no-lock WHERE _file-num = _tablestat-id.
   DISPLAY
     _file-name
     _tablestat-id
     _tablestat-read
   WITH WIDTH 100.
END.


 
Error Message
Defect NumberDefect PSC00355668
Enhancement Number
Cause
Access to the LOB data causes _table-stats (and PROMON) report reads that do not occur. In part this is due to the fact that there is no backward pointer from LOB records where the object number of the lob is being used to their parent table record.

During the record read, the object Id of the lob is incorrectly being used to collect table stats.
There is no place to add rm statistics for the lobs.

Associating rm stats for associated lobs in with the table stats is confusing since lob and record stats are different:
  • When reading a lob there can be more record read stats than expected as (records read + lobs read) is reported as records read.
  • When a lob field is updated in a record, it may generate multiple lob updates in the stats. From this perspective, lob updates are more like a record updates that involves many record fragments.
  • When deleting a lob this will be reported as deleting a record of the associated table which is incorrect
  • When deleting one record, one or more lobs will be deleted resulting the the tablestat reporting multiple records deleted
Resolution
Upgrade to OpenEdge 11.7.1 Service Pack where LOB activity is no longer recorded as table activity in the _tablestat statistics.

In OpenEdge 12.0Large Object (LOB) Activity Statistics were introduced.

Database Startup Parameters:
  • -baselob : Can be queried and is modifiable at runtime with VST _Dbparams
  • -baseuserlob : Can be queried and is modifiable at runtime with VST _Dbparams
  • -lobrangesize : Can be queried but is not modifiable at runtime with VST _Dbparams
VST tables:

The following VST tables record LOB activity:
  • _LobStat 
  • _UserLobStat 
Lob stats are different to Table statistics:
  • A table read or update is an operation to read or update a record in a table; 
  • A lob read or update is a read or update operation on a lob field or a segment of a lob field.  There could be multiple lob reads or updates for a lob field for a single record read when the lob field is very big. 
  • For lob deletes there is a one-to-one mapping for lob/rec deletes.
  • The activity for all lobs associated with the table being monitored are recorded.  
  • When a table has one or more lobs, the sum of their activity is recorded. 
  • When multiple updates or reads to lobs occur, then several updates or reads are recorded.  
  • When a single lob update or read occurs that performs updates or reads of multiple lob fragments then these are recorded as one update or read request.
Workaround
Notes
Keyword Phrase
Last Modified Date5/7/2019 12:22 PM

Powered by