Versions Compared

    Key

    • This line was added.
    • This line was removed.
    • Formatting was changed.

    ...

    Code Block
    languagesql
    mysql> SHOW CREATE TABLE pfx_dw.job_fact\G
    *************************** 1. row ***************************
    Table: job_fact
    Create Table: CREATE TABLE `job_fact` (
    `time_sk` int(11) NOT NULL,
    `job_id` int(11) DEFAULT NULL,
    `job_name` varchar(255) DEFAULT NULL,
    `job_priority` int(11) DEFAULT NULL,
    `job_timesubmit` int(11) DEFAULT NULL,
    `job_timestart` int(11) DEFAULT NULL,
    `job_timecomplete` int(11) DEFAULT NULL,
    `jobstatus_sk` int(11) DEFAULT NULL,
    `user_sk` smallint(5) unsigned DEFAULT NULL,
    `cluster_sk` smallint(5) unsigned DEFAULT NULL,
    `account_sk` smallint(5) unsigned DEFAULT NULL,
    `kind_sk` smallint(5) unsigned DEFAULT NULL,
    `prototype_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_show_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_shot_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_seq_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_client_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_dept_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_custom1_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_custom2_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_custom3_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_custom4_sk` smallint(5) unsigned DEFAULT NULL,
    `prod_custom5_sk` smallint(5) unsigned DEFAULT NULL,
    `cpu_count` int(10) unsigned NOT NULL,
    `cpu_seconds` int(10) unsigned NOT NULL,
    `work_count` int(10) unsigned NOT NULL,
    `worktime_min` int(10) unsigned NOT NULL,
    `worktime_max` int(10) unsigned NOT NULL,
    `worktime_avg` int(10) unsigned NOT NULL,
    `mem_max` bigint(20) unsigned DEFAULT NULL,
    `mem_avg` bigint(20) unsigned DEFAULT NULL,
    `mem_stddev` bigint(20) unsigned DEFAULT NULL,
    UNIQUE KEY `job_id` (`job_id`),
    KEY `time_sk` (`time_sk`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1
    1 row in set (0.00 sec)
    Note
    titleThe "job_time*" columns are stored in UNIX epoch time

     

    To convert them to human-readable format use the MySQL FROM_UNIXTIME() function.

     

    mysql> SELECT job_id, job_timesubmit, FROM_UNIXTIME(job_timesubmit) FROM pfx_dw.job_fact WHERE job_id=98269;
    +--------+----------------+-------------------------------+
    | job_id | job_timesubmit | FROM_UNIXTIME(job_timesubmit) |
    +--------+----------------+-------------------------------+
    |  98269 |     1414709214 2014-10-30 15:46:54           |
    +--------+----------------+-------------------------------+

     

    "*_sk" columns can be used to do INNER JOINs to a similarly named dimension table

    ...