Skip to content

Understand and Optimize RAI Native App Costs

Using RelationalAI (RAI) on Snowflake incurs costs from both Snowflake and RAI itself. Similar to Snowflake, RAI’s cloud architecture separates storage and compute usage, allowing for cost optimization based on specific needs.

  • You have the RAI Native App installed and activated on your Snowflake account.

Before you install, it helps to know what actually costs money:

  • Reasoner compute is the main driver. Reasoners consume Snowflake compute while running, and RelationalAI adds a surcharge on that compute. Larger reasoner sizes cost more per hour, so choose the smallest size that meets your performance needs and let reasoners auto-suspend.
  • The CDC engine consumes Snowflake compute continuously while CDC is enabled, sized by its instance family. If you never enable CDC, this cost never appears.
  • The app warehouse and serverless tasks consume Snowflake compute for interoperability and background work. Some serverless tasks keep running even after you deactivate the app.
  • Storage (the app database and deployed model schemas) has no RelationalAI surcharge and a small Snowflake storage cost.

You can pause most of these by deactivating the app when it is idle. For the full list of what the app creates and how to inspect it, see Resources the app creates.

Snowflake costs are based on compute and storage resource usage, detailed in the Snowflake User Guide. RAI costs appear as a surcharge for compute usage, primarily from reasoners. There’s no surcharge for storage usage.

The following resources all contribute to costs generated by the RAI Native App:

ResourceDescriptionSnowflake ChargeRAI SurchargeNotes
App DatabaseStores data used by the app.YesNoThis database is named RELATIONALAI unless you customized the app name during install.
App WarehouseUsed for Snowflake interoperability.YesNoThe RELATIONAL_AI_ERP_WAREHOUSE is automatically created the first time you activate the app. The default deactivate() suspends it; deactivate('all') drops it and recreates it on the next activation.
Serverless tasksUsed to schedule billing, garbage collection, upgrades, and other tasks.YesNoSome tasks, like those related to billing, may generate small amounts of compute consumption even when the app is deactivated.
Compute PoolsUsed for internal app operations and to host reasoners.NoNoCompute pools themselves generate no charge. Costs are incurred only by reasoners that run inside them, and by reserved-node capacity if you configure it. See Compute Pools for the names and instance families of each compute pool managed by the app.
CDC ReasonerUsed by the CDC Service to process data streams.YesNoRuns continuously while CDC is enabled. Costs are based on uptime and the CDC engine size. Suspending CDC pauses this cost.
User ReasonersUsed to evaluate queries from PyRel semantic models.YesYesCosts are based on uptime and are determined by the host compute pool’s instance family and the number of compute nodes used by the reasoner.

Reasoners consume compute resources even when they’re not actively processing queries. To reduce costs, reasoners automatically suspend after a period of inactivity. You can adjust the auto-suspend timeout to better fit your needs.

Suspend data streams that are rarely updated

Section titled “Suspend data streams that are rarely updated”

Streams that don’t require minute-by-minute processing can be suspended to reduce costs. You may also disable the CDC Service to suspend the CDC engine and stop processing change tracking data.

You can deactivate the app to reduce costs while the app is not in use. When the app is deactivated, the CDC service is suspended and all reasoners are deleted. The default deactivate() suspends the app warehouse and compute pools; deactivate('all') drops them. Tasks related to diagnostics and billing stay active and generate small amounts of compute consumption even after deactivation. Deactivation is not an uninstall: the app database and your account roles remain.

Use the queries below to monitor costs associated with your RAI Native App. For more detailed monitoring, administrators may tag the native app’s storage and compute resources to track RAI costs with Snowflake’s cost management framework.

Credits consumed by all reasoners per month

Section titled “Credits consumed by all reasoners per month”
SELECT
DATE_TRUNC('MONTH', hour) AS first_day_of_month,
SUM(credits) AS sum_of_rai_units
FROM
relationalai.consumption.engine_credit_hours
GROUP BY
first_day_of_month
ORDER BY
first_day_of_month DESC;
SELECT
DATE_TRUNC('day',c.HOUR) as day, sum(c.credits) AS total_daily_rai_units
FROM
relationalai.consumption.engine_credit_hours c
WHERE
hour >= DATEADD(month, -1, CURRENT_TIMESTAMP())
GROUP BY all ORDER BY 1 DESC;

Credits consumed per reasoner in the past month

Section titled “Credits consumed per reasoner in the past month”
SELECT
engine_name,
SUM(credits) AS total_credits,
COUNT(hour) AS hours
FROM
relationalai.consumption.engine_credit_hours
WHERE
hour >= DATEADD(month, -1, CURRENT_TIMESTAMP())
GROUP BY
engine_name
ORDER BY
total_credits DESC;

Credits consumed per compute pool per month

Section titled “Credits consumed per compute pool per month”

Requires access to the SNOWFLAKE.ACCOUNT_USAGE.SNOWPARK_CONTAINER_SERVICES_HISTORY view, such as through the USAGE_VIEWER database role.

SELECT
DATE_TRUNC('MONTH', START_TIME) AS first_day_of_month,
compute_pool_name,
SUM(credits_used) as total_credits
FROM
SNOWFLAKE.ACCOUNT_USAGE.SNOWPARK_CONTAINER_SERVICES_HISTORY
WHERE
APPLICATION_NAME = 'RELATIONALAI'
GROUP BY
first_day_of_month, compute_pool_name
ORDER BY
first_day_of_month DESC,
compute_pool_name;

Credits consumed by the app warehouse per month

Section titled “Credits consumed by the app warehouse per month”

Requires access to the SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY view, such as through the USAGE_VIEWER database role.

SELECT
DATE_TRUNC('MONTH', START_TIME) AS first_day_of_month,
SUM(credits_used) as total_credits
FROM
SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE
WAREHOUSE_NAME = 'RELATIONAL_AI_ERP_WAREHOUSE'
GROUP BY
first_day_of_month
ORDER BY
first_day_of_month DESC;

Jobs performed by all reasoners in the past month

Section titled “Jobs performed by all reasoners in the past month”

To help understand which queries or other jobs are consuming the most credits, you could look at which jobs took the longest to complete. Although duration alone does not determine a job’s cost—other factors such as the configured reasoner size also affect cost—you can use this query to identify jobs that may be responsible for high costs. You can then investigate these jobs further to determine if they can be optimized.

Use the following query to see all jobs performed by all reasoners in the past month sorted by duration in descending order:

SELECT
*
FROM
relationalai.api.jobs
WHERE
created_on >= DATEADD(month, -1, CURRENT_TIMESTAMP())
ORDER BY
duration DESC;