Area: Ingestion Issues
Sub-Area: Snowflake Connector: Profiling, Lineage, and Assertion Cost
Applies to: OSS + Cloud (the assertion steps apply to DataHub Cloud only)
Issue
Your Snowflake query count and credit usage go up for the role or user that DataHub uses. The extra load comes from one or more of these:
- Profiling, which runs row counts and column statistics on each profiled table.
- Lineage, usage, and query extraction, which reads
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORYandSNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY. - A wide ingestion scope (more databases, schemas, and tables).
- On DataHub Cloud, Freshness and Volume assertions that query your tables on a schedule.
Find which one drives the cost first, then change only that part of the recipe or assertion.
Error Messages
There is no error. The symptom is higher credit usage and query count in QUERY_HISTORY for the DataHub user.
If your recipe still sets profiling.method, the current CLI prints this warning and ignores the option:
The method was removed on August 2026, please remove it from your recipe.
You Might Be Asking
- Why did my Snowflake cost go up after I turned on DataHub ingestion or profiling?
- Which DataHub queries cost the most, and how do I find them in
QUERY_HISTORY? - Can I switch back to the Great Expectations profiler with
method: ge? - How do I keep service accounts out of lineage extraction?
- Are DataHub assertions running expensive queries on my large tables?
Solution
Step 1: Find which phase drives the cost
Ask your Snowflake admin to pull SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY for the DataHub user and group the queries like this:
- Profiling queries use
COUNT,APPROX_COUNT_DISTINCT,STDDEV_SAMP,MEDIAN, andAPPROX_PERCENTILE. For larger tables the profiler first creates a temporary sample table nameddh_sample_<id>. - Lineage, usage, and query extraction reads
snowflake.account_usage.query_historyandsnowflake.account_usage.access_history. - DataHub Cloud assertion queries start with the comment
/* query_source=datahub_observe assertion_urn=<urn> */, and their session sets aQUERY_TAGwith"query_source": "datahub_observe". Filter onQUERY_TAGto separate them. See Assertion Query Attribution.
Compare the start times with your ingestion schedule, and check the warehouse and its size for each group.
Step 2: Don't try to roll back to the Great Expectations profiler
The current CLI (1.7.0.20) has one SQL profiler, based on SQLAlchemy. The profiling.method option is removed: the CLI drops it and prints the warning above, so method: ge changes nothing. The profiling-ge pip extra does not exist in the current release either. To cut profiling cost, use Step 4.
Step 3: Restrict the ingestion scope
Each database, schema, and table in scope adds metadata, profiling, and lineage work. Allow only what you need.
schema_pattern matches only the bare schema name unless you set match_fully_qualified_names: true. Set it when you write schema patterns as DATABASE.SCHEMA. Without it, a DATABASE\\.SCHEMA pattern matches no schema and drops every table. table_pattern always matches database.schema.table. Patterns are case insensitive by default.
source:
type: snowflake
config:
match_fully_qualified_names: true
database_pattern:
allow:
- "^MY_DATABASE$"
- "^ANOTHER_DATABASE$"
schema_pattern:
allow:
- "^MY_DATABASE\\.IMPORTANT_SCHEMA$"
table_pattern:
allow:
- "^MY_DATABASE\\.IMPORTANT_SCHEMA\\..*"
Step 4: Tune profiling
Profiling is off unless profiling.enabled is true. When it is on, use these options (all under profiling unless noted). Pick the ones that fit; they are separate options, not steps in order.
source:
type: snowflake
config:
profiling:
enabled: true
# Only table level stats (row count and size). No column statistics.
profile_table_level_only: true
# Or keep column stats but turn off quantiles, distinct value frequencies,
# histograms and sample values, and profile at most 10 columns per table.
# turn_off_expensive_profiling_metrics: true
# Skip tables over these limits. These are the defaults.
# Setting either one to null removes the limit.
profile_table_row_limit: 5000000
profile_table_size_limit: 5 # GB
# Skip tables not changed in the last 7 days.
profile_if_updated_since_days: 7
# Profile only these tables (top level, next to profiling).
profile_pattern:
allow:
- "^MY_DATABASE\\.IMPORTANT_SCHEMA\\.CRITICAL_TABLE$"
Notes:
- Don't combine
profile_table_level_only: truewith anyinclude_field_*option set totrue. The recipe fails withCannot enable field-level metrics if profile_table_level_only is set. - If your recipe sets
profile_table_row_limit: nullorprofile_table_size_limit: null, it profiles your largest tables. Remove those lines to go back to 5,000,000 rows and 5 GB. - Column statistics already run on a sample of
sample_sizerows (default 10,000) when a table has more rows than that, becauseuse_samplingdefaults totrue. Keep it on. - Without
profile_if_updated_since_daysand without stateful ingestion (Step 6), every run profiles every table that passes the patterns and limits.
Step 5: Reduce the lineage and usage scan
Lineage, usage, and query extraction (use_queries_v2, on by default) reads QUERY_HISTORY and ACCESS_HISTORY for the time window. These options shrink that scan inside Snowflake:
source:
type: snowflake
config:
# Leave start_time unset. The default window is the last full day.
# SQL LIKE patterns, matched case insensitively, applied in the
# Snowflake query. Queries from these users are not read.
pushdown_deny_usernames:
- "SVC_%"
- "ROBOT_%"
# Filter ACCESS_HISTORY by database_pattern inside Snowflake.
push_down_database_pattern_access_history: true
Notes:
-
pushdown_deny_usernamesandpushdown_allow_usernamesonly apply withuse_queries_v2: true. DataHub drops all lineage and usage from the users you deny. If your ETL tools run as service accounts, denying them removes the lineage they create. - Don't set
start_time: "-7d"to save cost. The defaultstart_timeis the start of the last full day, so-7dmakes each run read about a week of history. -
email_domaindoes not filter anything. It only builds user emails for display when DataHub can't read them from Snowflake.
Step 6: Turn on stateful ingestion
Stateful ingestion stops repeat work between runs. You must set stateful_ingestion.enabled: true in the recipe for the two options below to take effect. If you run the recipe from the CLI, also set a top level pipeline_name that stays the same across runs.
pipeline_name: snowflake_prod
source:
type: snowflake
config:
stateful_ingestion:
enabled: true
# Queries v2 only: start the next run where the last successful run ended
# (rounded down to the bucket, a day by default), and skip the run if the
# window was already covered. Default is false.
enable_stateful_time_window: true
# Default is true once stateful ingestion is on: skip profiling a table
# that has not changed since DataHub last profiled it.
enable_stateful_profiling: true
enable_stateful_lineage_ingestion and enable_stateful_usage_ingestion only work with use_queries_v2: false. With queries v2, use enable_stateful_time_window. See Stateful Ingestion.
Step 7: Review assertions (DataHub Cloud)
Freshness and Volume assertions that query your warehouse run on the schedule you set on each assertion. Use the datahub_observe tag from Step 1 to see which assertions cost the most. Then:
- Open the table in DataHub and click the Quality tab.
- For a Volume assertion, open Advanced in the assertion settings and change the Volume Source. Information Schema reads the row count from Snowflake metadata. Query runs
COUNT(*)on the table and costs more. DataHub Dataset Profile uses the row count DataHub already has and does not query Snowflake. See Volume Assertions. - For a Freshness assertion, Information Schema and DataHub Operation cost less than Audit Log, Last Modified Column, or High Watermark Column. See Freshness Assertions.
- To pause an assertion, click Stop on it in the Quality tab. Click Start to resume it.
Step 8: Give DataHub its own small warehouse
Point DataHub at a small warehouse with a short auto suspend. This keeps DataHub compute apart from your other workloads and makes its cost easy to track.
CREATE WAREHOUSE DATAHUB_WH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE;
GRANT USAGE ON WAREHOUSE DATAHUB_WH TO ROLE <datahub_role>;
source:
type: snowflake
config:
warehouse: "DATAHUB_WH"