job_hour_history
- Last UpdatedNov 19, 2024
- 3 minute read
The job_hour_history table holds job hour history data that is used in the calculation of TPM (Total Performance Management) statistics by job and hour to make reporting faster.
Because job statistical data for the current records is considered volatile with a possibility of changing frequently, only the statistical data that occurs before or during the cut‑off period prior to the current time is updated. These updates are performed on an hourly basis. Statistical data that occurs after the cut‑off period is calculated dynamically for TPM statistics and is not maintained in this table.
The default cut-off period is 2 hours, which means updates are done hourly for the 3rd hour prior to the current time. So, for example, at 9 am, the statistical data for the 6‑am hour will be updated. However, statistical data for the 7‑am hour and newer is not maintained. That statistical data will be dynamically calculated upon the TPM statistics data being called.
The job statistical data includes the following fields:
-
qty_good
-
qty_reject
-
runtime
-
downtime
-
idletime
If an entity can track OEE statistics, the following occurrences will cause data write operations to this table:
-
When a job is started, a new job_hour_history record is created
-
If a job is currently running, at the top of the hour (during hourly task execution) a new job_hour_history record is created
-
A new job is inserted in the job_history table after the fact
-
A job duration is modified after the fact and the job end time is within the time period of records in the table
-
A utilization event is modified after the fact and the event time is within the time period of records in the table
-
Production quantity adjustments are made after the fact and the production event time is within the time period of records in the table
Note the following about hour start and end fields:
-
For TPM statistics, the hour boundaries are determined based on UTC, for consistency and data integrity.
-
For the hour_start_utc and hour_end_utc fields, minutes and seconds are always 0. However, for the hour_start_local and hour_end_local fields, the minutes could be at the 15‑ or 30‑minute mark. For example, the IST timezone is +5:30 hours from UTC. Therefore, the local time will always begin and end at the 30‑minute mark.
Several fields in the table that could be marked as foreign keys are not in case the primary key item is eliminated, but the ID number is still meaningful.
|
Field |
Datatype |
PK |
Nulls? |
Description |
|---|---|---|---|---|
|
ent_id |
int32 |
Y |
N |
Identifies the entity. |
|
wo_id |
string40 |
Y |
N |
Identifies the work order of the job. |
|
oper_id |
string40 |
Y |
N |
Identifies the operation of the job. |
|
seq_no |
int32 |
Y |
N |
Identifies the row on the Job table. |
|
job_start_utc |
tdatetime |
Y |
N |
Identifies when the job started, in UTC. |
|
hour_start_utc |
tdatetime |
Y |
N |
Identifies the start of the hour in which time and production occurred, in UTC. Allows job TPM statistics to be recorded in hour-long increments. |
|
hour_start_local |
tdatetime |
N |
N |
Identifies the start of the hour in which time and production occurred, in local time. Allows job TPM statistics to be recorded in hour-long increments. |
|
hour_end_utc |
tdatetime |
N |
N |
Identifies the end of the hour in which time and production occurred, in UTC. Allows job TPM statistics to be recorded in hour-long increments. |
|
hour_end_local |
tdatetime |
N |
N |
Identifies the end of the hour in which time and production occurred, in local time. Allows job TPM statistics to be recorded in hour-long increments. |
|
item_id |
string40 |
N |
N |
The item being produced. |
|
std_prod_rate |
float |
N |
N |
Hours per batch. Obtained from the Job table. |
|
batch_size |
tfloat |
N |
N |
Copy of job.batch_size. Default = 1. |
|
qty_good |
float |
N |
N |
The total good quantity produced for this job and hour on the entity. |
|
qty_reject |
float |
N |
N |
The total reject quantity produced for this job and hour on the entity. |
|
runtime |
int32 |
N |
N |
Total runtime on the entity for this job and hour. |
|
downtime |
int32 |
N |
N |
Total downtime on the entity for this job and hour. |
|
idletime |
int32 |
N |
N |
Total idle time on the entity for this job and hour. |
|
last_edit_comment |
notes |
N |
Y |
Reserved for internal use to indicate why this record was changed. |
|
last_edit_at |
tdatetime |
N |
N |
When this record was last changed. |
|
row_id |
bigint64 |
N |
N |
Unique row identifier, for audit trail. |
FK from ent_id to ent. (Cascade delete)