[[["容易理解","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-05 (世界標準時間)。"],[],[],null,["# Explore heatmaps\n\nThis page describes the features of the Key Visualizer interface.\n\nBefore you read this page, you should be familiar with the\n[Key Visualizer overview](/spanner/docs/key-visualizer) and ensure\nyou have [access to Key Visualizer](/spanner/docs/key-visualizer/getting-started).\n\nHeatmaps\n--------\n\nThe core of a Key Visualizer scan is the heatmap, which shows the value of a\nmetric over time, broken down into contiguous ranges of row keys. The x-axis of\nthe heatmap represents time, and the y-axis represents\n[row ranges](#row_ranges). If the metric has a low value for a row range at a\npoint in time, then the metric is cold, and it appears in a dark color. A high\nvalue is hot, and it appears in a bright color. The highest values appear in\nwhite.\n\nDifferent types of usage result in different visual patterns within the heatmap,\nwhich can make it possible to diagnose issues at a glance. For more examples,\nsee common [Heatmap patterns](/spanner/docs/key-visualizer/patterns).\n\nRow ranges\n----------\n\nA row range is a contiguous set of rows within a single table or index. It is\ndefined by a start key and an end key.\n\nA Spanner database typically has many tables and indexes. Key\nVisualizer selects up to 1,000 row ranges based on the existing keys in all\ntables and indexes across the entire database. On the heatmap, each key is first\nsorted based on its table or index name alphabetically. Within each table or\nindex, keys are then sorted by their primary key values. As a result, a row range\nonly consists of keys from a single table or index. For interleaved tables, row\nranges of a parent table don't include any keys from its interleaved child\ntables.\n\nKey Visualizer selects at most 1,000 row ranges. When there are more than 1,000\ncombined tables and indexes, some of those tables are rolled up into a single\ndata point on the heatmap, which is shown as a single line. Therefore, potential\nhotspots might be hard to detect due to their tables being combined and\ndownsampled.\n\nIf there are fewer than 1,000 tables and indexes, the heatmap has at least\none row range representing every table.\n\nAdjusting brightness\n--------------------\n\nKey Visualizer heatmaps use dark colors to indicate normal or low values, and\nbright colors to indicate high values. If the colors in a heatmap are too bright\nor too dark, it might be difficult to see important patterns for a metric.\n\nValues associated with each color are defined in the legend to the left of the\n**Adjust Brightness** buttons.\n\nKeep in mind that for most metrics, Key Visualizer identifies which values are\n\"high\" and \"low\" based entirely on your usage of that database. For example, if\nyou perform 20 reads per second in a specific row range and 1 read per second in\nother row ranges, Key Visualizer will use a bright color for that specific row\nrange, even though 20 reads per second is a low number for\nSpanner.\n\nTo adjust the colors that are used for different values, use the **+ / -**\nbuttons on either side of the **Adjust Brightness**\n*brightness_6*\nicon. When you increase the brightness, you lower the range of values that each\ncolor represents; when you lower the brightness, you increase the range of\nvalues.\n\nZooming in on time periods and row key ranges\n---------------------------------------------\n\nWhen you open a heatmap, it displays values for the entire time period included\nin the scan, as well as the entire range of row keys in your table. If you\nnotice an issue during a specific time period, or in a specific range of row\nkeys, you can zoom in to examine the issue more closely.\n\nThere are several ways to zoom in or out:\n\n- Scroll up or down within the heatmap.\n- Click the **Rectangular Zoom** *crop* button, then click and drag to select an area to enlarge.\n- Press and hold the `Shift` key, then click and drag to select an area to enlarge.\n- Return to the previous area of the heatmap by pressing the `Backspace` or `Delete` key.\n- Zoom out to view the entire table by clicking the **Reset Zoom** *zoom_out_map* button or pressing the `R` key.\n\nPinning details about a metric\n------------------------------\n\nAs you move your cursor over a heatmap, Key Visualizer displays a tooltip that\ncontains details about the metric that is under the cursor. You can pin this\ntooltip in place by clicking on the heatmap. Pinned tooltips show more detail\nabout the metric. Pinning a tooltip also makes it easier to take a screenshot of\nthe tooltip or copy information from the tooltip.\n\nSwitching metrics\n-----------------\n\nYou can choose the metric to display in the heatmap from the drop-down metric\nlist located at the top left of the page.\n\nFor descriptions of each metric, see [Key Visualizer Metrics](/spanner/docs/key-visualizer/metrics).\n\nFinding connections between different metrics\n---------------------------------------------\n\nYou can view multiple metrics at the same time in Key Visualizer when you want\nto compare metrics or find correlations between metrics.\n\nTo view multiple metrics and their values at the same time, click **Show info\npanel** near the top right corner. A list of metrics appears in a pane to the\nright of the heatmap.\n\nTo examine several metrics at once, use the following tools in the info panel:\n\n- To show or hide miniature heatmaps for all metrics, click `Expand All` or `Collapse All` at the top right.\n- To show an individual metric's heatmap, click the metric name.\n- To hide an individual metric's heatmap, click the metric name again.\n- To display a metric's heatmap in the main window, click the solid arrow at\n the left edge of the metric's title bar.\n\n- Hover over a miniature heatmap to see corresponding activity in the main view.\n\nTo compare different metrics for a row range at the same point in time, you can\npin a value in a scan, then switch to a different metric at the same point in\ntime:\n\n1. Point to a position of interest on the large heatmap in the main window.\n2. Click to pin the tooltip. The values in the side panel stay fixed to the row range and point in time you've pinned.\n3. To display a metric in the large heatmap, click the solid arrow on the left for that metric. The tooltip in the main window shows you the full details for that metric.\n\nWhat's next\n-----------\n\n- Learn to recognize [common patterns in heatmaps](/spanner/docs/key-visualizer/patterns).\n- Read about the [metrics you can view in a heatmap](/spanner/docs/key-visualizer/metrics)."]]