[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/bigquery/docs/information-schema-sessions-by-project [Back]  [Original]

SESSIONS_BY_PROJECT view  |  BigQuery  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback Stay organized with collections Save and categorize content based on your preferences.

SESSIONS_BY_PROJECT view

The INFORMATION_SCHEMA.SESSIONS_BY_PROJECT view contains real-time metadata about all BigQuery sessions in the current project.

Note: The view names INFORMATION_SCHEMA.SESSIONS and INFORMATION_SCHEMA.SESSIONS_BY_PROJECT are synonymous and can be used interchangeably.

Required permissions

To query the INFORMATION_SCHEMA.SESSIONS_BY_PROJECT view, you need the bigquery.jobs.listAll Identity and Access Management (IAM) permission for the project. Each of the following predefined IAM roles includes the required permission:

For more information about BigQuery permissions, see Access control with IAM.

Schema

When you query the INFORMATION_SCHEMA.SESSIONS_BY_* views, the query results contain one row for each BigQuery session.

The INFORMATION_SCHEMA.SESSIONS_BY_* view has the following schema:

Note: The underlying data is partitioned by the creation_time column and clustered by project_id and user_email.
Column name Data type Value
creation_time TIMESTAMP (Partitioning column) Creation time of this session. Partitioning is based on the UTC time of this timestamp.
expiration_time TIMESTAMP (Partitioning column) Expiration time of this session. Partitioning is based on the UTC time of this timestamp.
is_active BOOL Is the session is still active? TRUE if yes, otherwise FALSE.
last_modified_time TIMESTAMP (Partitioning column) Time when the session was last modified. Partitioning is based on the UTC time of this timestamp.
project_id STRING (Clustering column) ID of the project.
project_number INTEGER Number of the project.
session_id STRING ID of the session. For example, bquxsession_1234.
user_email STRING (Clustering column) Email address or service account of the user who ran the session.

For stability, we recommend that you explicitly list columns in your information schema queries instead of using a wildcard (SELECT *). Explicitly listing columns prevents queries from breaking if the underlying schema changes.

Data retention

This view contains currently running sessions and the history of sessions completed in the past 180 days.

Scope and syntax

Queries against this view must include a region qualifier. If you do not specify a regional qualifier, metadata is retrieved from all regions. The following table explains the region scope for this view:

View name Resource scope Region scope
[PROJECT_ID.]`region-REGION`.INFORMATION_SCHEMA.SESSIONS_BY_PROJECT Project level REGION
Replace the following:

Example

To run the query against a project other than your default project, add the project ID in the following format:

`PROJECT_ID`.`region-REGION_NAME`.INFORMATION_SCHEMA.SESSIONS_BY_PROJECT
For example, `myproject`.`region-us`.INFORMATION_SCHEMA.SESSIONS_BY_PROJECT. The following example lists all users or service accounts that created sessions for a given project within the last day:

SELECT
  DISTINCT(user_email) AS user
FROM
  `region-us`.INFORMATION_SCHEMA.SESSIONS_BY_PROJECT
WHERE
  is_active = true
  AND creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY);
Note: INFORMATION_SCHEMA view names are case-sensitive.

The result is similar to the following:

+--------------+
| user         |
+--------------+
| abc@xyz.com  |
+--------------+
| def@xyz.com  |
+--------------+
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page