Tampilan INFORMATION_SCHEMA.INSIGHTS berisi insight tentang semua rekomendasi BigQuery dalam project saat ini. BigQuery mengambil insight untuk semua jenis insight BigQuery dari Recommendation Hub dan menampilkannya dalam tampilan ini. Insight BigQuery selalu
dikaitkan dengan rekomendasi.
Tampilan INFORMATION_SCHEMA.INSIGHTS mendukung rekomendasi berikut:
Untuk melihat insight dengan tampilan INFORMATION_SCHEMA.INSIGHTS, Anda harus memiliki izin yang diperlukan untuk pemberi rekomendasi yang sesuai. Tampilan
INFORMATION_SCHEMA.INSIGHTS hanya menampilkan insight dari rekomendasi
yang izin aksesnya Anda miliki.
Minta administrator Anda untuk memberikan akses guna melihat insight. Untuk melihat izin yang diperlukan untuk setiap pemberi rekomendasi, lihat hal berikut:
Tampilan INFORMATION_SCHEMA.INSIGHTS memiliki skema berikut:
Nama kolom
Jenis data
Nilai
insight_id
STRING
ID berenkode Base64 yang berisi jenis insight dan ID insight
insight_type
STRING
Jenis Insight. Misalnya, google.bigquery.materializedview.Insight.
subtype
STRING
Subjenis insight.
project_id
STRING
ID project.
project_number
STRING
Nomor project.
description
STRING
Deskripsi tentang rekomendasi.
last_updated_time
TIMESTAMP
Kolom ini menunjukkan waktu saat insight terakhir diperbarui.
category
STRING
Kategori pengoptimalan dampak.
target_resources
STRING
Nama resource yang memenuhi syarat sepenuhnya yang ditargetkan insight ini.
state
STRING
Status insight. Untuk mengetahui daftar kemungkinan nilai, lihat Nilai.
severity
STRING
Tingkat keparahan Insight. Untuk mengetahui daftar kemungkinan nilai, lihat Severity.
associated_recommendation_ids
STRING
Nama lengkap rekomendasi yang terkait dengan insight ini. Nama rekomendasi adalah representasi berenkode Base64 dari jenis pemberi rekomendasi dan ID rekomendasi.
additional_details
RECORD
Detail tambahan tentang insight.
content: Konten insight dalam format JSON.
state_metadata: Metadata tentang status Insight. Berisi key-value pair.
observation_period_seconds: Periode Observasi untuk membuat insight.
Cakupan dan sintaksis
Kueri terhadap tabel virtual ini harus menyertakan penentu region. ID project bersifat opsional. Jika project ID tidak ditentukan, project tempat kueri dijalankan akan digunakan.
Contoh berikut menggabungkan tampilan insight dengan tampilan rekomendasi untuk
menampilkan 3 rekomendasi untuk insight yang AKTIF dalam kategori BIAYA:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.INSIGHTS\u003c/code\u003e view provides insights into BigQuery recommendations, sourced from the Recommendation Hub, for all insight types within a project.\u003c/p\u003e\n"],["\u003cp\u003eThis view currently supports recommendations for partitioning and clustering, materialized views, and role recommendations for BigQuery datasets, each with specific required permissions to view.\u003c/p\u003e\n"],["\u003cp\u003eTo access insights, users must have the necessary permissions for the relevant recommender, as the view only displays insights from recommendations that the user has the right to view.\u003c/p\u003e\n"],["\u003cp\u003eQueries against the \u003ccode\u003eINFORMATION_SCHEMA.INSIGHTS\u003c/code\u003e view require a region qualifier and can optionally include a project ID, with the query execution location needing to match the view's region.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.INSIGHTS\u003c/code\u003e view includes a detailed schema with columns for insight metadata, such as \u003ccode\u003einsight_id\u003c/code\u003e, \u003ccode\u003einsight_type\u003c/code\u003e, \u003ccode\u003edescription\u003c/code\u003e, \u003ccode\u003estate\u003c/code\u003e, and \u003ccode\u003eassociated_recommendation_ids\u003c/code\u003e, providing comprehensive data about each insight.\u003c/p\u003e\n"]]],[],null,["# INFORMATION_SCHEMA.INSIGHTS view\n================================\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nTo request feedback or support for this feature, send email to\n[bq-recommendations+feedback@google.com](mailto:bq-recommendations+feedback@google.com).\n\nThe `INFORMATION_SCHEMA.INSIGHTS` view contains insights about all BigQuery\nrecommendations in the current project. BigQuery retrieves\ninsights for all BigQuery insight types from the Recommendation Hub\nand present it in this view. BigQuery insights are always\nassociated with a recommendation.\n\nThe `INFORMATION_SCHEMA.INSIGHTS` view supports the following\nrecommendations:\n\n- [Partition and cluster recommendations](/bigquery/docs/view-partition-cluster-recommendations)\n- [Materialized view recommendations](/bigquery/docs/manage-materialized-recommendations)\n- [Role recommendations for BigQuery datasets](/policy-intelligence/docs/review-apply-role-recommendations-datasets)\n\nRequired permission\n-------------------\n\nTo view insights with the `INFORMATION_SCHEMA.INSIGHTS` view, you\nmust have the required permissions for the corresponding recommender. The\n`INFORMATION_SCHEMA.INSIGHTS` view only returns insights from recommendations\nthat you have permission to view.\n\nAsk your administrator to grant access to view insights. To see the\nrequired permissions for each recommender, see the following:\n\n- [Partition \\& cluster recommender permissions](/bigquery/docs/view-partition-cluster-recommendations#required_permissions)\n- [Materialized view recommendations permissions](/bigquery/docs/manage-materialized-recommendations#required_permissions)\n- [Role recommendations for datasets permissions](/policy-intelligence/docs/review-apply-role-recommendations-datasets#required-permissions)\n\nSchema\n------\n\nThe `INFORMATION_SCHEMA.INSIGHTS` view has the following\nschema:\n\nScope and syntax\n----------------\n\nQueries against this view must include a\n[region qualifier](/bigquery/docs/information-schema-intro#syntax). A project ID\nis optional. If no project ID is specified, the project that the query runs\nin is used.\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.INSIGHTS\n```\nReplace the following:\n\n\u003cbr /\u003e\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project.\n- \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: the region for your project.\n\nFor example, ```myproject`.`region-us`.INFORMATION_SCHEMA.INSIGHTS``.\n\n### View active insights with cost savings\n\nThe following example joins insights view with the recommendations view to\nreturn 3 recommendations for the insights that are ACTIVE in COST category: \n\n WITH \n insights as (SELECT * FROM `region-us`.INFORMATION_SCHEMA.INSIGHTS),\n recs as (SELECT recommender, recommendation_id, additional_details FROM `region-us`.INFORMATION_SCHEMA.RECOMMENDATIONS)\n\n SELECT \n recommender,\n target_resources,\n LAX_INT64(recs.additional_details.overview.bytesSavedMonthly) / POW(1024, 3) as est_gb_saved_monthly,\n LAX_INT64(recs.additional_details.overview.slotMsSavedMonthly) / (1000 * 3600) as slot_hours_saved_monthly,\n insights.additional_details.observation_period_seconds / 86400 as observation_period_days,\n last_updated_time\n FROM \n insights \n JOIN recs \n ON \n recommendation_id in UNNEST(associated_recommendation_ids) \n WHERE \n state = 'ACTIVE' \n AND\n category = 'COST'\n LIMIT 3;\n\n| **Note:** `INFORMATION_SCHEMA` view names are case sensitive.\n\nThe result is similar to the following: \n\n```\n+---------------------------------------------------+---------------------+--------------------+--------------------------+-------------------------+---------------------+\n| recommender | target_resource | gb_saved_monthly | slot_hours_saved_monthly | observation_period_days | last_updated_time |\n+---------------------------------------------------+---------------------+--------------------+--------------------------+-------------------------+---------------------+\n| google.bigquery.table.PartitionClusterRecommender | [\"table_resource1\"] | 3934.07264107652 | 10.499466666666667 | 30.0 | 2024-07-01 16:41:25 |\n| google.bigquery.table.PartitionClusterRecommender | [\"table_resource2\"] | 4393.7416711859405 | 56.61476777777777 | 30.0 | 2024-07-01 16:41:25 |\n| google.bigquery.materializedview.Recommender | [\"project_resource\"]| 140805.38289248943 | 9613.139166666666 | 2.0 | 2024-07-01 13:00:31 |\n+---------------------------------------------------+---------------------+--------------------+--------------------------+-------------------------+---------------------+\n```"]]