Building Blocks > Solution-Specific Building Blocks > Operation KPI Building Block > Database Schema (Operation KPI Building Block)
Database Schema (Operation KPI Building Block)
The operation KPI building block leverages the PTC.DBConnection building block to implement the database. All database configurations and rules can be found by examining the GetDBInfo service on the PTC.OperationKPIImpl.Manager_TT Thing.
The following diagram shows the schema for the operation KPI database objects:
Database schema diagram for the operation KPI building block.
The following Data Shapes in the PTC.OperationKPI project define the objects in the database schema:
PTC.OperationKPI.ProductionBlock—Contains the properties for a production block.
PTC.OperationKPI.ProductionEvent—Contains the properties for a production event.
PTC.OperationKPI.AvailabilityEvent—Contains the properties for an availability event.
PTC.OperationKPI.LossEvent—Contains the properties for a loss event.
* 
The AggregatedAvailabilityEvent, AggregatedLossEvent, AggregatedProductionEvent, and AggregatedJobOrder database tables are back-end database tables that do not have Data Shapes in ThingWorx.
Events and Job Order Aggregation
To enhance the performance of calculations that involve event durations and job order information, such as calculations used for waterfall, trend, and bottleneck charts, historical events and job orders are aggregated daily by the PTC.OperationKPIImpl.EventsAggregationScheduler scheduler into the AggregatedAvailabilityEvent, AggregatedLossEvent, AggregatedProductionEvent, and AggregatedJobOrder database tables.
The data that is aggregated into the AggregatedAvailabilityEvent, AggregatedLossEvent, AggregatedProductionEvent database tables come from the tables defined by the PTC.OperationKPI.AvailabilityEvent, PTC.OperationKPI.LossEvent, and PTC.OperationKPI.ProductionEvent Data Shapes, respectively.
The data that is aggregated into the AggregatedJobOrder database table comes from the tables defined by the PTC.JobOrder.JobOrderExecutionResponse and PTC.Shift.ShiftInstance Data Shapes.
To be considered historical for purposes of aggregation, an event must be 14 days old and a job order must have been completed at least 14 days ago. This 14 day age is the default setting of the minEventAgeInDays property on the PTC.OperationKPIImpl.SQLThingUtility Thing.
Was this helpful?