> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dqlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> What Queries metrics are in Prizm — measure the volume, efficiency, and reliability of query workloads against a database or schema.

<script type="application/ld+json">
  {`{
            "@context": "https://schema.org",
            "@type": "TechArticle",
            "headline": "Queries Metrics Overview",
            "description": "What Queries metrics are in Prizm - measure the volume, efficiency, and reliability of query workloads against a database or schema.",
            "url": "https://docs.dqlabs.ai/architecture/metrics/queries/overview",
            "publisher": {
              "@type": "Organization",
              "name": "DQLabs Inc",
              "logo": "https://media.brand.dev/332adc35-5bc4-4d2b-bf78-256aa4a5e414.svg"
            }
            }`}
</script>

## What is a Queries metric?

Queries metrics measure **the volume, efficiency, and reliability of query workloads** running against a database or schema. They surface query performance degradation, execution bottlenecks, and reliability issues before they escalate into user-facing failures.

**Type:** Automatic — Queries metrics are enabled on all connected database and schema objects as part of the Cost & Performance profile. No configuration is required to activate them.

Queries metrics answer the question: *Are queries running successfully, at expected volume, and within acceptable execution times?*

Prizm collects query execution data from Snowflake's `ACCOUNT_USAGE.QUERY_HISTORY` view on each performance job run (every 24 hours, with a 45-minute overlap for latency). Results are aggregated per database and schema, trended over time, and evaluated against a statistical baseline.

### Metrics

| Metric                 | Level             | Subcategory | Dimension   | Description                                                                                                                                                                                                                                              |
| ---------------------- | ----------------- | ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Total Queries Per Day  | Database / Schema | Queries     | Utilization | Total number of queries executed against the database or schema per day. Tracks overall workload volume over time. A sudden drop can indicate a pipeline failure or access issue; a spike may indicate a runaway process or new high-frequency consumer. |
| Query Success Rate     | Database / Schema | Queries     | Throughput  | Percentage of queries that completed with execution status SUCCESS, calculated as `(successful queries / total queries) × 100`. A declining success rate signals permission errors, schema breakage, or query bugs affecting consumers.                  |
| Average Execution Time | Database / Schema | Queries     | Throughput  | Average time in milliseconds from when a query begins executing to when it completes, excluding queue wait. Tracks pure compute efficiency. Increases here point to model complexity, warehouse undersizing, or data volume growth.                      |

### How Queries monitoring works

Prizm reads from `SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY` on each performance job run, aggregating each metric across all queries in the last 24-hour window per database and schema. Each metric is independently baselined and evaluated against a statistical model that accounts for recurring patterns — higher weekday volumes, end-of-month reporting spikes, and nightly batch windows.

### Example use cases

**Detecting schema breakage impact:** After a schema migration, downstream queries begin referencing a column that no longer exists. Query Success Rate drops from 99% to 68% within the next performance collection cycle. Prizm alerts, giving the data team a quantified measure of blast radius before users report errors.

**Catching execution regressions:** A dbt model refactor introduces an expensive cross-join. Average Execution Time rises from 200ms to over 4 seconds for queries on the affected schema. Prizm surfaces the anomaly within the next collection window, before it causes SLA misses.

**Spotting pipeline outages:** Total Queries Per Day drops to near zero on a schema that normally sees several hundred queries per day. Prizm fires an alert, prompting the team to investigate an upstream pipeline failure that silently stopped feeding the schema.

<Tip>
  Use Total Queries Per Day alongside Average Execution Time and Query Success Rate together to triage issues quickly. A drop in query count with a rising success rate suggests a pipeline stopped sending queries. A drop in success rate with stable query count points to schema or permission breakage. Rising execution time with stable count and success rate indicates a query efficiency regression.
</Tip>

<Card title="Configure" icon="sliders" href="/architecture/metrics/queries/configure">
  Set thresholds, view the metric detail page, and understand Queries alerts.
</Card>
