A visualização INFORMATION_SCHEMA.INSIGHTS contém insights sobre todos os dados do BigQuery
e recomendações no projeto atual. O BigQuery recupera
insights de todos os tipos de insights do BigQuery do Hub de recomendações
e os apresenta nesta visualização. Os insights do BigQuery são sempre
associados a uma recomendação.
A visualização INFORMATION_SCHEMA.INSIGHTS é compatível com estas
recomendações:
Para acessar insights com a visualização INFORMATION_SCHEMA.INSIGHTS, você
precisa ter as permissões necessárias para o recomendador correspondente. A
visualização INFORMATION_SCHEMA.INSIGHTS só retorna insights de recomendações
que você tem permissão para visualizar.
Peça ao administrador para conceder acesso para visualizar os insights. Para conferir as
permissões necessárias para cada recomendador, consulte:
A visualização INFORMATION_SCHEMA.INSIGHTS tem o seguinte esquema:
Nome da coluna
Tipo de dados
Valor
insight_id
STRING
ID codificado em Base64 que contém o tipo e o ID do insight
insight_type
STRING
O tipo do insight. Por exemplo, google.bigquery.materializedview.Insight
subtype
STRING
O subtipo do insight.
project_id
STRING
O ID do projeto.
project_number
STRING
O número do projeto.
description
STRING
A descrição da recomendação.
last_updated_time
TIMESTAMP
Esse campo representa a hora em que o insight foi atualizado pela última vez.
category
STRING
A categoria de otimização do impacto.
target_resources
STRING
Nomes de recursos totalmente qualificados que esse insight está segmentando.
state
STRING
O estado do insight. Para uma lista de valores possíveis, consulte Valor.
severity
STRING
A gravidade do insight. Para uma lista de valores possíveis, consulte Gravidade.
associated_recommendation_ids
STRING
Nomes completos de recomendações a que esse insight está associado. O nome da recomendação é a representação codificada em Base64 do tipo de recomendador e o ID das recomendações.
additional_details
RECORD
Detalhes adicionais sobre o insight.
content: conteúdo do insight no formato JSON.
state_metadata: metadados sobre o estado do insight. Contém pares de chave-valor.
observation_period_seconds: período de observação para gerar o insight.
Escopo e sintaxe
As consultas nessa visualização precisam incluir um
qualificador de região. Um ID do projeto
é opcional. Se nenhum ID de projeto for especificado, o projeto em que a consulta será executada será usado.
Por exemplo, `myproject`.`region-us`.INFORMATION_SCHEMA.INSIGHTS
Conferir insights ativos com economia de custos
O exemplo a seguir une a visualização de insights à visualização de recomendações para
retornar três recomendações para os insights que estão ATIVOS na categoria CUSTO:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 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```"]]