히트맵에 밝은 색상의 대각선(올라가거나 내려감)이 여러 개 있는 경우 이는 일반적으로 단기간 동안의 행에 대한 순차 읽기나 쓰기를 나타냅니다.
선이 테이블 내보내기와 같은 읽기 활동과 일치하면 어떠한 조치도 필요하지 않습니다. 이러한 읽기 중에 성능 문제가 발생하는 경우 해당 기간 중에 인스턴스의 노드 수를 늘리는 것이 좋습니다. 마침표 사이에서 노드 수를 줄일 수 있습니다.
선이 쓰기 활동과 일치하고 성능 문제가 발생하는 경우 워크로드를 순차 쓰기 대신 임의 쓰기로 변경하는 것이 좋습니다.
갑작스러운 트래픽 증가
히트맵에서 히트맵의 일정 부분까지 밝은 색의 가로 밴드가 표시되는 경우 이는 데이터베이스 패턴 사용량이 갑작스럽게 변경됨을 나타냅니다. 이는 악성 쿼리이거나 특정 행의 활동에 대한 예기치 않은 급증일 수 있습니다.
주의사항
Key Visualizer에서 성능 및 리소스 사용량에 대한 완전한 그림을 제시하지 못하는 시나리오가 있을 수 있습니다.
시나리오
히트맵 내용
대형 데이터 테이블 하나와 작은 테이블 몇 개
Key Visualizer가 작은 테이블보다 큰 테이블에서 더 많은 행 범위를 선택합니다. 따라서 작은 테이블이 히트맵에서 단일 행 범위로만 나타날 수 있습니다. 테이블 수가 1,000개 미만이면 모든 테이블을 나타내는 행 범위가 있습니다. 작은 테이블에서 키 또는 작은 범위의 키가 핫이면 사용자는 이 테이블이 핫임을 알 수 있지만 그 이상을 알 수 없습니다.
많은 테이블/색인 예를 들어 크기에 상관없이 테이블이 수백 개 또는 수천 개 있는 데이터베이스입니다.
Key Visualizer는 행 범위를 최대 1,000개까지 선택합니다. 테이블과 색인이 많으면 히트맵에서 이들 중 일부에 데이터 포인트가 0개 또는 1개만 있을 수 있습니다. 따라서 테이블을 건너뛰거나 다운샘플링하면 핫스팟이 누락될 수 있습니다.
빠른 키 변경
키 공간이 빠르게 변경되면 행 범위가 자주 변경됩니다. 새로 삽입된 키로 인해 이전 행 범위를 분할해야 하거나 삭제된 키로 인해 여러 행 범위가 병합되면 측정항목이 근사치가 됩니다(예: 분할/조합). 측정항목 값의 근사치를 곱하면 정확도가 떨어질 수 있습니다. 또한 키 공간 변경 후 행 범위 업데이트가 지연되므로 행 범위가 업데이트될 때까지 세부사항이 손실될 수 있습니다.
[[["이해하기 쉬움","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)."]]