あなたは BigQuery 管理者で、Looker などのツールでアドホック クエリやダウンストリーム レポートを実行するデータ コンシューマーのチームをサポートしています。すべてのデータとユーザーは、単一の組織プロジェクトにまとめられています。最近、クエリ結果が遅くなっていることに気付き、どこで速度低下が発生しているかをトラブルシューティングしたいと考えています。ユーザーがジョブを実行すると、ジョブのキューイングまたはスロットの競合が発生し、結果へのアクセスが遅くなるのではないかと考えています。クエリ ジョブの情報を調査し、パフォーマンスが影響を受けている場所を特定する必要があります。どうすればよいでしょうか。
正解:D
To troubleshoot query performance issues related to job queuing or slot contention in BigQuery, using administrative resource charts along with querying the INFORMATION_SCHEMA is the best approach. Here's why option D is the best choice:
Administrative Resource Charts:
BigQuery provides detailed resource charts that show slot usage and job performance over time. These charts help identify patterns of slot contention and peak usage times.
INFORMATION_SCHEMA Queries:
The INFORMATION_SCHEMA tables in BigQuery provide detailed metadata about query jobs, including execution times, slots consumed, and other performance metrics.
Running queries on INFORMATION_SCHEMA allows you to pinpoint specific jobs causing contention and analyze their performance characteristics.
Comprehensive Analysis:
Combining administrative resource charts with detailed queries on INFORMATION_SCHEMA provides a holistic view of the system's performance.
This approach enables you to identify and address the root causes of performance issues, whether they are due to slot contention, inefficient queries, or other factors.
Steps to Implement:
Access Administrative Resource Charts:
Use the Google Cloud Console to view BigQuery's administrative resource charts. These charts provide insights into slot utilization and job performance metrics over time.
Run INFORMATION_SCHEMA Queries:
Execute queries on BigQuery's INFORMATION_SCHEMA to gather detailed information about job performance. For example:
SELECT
creation_time,
job_id,
user_email,
query,
total_slot_ms / 1000 AS slot_seconds,
total_bytes_processed / (1024 * 1024 * 1024) AS processed_gb,
total_bytes_billed / (1024 * 1024 * 1024) AS billed_gb
FROM
`region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE
creation_time > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY)
AND state = 'DONE'
ORDER BY
slot_seconds DESC
LIMIT 100;
Analyze and Optimize:
Use the information gathered to identify bottlenecks, optimize queries, and adjust resource allocations as needed to improve performance.
Reference:
Monitoring BigQuery Slots
BigQuery INFORMATION_SCHEMA
BigQuery Performance Best Practices