Try OpenEdge Now
skip to main content
Debugging and Troubleshooting
Troubleshooting Resources : Other Diagnostics Resources : Run-time diagnostics : Index Statistics file
 
Index Statistics file
The following example shows how to read the _IndexStat VST and get the index and table names. You will not see any records if the session is not started with a value greater than 0 for -ttindexrangesize, or if there are no temp-tables with an ID in the specified range.

Read a _IndexStat VST

USING Progress.Database.*.
def var hVST as handle.
def var hbVST as handle.
def var hq as handle.
DEF VAR cProc AS CHAR .
DEF VAR cIndex AS CHAR .
hVST = TempTableInfo:GetVSTHandle (VSTTableId:IndexStatId) .
hbVST = hvst:default-buffer-handle.
create query hq.
hq:set-buffers(hbVST).
hq:query-prepare("for each " + hbVST:name).
hq:query-open().
/* for each _IndexStat record */
repeat:
hq:get-next().
/* check if there are no more records */
if hq:query-off-end then leave.
/* check if index-id represents an index that is currently in scope at this time.
Calling the overloaded version that returns just the index name and
the procedure that instantiated the temp-table.
*/
IF TempTableInfo:GetIndexInfoByID(hbVST::_IndexStat-Id,
OUTPUT cIndex,OUTPUT cProc)
THEN DO:
DISP cIndex + " IN " + cProc FORMAT "X(70)"WITH NO-LABELS.
/* disp the data from the _indexStat record */
DISP "Create:" hbVST::_IndexStat-Create
"Delete:" hbVST::_IndexStat-Delete
"Block Delete:" hbVST::_IndexStat-BlockDelete
"Read:" hbVST::_IndexStat-Read
"OSRead:" hbVST::_IndexStat-OSRead
"Split:" hbVST::_IndexStat-Split.
PAUSE.
CLEAR ALL.
END.
END.