[[["わかりやすい","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-03 UTC。"],[],[],null,["# Heatmap patterns\n\nThis page shows examples of patterns that you might see in a Key Visualizer\nheat map. These patterns can help you to troubleshoot specific performance\nissues.\n\nSome issues that are exposed in Key Visualizer relate to your primary key\ndefinition. Because a primary key is immutable, these issues are best discovered\nduring the design, or proof of concept, stage.\n\nOther issues may relate to your instance's node allocation. You may need to\nprovision additional capacity, either overall or possibly at certain times of\nday. To change the number of nodes associated with your instance, see\n[Changing the number of nodes](/spanner/docs/create-manage-instances#change-compute-capacity).\n\n- To learn how to open a Key Visualizer scan, see [Viewing the scan for a time\n period](/spanner/docs/key-visualizer/getting-started#viewing-scan).\n- To find out how to explore a Key Visualizer scan in detail, see [Exploring\n Heatmaps](/spanner/docs/key-visualizer/exploring-heatmaps).\n\nBefore you read this page, you should be familiar with the\n[overview of Key Visualizer](/spanner/docs/key-visualizer).\n\nEvenly distributed reads and writes\n-----------------------------------\n\nIf a heatmap shows a fine-grained mix of dark and bright colors, then reads and\nwrites are evenly distributed throughout the database. This heatmap represents\nan effective usage pattern for Spanner, so you do not need to take\nany action.\n\nYour own heatmap may not be as evenly distributed as this but still illustrate\na healthy schema and workload. Some number of hotspots can be expected in a\nproperly resourced configuration. \n\nMonotonically increasing keys\n-----------------------------\n\nA heatmap with a single bright diagonal line, or a triangle with a flat top,\ncan indicate a database that uses sequential keys. Sequential keys are an\nanti-pattern in Spanner; see the\n[Schema design best practices](/spanner/docs/schema-design) page for why\nsequential keys cause hotspots. \n\nPersistently hot key ranges\n---------------------------\n\nIf a heatmap shows horizontal bands of bright color, separated by dark colors,\nit indicates that specific row ranges are consistently being more heavily\naccessed over time.\n\nTo address this issue, consider changing your schema design or your application\nso that the data in a heavily used row, or in an excessively large row, is\nspread across multiple rows. \n\nSingle hot table\n----------------\n\nIf a heatmap shows a band of bright color in a single table, it\nindicates heavy access of that table over time.\n\nThis pattern by itself is not necessarily problematic. If you're seeing this\npattern in combination with performance issues, you're\nlikely running out of compute capacity. Some things to consider:\n\n- Your application may be requesting a full table scan, which will show in\n Key Visualizer as a bright band of the whole table. Instead, consider\n a more restrictive query, or query against the index to reduce the number of\n rows being scanned.\n\n- [Increase the number of nodes](/spanner/docs/create-manage-instances#change-compute-capacity) for this instance.\n\nRoving reads and writes over times\n----------------------------------\n\nA heatmap showing multiple diagonal bright lines (rising or falling)\nusually indicates sequential reads or writes to rows in a short period of time.\n\nIf the lines correspond with read activity, such as a table export, no action is\nrequired. If you're experiencing performance issues during these reads, consider\n[increasing the number of nodes](/spanner/docs/create-manage-instances#change-compute-capacity) for your instance during these\ntime periods. You can decrease the node number between periods.\n\nIf the lines correspond with write activity, and you're experiencing performance\nissues, you should consider changing your workload to a random write instead of\na sequential write. \n\nSudden traffic increase\n-----------------------\n\nA heatmap showing bright horizontal bands that appear partway across the heatmap\nindicate a sudden change in the usage pattern of a database. This can be a rogue\nquery or an unexpected surge in activity for certain rows. \n\nCaveats\n-------\n\nThere are some scenarios where Key Visualizer may not present a complete picture\nof performance and resource usage.\n\nWhat's next\n-----------\n\n- Learn how to [get started with Key Visualizer](/spanner/docs/key-visualizer/getting-started).\n- Find out how to [explore a heatmap in detail](/spanner/docs/key-visualizer/exploring-heatmaps).\n- Read about the [metrics you can view in a heatmap](/spanner/docs/key-visualizer/metrics)."]]