[[["容易理解","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 (世界標準時間)。"],[[["\u003cp\u003eKey Visualizer heatmaps display patterns that can help identify and troubleshoot performance issues in Datastore mode.\u003c/p\u003e\n"],["\u003cp\u003eA fine-grained mix of dark and bright colors in a heatmap indicates evenly distributed write/delete operations across index keys, which is an effective usage pattern.\u003c/p\u003e\n"],["\u003cp\u003eA single bright diagonal line in a heatmap suggests an index on a sequential key, such as a timestamp, which can cause hotspots and elevated latencies.\u003c/p\u003e\n"],["\u003cp\u003eHotspotting issues caused by sequential keys can be identified using the Key Visualizer tool by understanding the index key structure.\u003c/p\u003e\n"],["\u003cp\u003eTo address hotspotting, you can exclude properties from built-in indexes or modify/delete composite indexes in the \u003ccode\u003eindex.yaml\u003c/code\u003e file to prevent the monotonically increasing or decreasing field from being the first field for indexing.\u003c/p\u003e\n"]]],[],null,["# Heatmap patterns for index keys\n\nThis page shows examples of patterns that you might see in a Key Visualizer\nheatmap. These patterns can help you troubleshoot specific performance\nissues.\n\nEvenly distributed usage\n------------------------\n\nIf a heatmap shows a fine-grained mix of dark and bright colors, then write/delete operations for\nindex keys are evenly distributed throughout the database. This heatmap likely\nrepresents an effective usage pattern for Datastore mode. \n\nIndexes on sequential keys\n--------------------------\n\nA heatmap with a single bright diagonal line can indicate an index that is on a\nkey that is strictly increasing or decreasing, such as timestamp. Indexes on\nsequential keys are not recommended and can create hotspots. When hotspotting,\nyou might observe corresponding elevated latencies.\n\nSome examples of common hotspots on index are as follows:\n| **Note:** In the following heatmap example, for Datastore mode, the x-axis of the heatmap represents time, and the y-axis represents index keys.\n\n### Hotspotting due to increasing timestamp\n\nIn this example, a heatmap with a single bright diagonal line can indicate a\ndatabase that uses strictly increasing or decreasing index write/delete operations on a timestamp\nproperty. \n\n### Hotspotting due to increasing property names\n\nIn this example, a heatmap with a single bright diagonal line can indicate a\ndatabase that uses strictly increasing or decreasing index write/delete operations on an\nincremental property, such as auto-generated invoice numbers. \n\nTo identify the hotspotting issue, use the Key Visualizer tool and [understand the index key\nstructure](/datastore/docs/keyvis-patterns-index#understand_index_key_structure) to determine which index causes the issue and exempt those indexes\nwith [best practices](./best-practices#high_read_write_and_delete_rates_to_a_narrow_document_range).\n\nUnderstand the index key structure\n----------------------------------\n\nBefore you understand the structure of index keys that you see in Key Visualizer\ntool, learn about [indexes](./concepts/indexes) in Datastore mode.\n\nThe following code shows an example index key format that you see when you hover\nover the affected key-range on the heatmap. \n\n NAMESPACE: NS KIND: Users \n PROPERTIES: (Timestamp: DESC, Name: DESC)\n ANCESTOR: KEY(PROJECT('\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e'),NAMESPACE('NS'),`UserList`,1)\n VALUES: (16500000000000001,'Alice')\n ENTITY:KEY(PROJECT('\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e'),NAMESPACE(''),`UserList`,1,`User`,5000000000000001)\n\nWhere:\n\n- **NAMESPACE** : [namespace](./concepts/multitenancy) of the entity.\n- **KIND** : [kind](./concepts/entities#kinds_and_identifiers) of entity that categorizes the entities.\n- **PROPERTIES** : [properties](./concepts/entities#properties_and_value_types) related to the entity. The `__key__` ordering property is only shown for index definitions that modify the default ordering.\n- **ANCESTOR** : optional [ancestor path](./concepts/entities#ancestor_paths) to locate the entity within the database hierarchy.\n- **VALUES**: value of each property.\n- **ENTITY**: ID of the entity updated in an operation.\n\nFrom the earlier example, identify the properties from the **PROPERTIES**\nvalue to find the affected index.\n\nTo find the index, complete the following steps:\n\n1. Go to the **Datastore mode Indexes** page in Google Cloud console.\n\n [Go to Datastore mode Indexes](https://console.cloud.google.com/datastore/indexes)\n\n You can identify the type of index by analyzing the\n **PROPERTIES** field. See [examples of index keys](./keyvis-patterns-index#examples_of_index_key_entries_on_the_heatmap) for more\n information.\n2. Click **Filter** , select **Fields**, and enter the name of the field.\n\n Use the **OR** operator to add more properties in case of composite indexes.\n\nAfter you have identified the index that is causing issues, you can use the following solutions:\n\n- Built-in index: Exclude the property such that the index doesn't maintain index entries for that property. See [Excluded properties](./concepts/indexes#unindexed_properties) for more information.\n- Composite index: Either modify the index in the `index.yaml` file to ensure that the field whose value monotonically increases or decreases is not selected as the first field for indexing, or delete the index. See [About index.yaml](./tools/indexconfig#Datastore_About_index_yaml) for more information.\n\n### Examples of index key entries on the heatmap\n\nWhat's next\n-----------\n\n- Learn how to [get started with Key Visualizer](./keyvis-getting-started).\n- Find out how to [explore a heatmap in detail](./keyvis-exploring-heatmaps).\n- Read about the [metrics you can view in a heatmap](./key-visualizer#metrics)."]]