[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-24。"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.JOBS_TIMELINE_BY_USER\u003c/code\u003e view provides near real-time metadata on BigQuery jobs, including both running and completed jobs, submitted by the current user in the current project.\u003c/p\u003e\n"],["\u003cp\u003eTo access this view, users need the \u003ccode\u003ebigquery.jobs.list\u003c/code\u003e IAM permission, which is included in predefined roles like Project Viewer and BigQuery User.\u003c/p\u003e\n"],["\u003cp\u003eThe view's schema provides granular data, with each row representing one second of a BigQuery job's execution, and it is partitioned by \u003ccode\u003ejob_creation_time\u003c/code\u003e and clustered by \u003ccode\u003eproject_id\u003c/code\u003e and \u003ccode\u003euser_email\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eData in the view includes job details like \u003ccode\u003eperiod_start\u003c/code\u003e, \u003ccode\u003eperiod_slot_ms\u003c/code\u003e, \u003ccode\u003ejob_id\u003c/code\u003e, \u003ccode\u003ejob_type\u003c/code\u003e, \u003ccode\u003estate\u003c/code\u003e, and resource usage metrics, and retains currently running jobs and job history for the past 180 days.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view require a region qualifier, matching the region of the \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e view, with the example showing how to calculate total slot milliseconds consumed per second by user jobs.\u003c/p\u003e\n"]]],[],null,["# JOBS_TIMELINE_BY_USER view\n==========================\n\nThe `INFORMATION_SCHEMA.JOBS_TIMELINE_BY_USER` view contains near real-time\nBigQuery metadata by timeslice of the jobs submitted by the\ncurrent user in the current project. This view contains currently running and\ncompleted jobs.\n\nRequired permissions\n--------------------\n\nTo query the `INFORMATION_SCHEMA.JOBS_TIMELINE_BY_USER` view, you need the\n`bigquery.jobs.list` Identity and Access Management (IAM) permission for the project.\nEach of the following predefined IAM roles includes the required\npermission:\n\n- Project Viewer\n- BigQuery User\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.JOBS_TIMELINE_BY_*` views, the query\nresults contain one row for every second of execution of every\nBigQuery job. Each period starts on a whole-second interval and\nlasts exactly one second.\n\nThe `INFORMATION_SCHEMA.JOBS_TIMELINE_BY_*` view has the following schema:\n| **Note:** The underlying data is partitioned by the `job_creation_time` column and clustered by `project_id` and `user_email`.\n\nData retention\n--------------\n\nThis view contains currently running jobs and the job history of the past 180\ndays.\n\nScope and syntax\n----------------\n\nQueries against this view must include a [region qualifier](/bigquery/docs/information-schema-intro#syntax).\nIf you do not specify a regional qualifier, metadata is retrieved from all\nregions. The following table explains the region and resource scope for this\nview:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nExample\n-------\n\nThe following query displays the total slot milliseconds consumed per second\nby jobs submitted by the current user in the designated project: \n\n```googlesql\nSELECT\n period_start,\n SUM(period_slot_ms) AS total_period_slot_ms\nFROM\n `region-us`.INFORMATION_SCHEMA.JOBS_TIMELINE_BY_USER\nGROUP BY\n period_start\nORDER BY\n period_start DESC;\n```\n| **Note:** `INFORMATION_SCHEMA` view names are case-sensitive.\n\nThe result is similar to the following: \n\n```\n+---------------------------+---------------------------------+\n| period_start | total_period_slot_ms |\n+---------------------------+---------------------------------+\n| 2019-10-10 00:00:04 UTC | 118639 |\n| 2019-10-10 00:00:03 UTC | 251353 |\n| 2019-10-10 00:00:02 UTC | 1074064 |\n| 2019-10-10 00:00:01 UTC | 1124868 |\n| 2019-10-10 00:00:00 UTC | 1113961 |\n+---------------------------+---------------------------------+\n```"]]