DocBook|Search
Class Reference
%SYS.PTools.SQLBenchMarkQueries
   
Server:basexml
Instance:SOAXML
User:UnknownUser
 
-
  [BASEXML] >  [%SYS] >  [PTools] >  [SQLBenchMarkQueries]
Private  Storage  

persistent class %SYS.PTools.SQLBenchMarkQueries extends %Persistent

This Class gets populated from the %SYS.PTools.SQLStats.Init() method when gathering stats is turned on. There is more info on how to run Stats in %SYS.PTools.SQLStats.

The class contains the SQLText, the Job Number, the Time Stamp from when the query was run, and the Parameters that were used.

The Method Run will loop over all the saved queries and execute them one after the other.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 2 1


Summary

Properties
JobNumber NameSpace PValues QueryText RunTime

Methods
%%OIDGet %AddToSaveSet %AddToSyncSet %BMEBuilt
%BuildIndices %CheckUnique %ClassIsLatestVersion %ClassName
%ComposeOid %ConstructClone %Delete %DeleteExtent
%DeleteId %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Exists %ExistsId %Extends %GUID
%GUIDSet %GetLock %GetParameter %GetSwizzleObject
%Id %InsertBatch %IsA %IsModified
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectModified
%Oid %OnBeforeAddToSync %OnDetermineClass %Open
%OpenId %OriginalNamespace %PackageName %PhysicalAddress
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SaveIndices
%SerializeObject %SetModified %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent %UnlockId
%ValidateObject Parse Run


Properties

• property JobNumber as %String;
• property NameSpace as %String;
• property PValues as array of %String;
• property QueryText as %String(MAXLEN=15000);
• property RunTime as %TimeStamp;

Methods

• classmethod Parse(sql) as %String
• classmethod Run(NameSpace As %String, Display As %Integer = 1) as %Status

This is a simple example of what can be done with the data stored in this table.

This method take 2 parameters:

  • NameSpace - the NameSpace where you want to run the Benchmark
  • Display - 1 or 0 to control output to the screen

This method will loop over the queries that are stored in this classes and execute them as Dynamic SQL statements SQLStats is turned off for this run and the state is returned when the code finishes The code will display and save data for fetching the first row and for fetching all the rows The data saved will be: Global Refs, Lines of Code, Rows Returned, and Total Time. All the results are stored in the %SYS.SQLBenchMarkResults class.


Queries

• query QueryWithParameters()
SQL Query as view "Query_With_Parameters":
SELECT P.Id, P.NameSpace, P.QueryText, P.RunTime, P.JobNumber, PV.PValues
FROM %SYS_PTools.SQLBenchMarkQueries P
LEFT OUTER JOIN %SYS_PTools.SQLBenchMarkQueries_PValues PV ON P.ID = PV.SQLBenchMarkQueries