이 가이드에서는 BigQuery 세션에서 변경사항을 사용 설정, 생성, 추적하는 방법을 설명합니다. 이 문서는 BigQuery 및 GoogleSQL에 익숙한 사용자를 대상으로 합니다.
BigQuery 세션에서 SQL 활동을 캡처할 수 있습니다.
세션 전체에서 임시 테이블, 임시 함수 및 변수를 사용하여 하나 이상의 쿼리를 대화식으로 빌드할 수 있습니다. 여러 세션을 동시에 활성화할 수 있으며 각 세션의 기록이 저장됩니다. 세션이 종료된 후 최대 20일 동안의 세션 기록을 볼 수 있습니다.
세션의 일반적인 용도는 다음과 같습니다.
일시적인 세션 데이터를 유지보수합니다. 변수와 임시 테이블을 한 번 정의하여 세션 전체에서 사용합니다.
세션별로 쿼리 기록을 조회합니다. 세션 중에 특정 시간에 발생한 동작을 추적하려면 세션 중에 변경된 내역을 보면 됩니다.
여러 쿼리에서 다중 문 트랜잭션을 만듭니다. 세션 내에서 커밋 또는 롤백을 결정하기 전에 트랜잭션을 시작하고, 변경사항을 적용한 후 임시 결과를 볼 수 있습니다. 이 작업은 세션의 여러 쿼리에서 수행할 수 있습니다. 세션을 사용하지 않는 경우 단일 쿼리에서 다중 문 트랜잭션을 완료해야 합니다.
가격 책정
세션 사용에 대한 추가 비용은 없습니다.
주문형 가격 책정을 사용하는 프로젝트의 경우 INFORMATION_SCHEMA에 대한 쿼리에 요금이 부과됩니다. 자세한 내용은 가격 책정 INFORMATION_SCHEMA를 참조하세요.
세션에서 만든 임시 테이블에 대해 요금이 청구됩니다. 스토리지 요금은 테이블에 저장된 데이터의 양에 따라 결정됩니다. 스토리지 가격 책정에 대한 자세한 내용은 스토리지 가격 책정을 참조하세요.
제한사항
세션의 모든 쿼리는 세션이 생성된 위치에서 실행됩니다.
세션은 현재 24시간 동안 활동이 없으면 자동으로 종료됩니다.
세션은 생성 후 7일이 지나면 자동으로 종료됩니다.
세션 변수의 최대 크기는 1MB이며, 세션에 사용되는 모든 변수의 최대 크기는 10MB입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-26(UTC)"],[[["\u003cp\u003eBigQuery sessions allow users to capture SQL activities, utilize temporary tables and functions, and maintain variables throughout the session.\u003c/p\u003e\n"],["\u003cp\u003eSessions provide the ability to view query history and track changes within a specific timeframe, up to 20 days after termination.\u003c/p\u003e\n"],["\u003cp\u003eMulti-statement transactions can be executed over multiple queries within a session, which is not possible without sessions.\u003c/p\u003e\n"],["\u003cp\u003eWhile there are no additional costs for using sessions, charges apply for queries against \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e and for temporary table storage.\u003c/p\u003e\n"],["\u003cp\u003eSessions have limitations, including a 24-hour automatic termination after inactivity, a 7-day termination after creation, and constraints on variable sizes, as well as no concurrent queries allowed in the same session.\u003c/p\u003e\n"]]],[],null,["# Introduction to sessions\n========================\n\nThis guide describes how to enable, create, and track changes in a\nBigQuery session. It is intended for users who are familiar with\n[BigQuery](/bigquery/docs) and\n[GoogleSQL](/bigquery/docs/reference/standard-sql/query-syntax).\n\nYou can capture your SQL activities in a BigQuery session.\nTemporary tables, temporary functions, and variables can be used throughout the session to\ninteractively build one or more queries. Multiple sessions can be active at the\nsame time and the history for each session is saved. You can view the history\nof a session for up to 20 days after the session is terminated.\n\nTypical uses for a session include the following:\n\n- **Maintain transient session data.** Define variables and temporary tables\n once and use them throughout the session.\n\n- **Look up query history by session.** If you want to keep track of a behavior\n that happened at a particular time during the session, you can view the\n history of changes that were made during the\n session.\n\n- **Create multi-statement transactions over multiple queries.** Within a\n session, you can begin a transaction, make changes, and view the temporary\n result before deciding to commit or rollback. You can do this over several\n queries in the session. If you do not use a session, a\n multi-statement transaction needs to be completed in a single query.\n\nPricing\n-------\n\n- There are no additional costs for using sessions.\n\n- For projects that use on-demand pricing, queries against `INFORMATION_SCHEMA`\n incur charges. For more information, see\n [`INFORMATION_SCHEMA` pricing](/bigquery/docs/information-schema-intro#pricing).\n\n- You are charged for temporary tables that you create in sessions. Storage\n charges are based on how much data is stored in the tables. For information\n about storage pricing, see [Storage pricing](/bigquery/pricing#storage).\n\nLimitations\n-----------\n\n- Every query in a session is run in the location where the session was\n created.\n\n- A session is automatically terminated after 24 hours of inactivity.\n\n- A session is automatically terminated 7 days after its creation.\n\n- The maximum size of a session variable is 1 MB, and the maximum size of all\n variables used in a session is 10 MB.\n\n- Concurrent queries aren't allowed within a session.\n\nRoles and permissions\n---------------------\n\nThis section describes the\n[Identity and Access Management (IAM) permissions](/bigquery/docs/access-control#bq-permissions)\nand the [IAM roles](/bigquery/docs/access-control#bigquery)\nthat you need to perform actions with sessions.\n\nWhat's next\n-----------\n\n- Learn more about how to [write queries in sessions](/bigquery/docs/sessions-write-queries).\n- Learn more about how to [work with sessions](/bigquery/docs/sessions), including how to create, use, terminate, and list your sessions."]]