{
  "license": "CC BY 4.0",
  "recipe": {
    "slug": "slow-database-queries-by-fingerprint",
    "title": "Find Slow Database Queries by Fingerprint",
    "testedWith": "Apache DataFusion 45.2.0",
    "lastReviewed": "2026-07-28"
  },
  "contract": {
    "tableName": "database_query_events",
    "schema": [
      {
        "name": "timestamp_utc",
        "type": "Timestamp",
        "description": "When the database operation completed, in UTC."
      },
      {
        "name": "query_fingerprint",
        "type": "Utf8",
        "description": "A normalized, bounded operation label without parameter values."
      },
      {
        "name": "service",
        "type": "Utf8",
        "description": "Application or worker that issued the operation."
      },
      {
        "name": "database_name",
        "type": "Utf8",
        "description": "Approved logical database name."
      },
      {
        "name": "status",
        "type": "Utf8",
        "description": "success or failed."
      },
      {
        "name": "duration_ms",
        "type": "Float64",
        "description": "End-to-end database operation duration in milliseconds."
      },
      {
        "name": "rows_returned",
        "type": "Int64",
        "description": "Rows returned or affected when the client exposes the count."
      },
      {
        "name": "release",
        "type": "Utf8",
        "description": "Application release that issued the query."
      },
      {
        "name": "environment",
        "type": "Utf8",
        "description": "Deployment environment."
      }
    ]
  },
  "query": "SELECT\n  query_fingerprint,\n  service,\n  database_name,\n  COUNT(*) AS executions,\n  SUM(CASE WHEN duration_ms >= 1000 THEN 1 ELSE 0 END) AS slow_executions,\n  100.0 * SUM(CASE WHEN duration_ms >= 1000 THEN 1 ELSE 0 END)\n    / NULLIF(COUNT(*), 0) AS slow_query_rate_pct,\n  AVG(duration_ms) AS average_duration_ms,\n  MAX(duration_ms) AS maximum_duration_ms\nFROM database_query_events\nWHERE timestamp_utc >= now() - INTERVAL '30 days'\n  AND environment = 'production'\nGROUP BY query_fingerprint, service, database_name\nHAVING COUNT(*) >= 10\nORDER BY slow_query_rate_pct DESC, executions DESC\nLIMIT 20;",
  "fixtureKind": "reproducible",
  "inputRows": [
    {
      "timestamp_utc": "2026-07-28T18:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 800,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T17:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 900,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T16:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1000,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T15:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1100,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1200,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1300,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1400,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1500,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1600,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1700,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T16:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1200,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T15:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1400,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 900,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1100,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 700,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 650,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1300,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 500,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T08:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1600,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T07:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 800,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T06:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 750,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T05:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1250,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 220,
      "rows_returned": 40,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 240,
      "rows_returned": 41,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 260,
      "rows_returned": 42,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 280,
      "rows_returned": 43,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 300,
      "rows_returned": 44,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 320,
      "rows_returned": 45,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T08:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 340,
      "rows_returned": 46,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T07:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 360,
      "rows_returned": 47,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T06:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 380,
      "rows_returned": 48,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T05:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 400,
      "rows_returned": 49,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T04:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 420,
      "rows_returned": 50,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T03:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 440,
      "rows_returned": 51,
      "release": "2026.07.1",
      "environment": "production"
    }
  ],
  "illustrativeInputRows": [
    {
      "timestamp_utc": "2026-07-28T18:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 800,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T17:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 900,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T16:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1000,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T15:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1100,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1200,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1300,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1400,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1500,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1600,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "UPDATE invoices SET status = ?",
      "service": "billing-worker",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1700,
      "rows_returned": 1,
      "release": "2026.07.2",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T16:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1200,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T15:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1400,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 900,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1100,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 700,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 650,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1300,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 500,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T08:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "failed",
      "duration_ms": 1600,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T07:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 800,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T06:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 750,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T05:00:00.000Z",
      "query_fingerprint": "SELECT checkout WITH line_items",
      "service": "checkout-api",
      "database_name": "app_production",
      "status": "success",
      "duration_ms": 1250,
      "rows_returned": 1,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T14:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 220,
      "rows_returned": 40,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T13:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 240,
      "rows_returned": 41,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T12:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 260,
      "rows_returned": 42,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T11:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 280,
      "rows_returned": 43,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T10:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 300,
      "rows_returned": 44,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T09:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 320,
      "rows_returned": 45,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T08:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 340,
      "rows_returned": 46,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T07:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 360,
      "rows_returned": 47,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T06:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 380,
      "rows_returned": 48,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T05:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 400,
      "rows_returned": 49,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T04:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 420,
      "rows_returned": 50,
      "release": "2026.07.1",
      "environment": "production"
    },
    {
      "timestamp_utc": "2026-07-28T03:00:00.000Z",
      "query_fingerprint": "SELECT products BY category",
      "service": "catalog-api",
      "database_name": "catalog_production",
      "status": "success",
      "duration_ms": 440,
      "rows_returned": 51,
      "release": "2026.07.1",
      "environment": "production"
    }
  ],
  "expectedOutput": {
    "columns": [
      "query_fingerprint",
      "service",
      "database_name",
      "executions",
      "slow_executions",
      "slow_query_rate_pct",
      "average_duration_ms",
      "maximum_duration_ms"
    ],
    "rows": [
      {
        "query_fingerprint": "UPDATE invoices SET status = ?",
        "service": "billing-worker",
        "database_name": "app_production",
        "executions": 10,
        "slow_executions": 8,
        "slow_query_rate_pct": 80,
        "average_duration_ms": 1250,
        "maximum_duration_ms": 1700
      },
      {
        "query_fingerprint": "SELECT checkout WITH line_items",
        "service": "checkout-api",
        "database_name": "app_production",
        "executions": 12,
        "slow_executions": 6,
        "slow_query_rate_pct": 50,
        "average_duration_ms": 1012.5,
        "maximum_duration_ms": 1600
      },
      {
        "query_fingerprint": "SELECT products BY category",
        "service": "catalog-api",
        "database_name": "catalog_production",
        "executions": 12,
        "slow_executions": 0,
        "slow_query_rate_pct": 0,
        "average_duration_ms": 330,
        "maximum_duration_ms": 440
      }
    ]
  },
  "notes": [
    "The included synthetic input rows generate the expected output when timestamps are shifted into the documented query window.",
    "Run this fixture in the public browser SQL playground; the selected query executes locally with DuckDB-Wasm.",
    "Adapt time windows, thresholds, identities, and business definitions before operational use."
  ]
}