Sensitive Data Protection 具有许多强大的功能,但如果您指示 Sensitive Data Protection 扫描的信息量很大,Sensitive Data Protection 的使用费有可能会非常高。本主题介绍了几种方法,它们让您能够在降低费用的同时保证使用 Sensitive Data Protection 扫描您所计划的确切数据。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Keeping costs under control\n\nSensitive Data Protection has many powerful capabilities, but depending on the quantity\nof information that you instruct Sensitive Data Protection to scan, it is possible\nfor costs to become prohibitively high. This topic describes several methods\nthat you can use to keep costs down while also ensuring that you're using\nSensitive Data Protection to scan the exact data that you intend to.\n\nInspection\n----------\n\nGoogle recommends the following practices to help you control your inspection\ncosts.\n\n### Use sampling to restrict the number of bytes inspected\n\nIf you are scanning BigQuery tables or Cloud Storage buckets,\nSensitive Data Protection can scan a small subset of the dataset. This can provide\na sampling of scan results without incurring the potential costs of scanning an\nentire dataset.\n\nOnce you find a sample with sensitive data, you can schedule a second, more\nexhaustive scan of that dataset to discover the entire list of findings.\n\nFor more information, see [Limiting the amount of content\ninspected](/sensitive-data-protection/docs/inspecting-storage#sampling) in [Inspecting storage and\ndatabases for sensitive data](/sensitive-data-protection/docs/inspecting-storage).\n\n### Scan only data that has changed\n\nYou can instruct Sensitive Data Protection to avoid scanning data that hasn't\nbeen modified since the last inspection. Setting a\n[timespan](/sensitive-data-protection/docs/reference/rest/v2/InspectJobConfig#timespanconfig)\nlets you control what data to scan based on when the data was last modified.\n\nIf you're using [job triggers](/sensitive-data-protection/docs/concepts-job-triggers), you can set the\nflag `enable_auto_population_of_timespan_config` in `TimespanConfig` to\nautomatically skip content that was scanned during the last scheduled job.\n\nFor more information, see [Limit scans to only new\ncontent](/sensitive-data-protection/docs/creating-job-triggers#limit_scans_to_only_new_content)\nin [Creating and scheduling Sensitive Data Protection inspection\njobs](/sensitive-data-protection/docs/creating-job-triggers).\n\n### Limit scans of files in Cloud Storage to only relevant files\n\nBy specifying the\n[`CloudStorageRegexFileSet`](/sensitive-data-protection/docs/reference/rest/v2/InspectJobConfig#cloudstorageregexfileset)\nmessage, you can use regular expression filters for finer control over which\nfiles or folders in buckets to include or exclude.\n\nThis is useful in situations where you want to skip scanning files that you\nknow have no sensitive data, such as backups, TMP files, static Web content,\nand so on.\n\nDiscovery\n---------\n\nWe recommend the following practices to help you control your [data\nprofiling](/sensitive-data-protection/docs/data-profiles) costs.\n\n### Run an estimation\n\nBefore you start a data profiling operation, consider running an estimation\nfirst. Running an estimation lets you understand the size and shape of the\nBigQuery data to be profiled. Each estimate provides the\napproximate table count, data size, and profiling cost. It also shows a\nprojection of the monthly growth of your BigQuery data.\n\nFor more information on running an estimation, see the following:\n\n- [Estimate data profiling cost for an organization or folder](/sensitive-data-protection/docs/estimate-org-folder)\n- [Estimate data profiling cost for a single project](/sensitive-data-protection/docs/estimate-project)\n\n### Add schedules in your scan configurations\n\nTo help control the cost of data profiling, consider [creating a\nschedule](/sensitive-data-protection/docs/profile-org-folder#manage-schedules) where you set\nfilters and conditions. The following are examples of things you can do:\n\n- If you don't need to profile certain tables, you can specify that tables that match your filters must never be profiled.\n- If you want to profile only certain tables, you can turn off profiling for all tables, except for those that match your filter.\n- If you want certain tables to be profiled only once and never again, you can specify that those tables must never be reprofiled.\n- If you don't need to profile old tables, you can set a condition to profile only the tables that were created after a certain date.\n- If you don't need to profile tables that are new, you can set a condition to profile tables only when they reach a certain age or a minimum row count.\n\nView costs using a dashboard and query your audit logs\n------------------------------------------------------\n\nCreate a dashboard to view your billing data so you can make adjustments to your\nSensitive Data Protection usage. Also consider streaming your audit logs to\nSensitive Data Protection so you can analyze usage patterns.\n\nYou can [export your billing\ndata](https://support.google.com/cloud/answer/7233314) to\nBigQuery and visualize it in a tool such as\nLooker Studio. For a tutorial on creating a billing dashboard, see\n[Visualize Google Cloud Billing using BigQuery and\nLooker Studio](https://medium.com/google-cloud/visualize-gcp-billing-using-bigquery-and-data-studio-d3e695f90c08).\n\nYou can also stream your [audit logs](/sensitive-data-protection/docs/audit-logging) to\nBigQuery and analyze the logs for usage patterns such as query\ncosts by user.\n\nSet budget alerts\n-----------------\n\n[Set a budget alert](/billing/docs/how-to/budgets) to track how your spend is\ngrowing toward a particular amount. Setting a budget does not cap API usage;\nit only alerts you when your spend amount gets near the specified amount."]]