# CTAS cost management

{% embed url="<https://youtu.be/l36dOAFYASg>" %}

DWH.dev automatically identifies all `CREATE TABLE AS SELECT` (CTAS) operations and links them to their corresponding compute cost using data from Snowflake’s `QUERY_HISTORY`.\
Each CTAS execution is associated with its target object, warehouse, and runtime metadata — allowing DWH.dev to estimate and attribute the credit consumption of transformation pipelines.

Costs are calculated based on the warehouse type used during execution (e.g., `XSMALL`, `MEDIUM`) and the runtime duration recorded in `QUERY_HISTORY`.\
In native Marketplace deployments, this data is enriched with compute-pool utilization metrics, providing a unified view of both **warehouse** and **pool-level** resource usage.

#### Used for

* Identifying the most expensive CTAS transformations across your pipelines.
* Tracking warehouse utilization and compute-pool credit consumption.
* Optimizing task schedules and warehouse configurations to reduce recurring costs.
* Highlighting redundant or rarely used CTAS operations.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dwh.dev/integrations/snowflake/snowflake-marketplace-native-app/ctas-cost-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
