What the Query Profile Table is
When you create a Snowflake CloudLink, Elementum generates a DDL script that creates a dynamic table in theELEMENTUM_PLATFORM schema. That table is backed by SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY and a scheduled task that keeps it current. Once provisioned:
- The table records execution time, warehouse usage, bytes scanned, and similar metrics only for queries the
ELEMENTUMrole runs. - It does not capture queries from your internal users, other applications, or third-party tools.
- It lives entirely inside your Snowflake account—no data leaves Snowflake.
- A scheduled task clears records older than 14 days, so the table stays small.
| Property | Value |
|---|---|
| Location | ELEMENTUM.ELEMENTUM_PLATFORM schema in your Snowflake account |
| Source | Filtered view of SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY |
| Scope | Queries executed by the ELEMENTUM role only |
| Retention | 14 days, enforced by a scheduled task |
| Owner | The ELEMENTUM role |
Elementum reads the Query Profile Table to surface query-performance metrics. Without it, every metric lookup has to scan
SNOWFLAKE.ACCOUNT_USAGE directly, which is slow and consumes credits.Why Elementum recommends provisioning it
The Query Profile Table gives Elementum’s support and engineering teams the visibility needed to diagnose performance issues in your environment, without granting access to anything beyond the queries Elementum itself ran.Faster diagnosis of performance issues
When the table is provisioned, Elementum can diagnose and resolve issues directly rather than relying on support escalations and one-offACCOUNT_USAGE queries. This applies to:
- Timeouts and slow-running operations
- Intermittent query failures
- Warehouse scaling and credit-usage concerns
Proactive performance monitoring
With visibility into how operations perform over time, Elementum can:- Identify which operations are creating bottlenecks
- Alert on emerging performance issues before they affect your workflows
- Recommend configuration changes (such as warehouse sizing or scaling policy) when they would improve your experience
Targeted optimization for your environment
Using performance trends specific to your account, Elementum can recommend or apply targeted improvements such as:- Index recommendations
- Search optimization
- Clustering keys on tables Elementum queries frequently
Privacy and access scope
The table is designed so Elementum only ever sees activity it generated:- The DDL filters
QUERY_HISTORYby theELEMENTUMrole, so other users’ queries are excluded. - The table is owned by the
ELEMENTUMrole and lives in the platform schema you already use for CloudLink. No additional access is granted outside that role. - Data older than 14 days is removed automatically by the scheduled task.
You control access through your existing Snowflake roles and grants. If you ever revoke the
ELEMENTUM role’s privileges, the table and its task stop receiving data.Prerequisites
Before provisioning the Query Profile Table, confirm:- The Snowflake CloudLink has been created and is showing as Connected in Organization Settings → CloudLinks. See Connect Snowflake to Elementum for the full setup.
- You have a Snowflake user with the
ACCOUNTADMINrole available to run the DDL. - The
ELEMENTUMrole, warehouse, database, andELEMENTUM_PLATFORMschema created during CloudLink setup are in place.
Provision the table
Elementum generates the DDL for your specific CloudLink—it includes the right database, schema, warehouse, and role names for your environment.Open the CloudLink details
In Elementum, go to Organization Settings → CloudLinks and click the name of your Snowflake CloudLink to open its details.
Copy the DDL
Scroll to the Query Profile Table section and click Copy DDL. The script is tailored to this CloudLink and includes the grants the
ELEMENTUM role needs to read SNOWFLAKE.ACCOUNT_USAGE and run the scheduled task.Confirm the status updates
Return to the CloudLink dialog. The Query Profile Table status should change to Provisioned. If it still shows Not provisioned, see Troubleshooting below.
Verify the table is working
You can sanity-check the table and its scheduled task directly in Snowflake.Confirm the scheduled task is running
state should be started. If it shows suspended, resume it:Troubleshooting
Status stays on "Not provisioned" after running the DDL
Status stays on "Not provisioned" after running the DDL
- Re-run the DDL as
ACCOUNTADMIN. TheIMPORTED PRIVILEGESgrant and task creation both require account-level privileges and will silently fail under other roles. - Confirm the CloudLink in the UI matches the one whose DDL you copied. Each CloudLink has its own DDL.
- Click Refresh on the CloudLink details page; the status check runs against Snowflake on demand.
"Insufficient privileges" when running the DDL
"Insufficient privileges" when running the DDL
- Verify you are running the script as
ACCOUNTADMIN, notSYSADMINor a custom admin role. - Confirm the
ELEMENTUMrole exists. If you set up the CloudLink before the role was created, the grants in the DDL will fail.
The dynamic table exists but stays empty
The dynamic table exists but stays empty
- Check that the scheduled task is in the
startedstate withSHOW TASKS. - Confirm the
ELEMENTUMwarehouse is not suspended; the task needs warehouse compute to run. - Allow up to the task’s scheduled interval (typically a few minutes) for the first rows to land.
- Verify the CloudLink has actually executed queries since provisioning. The table only captures activity from the
ELEMENTUMrole.
Removing the Query Profile Table
Removing the Query Profile Table
If you need to remove the table—for example, before tearing down a CloudLink—drop the task first, then the table:The CloudLink will continue to work without the table, but query-profile lookups will fall back to scanning
ACCOUNT_USAGE directly.Related
- Connect Snowflake to Elementum — full CloudLink setup, including the step where you provision this table.
- Snowflake warehouses — sizing and scaling guidance Elementum can refine using Query Profile data.
- Snowflake table types — Standard vs. Hybrid tables and how table type affects query performance.