INFORMATION_SCHEMA.ASSIGNMENTS ビューをクエリするには、プロジェクトの bigquery.reservationAssignments.list Identity and Access Management(IAM)権限が必要です。次に示す各 IAM の事前定義ロールには、必要な権限が含まれています。
[[["わかりやすい","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-09-04 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.ASSIGNMENTS\u003c/code\u003e view provides a real-time list of all current, non-deleted assignments within the administration project.\u003c/p\u003e\n"],["\u003cp\u003eQuerying this view requires the \u003ccode\u003ebigquery.reservationAssignments.list\u003c/code\u003e IAM permission, which is included in several predefined roles like \u003ccode\u003eroles/bigquery.resourceAdmin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach row in the view represents a single assignment and contains details such as \u003ccode\u003eassignment_id\u003c/code\u003e, \u003ccode\u003ereservation_name\u003c/code\u003e, \u003ccode\u003ejob_type\u003c/code\u003e, and \u003ccode\u003eassignee_id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view must include a region qualifier to specify the region from which metadata is retrieved, such as \u003ccode\u003eregion-us\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe view is useful for comparing a project's current slot usage against the slot capacity of its assigned reservation, by showing information such as the \u003ccode\u003ereservation_name\u003c/code\u003e and \u003ccode\u003eslot_capacity\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ASSIGNMENTS view\n================\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view contains a near real-time list of all\ncurrent assignments within the administration project. Each row represents a\nsingle, current assignment. A current assignment is either pending or active and\nhas not been deleted. For more information about reservation, see [Introduction\nto Reservations](/bigquery/docs/reservations-intro).\n\nRequired permission\n-------------------\n\nTo query the `INFORMATION_SCHEMA.ASSIGNMENTS` view, you need the\n`bigquery.reservationAssignments.list` Identity and Access Management (IAM) permission for\nthe project.\nEach of the following predefined IAM roles includes the required\npermission:\n\n- `roles/bigquery.resourceAdmin`\n- `roles/bigquery.resourceEditor`\n- `roles/bigquery.resourceViewer`\n- `roles/bigquery.user`\n- `roles/bigquery.admin`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view has the following\nschema:\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 scope for this view:\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\nTo run the query against a project other than your default project, add the\nproject ID in the following format: \n\n```bash\n`PROJECT_ID`.`region-REGION_NAME`.INFORMATION_SCHEMA.ASSIGNMENTS\n```\n.\n\n\u003cbr /\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project to which you have assigned reservations.\n- \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: the name of the region.\n\nFor example, ```myproject`.`region-us`.INFORMATION_SCHEMA.ASSIGNMENTS``.\n\nThe following example gets a project's currently assigned reservation and its\nslot capacity. This information is useful for debugging job performance by\ncomparing the project's slot usage with the slot capacity of the reservation\nassigned to that project. \n\n```googlesql\nSELECT\n reservation.reservation_name,\n reservation.slot_capacity\nFROM\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.ASSIGNMENTS_BY_PROJECT assignment\nINNER JOIN\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.RESERVATIONS_BY_PROJECT AS reservation\nON\n (assignment.reservation_name = reservation.reservation_name)\nWHERE\n assignment.assignee_id = \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\"\n AND job_type = \"QUERY\";\n```"]]