last_refresh_status 값이 NULL이 아니면 마지막 자동 새로고침 작업이 실패한 것입니다. 수동 새로고침 요청은 여기에 반영되지 않습니다. 기본 테이블을 변경하면 구체화된 뷰 정의가 무효화되어 자동 새로고침 중에 오류가 발생할 수 있습니다. 자세한 내용은 증분 업데이트를 참조하세요. 예를 들어 구체화된 뷰에서 참조하는 열이 기본 테이블에서 삭제되면 last_refresh_status 필드가 invalidQuery 오류를 반환합니다. 자세한 내용은 오류 메시지를 참조하세요.
자동 새로고침 작업 나열
구체화된 뷰 자동 새로고침 작업을 나열하려면 jobs.list 메서드를 호출합니다. 작업에 대한 세부정보를 검색하려면 jobs.get 메서드를 호출합니다. 또한 INFORMATION_SCHEMA.JOBS_BY_* 뷰를 쿼리하여 작업을 가져올 수 있습니다. 자동 새로고침 작업에는 작업 ID 내의 materialized_view_refresh 프리픽스가 포함되며, BigQuery 관리자 계정으로 시작됩니다.
[[["이해하기 쉬움","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-17(UTC)"],[],[],null,["# Monitor materialized views\n==========================\n\nYou can monitor [materialized view](/bigquery/docs/materialized-views-intro)\nusage and refresh jobs by viewing the BigQuery\n`INFORMATION_SCHEMA` view. To create a list of materialized views, see\n[List materialized views](/bigquery/docs/materialized-views-manage#list).\n\nMaterialized view `INFORMATION_SCHEMA` view\n-------------------------------------------\n\nTo discover materialized views, query the [`INFORMATION_SCHEMA.TABLES`\nview](/bigquery/docs/information-schema-tables). To retrieve the properties of a\nmaterialized view, query the\n[`INFORMATION_SCHEMA.TABLE_OPTIONS` view](/bigquery/docs/information-schema-table-options).\n\nMaterialized views are not listed in the [`INFORMATION_SCHEMA.VIEWS` views](/bigquery/docs/information-schema-views)\ntable.\n\nMonitor automatic refresh\n-------------------------\n\nThis section shows how to view [refresh details for materialized views](/bigquery/docs/materialized-views-manage#refresh).\n\n### View last refresh status\n\nTo retrieve the current status of materialized views, call the\n[`tables.get` method](/bigquery/docs/reference/rest/v2/tables/get), or query the\n[`INFORMATION_SCHEMA.MATERIALIZED_VIEWS` view](/bigquery/docs/information-schema-materialized-views).\n\nFor example: \n\n```googlesql\nSELECT\n table_name, last_refresh_time, refresh_watermark, last_refresh_status\nFROM\n `DATASET`.INFORMATION_SCHEMA.MATERIALIZED_VIEWS;\n```\n\nIf the value for `last_refresh_status` is not `NULL`, then the last automatic\nrefresh job failed. Manual refresh requests are not reflected here. Changes to\nbase tables can invalidate a materialized view definition, resulting in an error\nduring automatic refresh. For more information, see [Incremental\nupdates](/bigquery/docs/materialized-views-use#incremental_updates). For\nexample, if a column that is referenced by the materialized view gets dropped\nfrom the base table, then the `last_refresh_status` field returns an\n`invalidQuery` error. For more information, see [Error\nmessages](/bigquery/docs/error-messages).\n\n### List automatic refresh jobs\n\nTo list materialized view automatic refresh jobs, call the [`jobs.list`\nmethod](/bigquery/docs/reference/rest/v2/jobs/list). To retrieve details about\nthe jobs, call the [`jobs.get`\nmethod](/bigquery/docs/reference/rest/v2/jobs/get). You can also query the\n[`INFORMATION_SCHEMA.JOBS_BY_*` views](/bigquery/docs/information-schema-jobs) to\nget the jobs. Automatic refresh jobs contain the `materialized_view_refresh`\nprefix within the [job ID](/bigquery/docs/reference/rest/v2/Job#FIELDS.id) and\nare started by a BigQuery administrator account.\n\nFor example: \n\n```googlesql\nSELECT\n job_id, total_slot_ms, total_bytes_processed,\n materialized_view_statistics.materialized_view[SAFE_OFFSET(0)].rejected_reason\n AS full_refresh_reason\nFROM\n `region-us.INFORMATION_SCHEMA.JOBS_BY_PROJECT`\nWHERE\n job_id LIKE '%materialized_view_refresh_%'\nLIMIT 10;\n```\n\nTo monitor the cost of refresh jobs and adjust the automatic refresh interval if\nneeded, view the `total_bytes_processed` and `total_slot_ms` fields.\n\nFor example, if the ingestion rate in the base tables is relatively small, it\nmakes sense to refresh the view less often. If the underlying data\nchanges quickly, it makes sense to refresh more often.\n\nIf the base tables ingest data at predefined points in time, such as by using a\nnightly extract, transform, and load (ETL) pipeline, consider taking control of\nthe materialized view maintenance schedule as follows:\n\n1. [Disable automatic refresh](/bigquery/docs/materialized-views-manage#automatic-refresh).\n\n2. [Perform a manual refresh](/bigquery/docs/materialized-views-manage#manual-refresh),\n either as part of the ETL pipeline, or by configuring a scheduled query at\n specific times of the day.\n\n| **Note:** Table truncation, partition truncation, partition expiration, and `UPDATE`, `DELETE`, and `MERGE` data manipulation language (DML) statements on a base table can all invalidate their materialized views. If the materialized view is partitioned, then the modified partitions are invalidated; if not partitioned, then the whole materialized view is invalidated. For this reason, you might want to batch your DML statements and perform the manual refresh at the end of your query.\n\nFor more information on pricing for materialized views, see [materialized views\npricing](/bigquery/docs/materialized-views-intro#materialized_views_pricing).\n\nMonitor materialized view usage\n-------------------------------\n\nTo view the materialized view usage for a query job, you can call the\n[`jobs.get` method](/bigquery/docs/reference/rest/v2/jobs/get) or query the\n[`INFORMATION_SCHEMA.JOBS_BY_*` view](/bigquery/docs/information-schema-jobs),\nand view the `materialized_view_statistics` field. It provides details about the\nuse of materialized views by the query, including the following details:\n\n- Whether the materialized view was used.\n- If the materialized view was not used, [the reason it was rejected](/bigquery/docs/reference/rest/v2/Job#rejectedreason).\n\nFor example: \n\n```googlesql\nSELECT\n job_id, materialized_view_statistics\nFROM\n region-US.INFORMATION_SCHEMA.JOBS_BY_PROJECT\nWHERE\n job_id = '\u003cmy-query-job-id\u003e';\n```\n\nTo view the usage of a materialized view over time, query the\n[`INFORMATION_SCHEMA.JOBS_BY_*` views](/bigquery/docs/information-schema-jobs).\n\nFor example, the following query returns a summary of recent query jobs that\nuse the target materialized view: \n\n```googlesql\nSELECT\n mv.table_reference.dataset_id,\n mv.table_reference.table_id,\n MAX(job.creation_time) latest_job_time,\n COUNT(job_id) job_count\nFROM\n region-US.INFORMATION_SCHEMA.JOBS_BY_PROJECT job,\n UNNEST(materialized_view_statistics.materialized_view) mv\nWHERE\n job.creation_time \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY)\n AND mv.table_reference.dataset_id = 'my_dataset'\n AND mv.table_reference.table_id = 'my_materialized_view'\n AND mv.chosen = TRUE\nGROUP BY 1, 2;\n```\n\nTroubleshoot slow queries with materialized views\n-------------------------------------------------\n\nIf your query uses materialized views and is running slower than expected,\ndo the following:\n\n1. Verify that the intended materialized views are actually being used by the query. For detailed instructions, see [Monitor materialized view usage](#monitor_materialized_view_usage).\n2. [Check the freshness of your materialized view](#view_last_refresh_status).\n3. Review the materialized view definition and the data it references and consider [techniques to optimize your materialized view usage](/bigquery/docs/materialized-views-create#considerations_when_creating_materialized_views)."]]