{
  "startedAt": "2026-09-11T07:45:23.713Z",
  "samples": [
    {
      "name": "before",
      "plan": [
        {
          "Plan": {
            "Node Type": "Aggregate",
            "Strategy": "Plain",
            "Partial Mode": "Simple",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 169306.45,
            "Total Cost": 169306.46,
            "Plan Rows": 1,
            "Plan Width": 8,
            "Actual Startup Time": 4003.973,
            "Actual Total Time": 4003.975,
            "Actual Rows": 1,
            "Actual Loops": 1,
            "Output": [
              "sum(report_histogram_bucket_v1(k.kind, ((g.i)::numeric / '100'::numeric)))"
            ],
            "Shared Hit Blocks": 37,
            "Shared Read Blocks": 0,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 0,
            "Temp Written Blocks": 0,
            "Plans": [
              {
                "Node Type": "Nested Loop",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Join Type": "Inner",
                "Startup Cost": 0.01,
                "Total Cost": 8137.2,
                "Plan Rows": 625900,
                "Plan Width": 36,
                "Actual Startup Time": 1.563,
                "Actual Total Time": 74.963,
                "Actual Rows": 625900,
                "Actual Loops": 1,
                "Output": [
                  "k.kind",
                  "g.i"
                ],
                "Inner Unique": false,
                "Shared Hit Blocks": 0,
                "Shared Read Blocks": 0,
                "Shared Dirtied Blocks": 0,
                "Shared Written Blocks": 0,
                "Local Hit Blocks": 0,
                "Local Read Blocks": 0,
                "Local Dirtied Blocks": 0,
                "Local Written Blocks": 0,
                "Temp Read Blocks": 0,
                "Temp Written Blocks": 0,
                "Plans": [
                  {
                    "Node Type": "Function Scan",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Function Name": "generate_series",
                    "Schema": "pg_catalog",
                    "Alias": "g",
                    "Startup Cost": 0,
                    "Total Cost": 312.95,
                    "Plan Rows": 31295,
                    "Plan Width": 4,
                    "Actual Startup Time": 1.556,
                    "Actual Total Time": 4,
                    "Actual Rows": 31295,
                    "Actual Loops": 1,
                    "Output": [
                      "g.i"
                    ],
                    "Function Call": "generate_series('-100'::integer, 31194)",
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 0,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 0,
                    "Temp Written Blocks": 0
                  },
                  {
                    "Node Type": "Materialize",
                    "Parent Relationship": "Inner",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Startup Cost": 0.01,
                    "Total Cost": 0.55,
                    "Plan Rows": 20,
                    "Plan Width": 32,
                    "Actual Startup Time": 0,
                    "Actual Total Time": 0.001,
                    "Actual Rows": 20,
                    "Actual Loops": 31295,
                    "Output": [
                      "k.kind"
                    ],
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 0,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 0,
                    "Temp Written Blocks": 0,
                    "Plans": [
                      {
                        "Node Type": "Nested Loop",
                        "Parent Relationship": "Outer",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Join Type": "Inner",
                        "Startup Cost": 0.01,
                        "Total Cost": 0.45,
                        "Plan Rows": 20,
                        "Plan Width": 32,
                        "Actual Startup Time": 0.005,
                        "Actual Total Time": 0.009,
                        "Actual Rows": 20,
                        "Actual Loops": 1,
                        "Output": [
                          "k.kind"
                        ],
                        "Inner Unique": false,
                        "Shared Hit Blocks": 0,
                        "Shared Read Blocks": 0,
                        "Shared Dirtied Blocks": 0,
                        "Shared Written Blocks": 0,
                        "Local Hit Blocks": 0,
                        "Local Read Blocks": 0,
                        "Local Dirtied Blocks": 0,
                        "Local Written Blocks": 0,
                        "Temp Read Blocks": 0,
                        "Temp Written Blocks": 0,
                        "Plans": [
                          {
                            "Node Type": "Function Scan",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Function Name": "generate_series",
                            "Schema": "pg_catalog",
                            "Alias": "repetitions",
                            "Startup Cost": 0,
                            "Total Cost": 0.04,
                            "Plan Rows": 4,
                            "Plan Width": 0,
                            "Actual Startup Time": 0.002,
                            "Actual Total Time": 0.002,
                            "Actual Rows": 4,
                            "Actual Loops": 1,
                            "Output": [
                              "repetitions.repetitions"
                            ],
                            "Function Call": "generate_series(1, 4)",
                            "Shared Hit Blocks": 0,
                            "Shared Read Blocks": 0,
                            "Shared Dirtied Blocks": 0,
                            "Shared Written Blocks": 0,
                            "Local Hit Blocks": 0,
                            "Local Read Blocks": 0,
                            "Local Dirtied Blocks": 0,
                            "Local Written Blocks": 0,
                            "Temp Read Blocks": 0,
                            "Temp Written Blocks": 0
                          },
                          {
                            "Node Type": "Function Scan",
                            "Parent Relationship": "Inner",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Function Name": "unnest",
                            "Schema": "pg_catalog",
                            "Alias": "k",
                            "Startup Cost": 0,
                            "Total Cost": 0.05,
                            "Plan Rows": 5,
                            "Plan Width": 32,
                            "Actual Startup Time": 0,
                            "Actual Total Time": 0.001,
                            "Actual Rows": 5,
                            "Actual Loops": 4,
                            "Output": [
                              "k.kind"
                            ],
                            "Function Call": "unnest('{score,load,reps,rpe,unknown}'::text[])",
                            "Shared Hit Blocks": 0,
                            "Shared Read Blocks": 0,
                            "Shared Dirtied Blocks": 0,
                            "Shared Written Blocks": 0,
                            "Local Hit Blocks": 0,
                            "Local Read Blocks": 0,
                            "Local Dirtied Blocks": 0,
                            "Local Written Blocks": 0,
                            "Temp Read Blocks": 0,
                            "Temp Written Blocks": 0
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "Query Identifier": -5790637449081762000,
          "Planning": {
            "Shared Hit Blocks": 3,
            "Shared Read Blocks": 0,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 0,
            "Temp Written Blocks": 0
          },
          "Planning Time": 0.043,
          "Triggers": [],
          "Execution Time": 4015.966
        }
      ],
      "digest": [
        "126012|d1c780b62c196b82c61765b04b471551"
      ]
    },
    {
      "name": "after",
      "plan": [
        {
          "Plan": {
            "Node Type": "Aggregate",
            "Strategy": "Plain",
            "Partial Mode": "Simple",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 87939.45,
            "Total Cost": 87939.46,
            "Plan Rows": 1,
            "Plan Width": 8,
            "Actual Startup Time": 287.318,
            "Actual Total Time": 287.319,
            "Actual Rows": 1,
            "Actual Loops": 1,
            "Output": [
              "sum(CASE WHEN (((g.i)::numeric / '100'::numeric) IS NULL) THEN NULL::integer WHEN ((k.kind = 'score'::text) AND (((g.i)::numeric / '100'::numeric) >= '0'::numeric)) THEN LEAST(10, GREATEST(1, (floor(((g.i)::numeric / '100'::numeric)))::integer)) WHEN ((k.kind = 'load'::text) AND (((g.i)::numeric / '100'::numeric) >= '0'::numeric)) THEN LEAST(10, ((floor((((g.i)::numeric / '100'::numeric) / '10'::numeric)))::integer + 1)) WHEN ((k.kind = 'reps'::text) AND (((g.i)::numeric / '100'::numeric) >= '1'::numeric)) THEN LEAST(10, (floor(((g.i)::numeric / '100'::numeric)))::integer) WHEN ((k.kind = 'rpe'::text) AND (((g.i)::numeric / '100'::numeric) >= '1'::numeric) AND (((g.i)::numeric / '100'::numeric) <= '10'::numeric)) THEN CASE WHEN (((g.i)::numeric / '100'::numeric) < '6'::numeric) THEN 1 ELSE LEAST(10, ((floor(((((g.i)::numeric / '100'::numeric) - '6'::numeric) * '2'::numeric)))::integer + 2)) END ELSE NULL::integer END)"
            ],
            "Shared Hit Blocks": 0,
            "Shared Read Blocks": 0,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 0,
            "Temp Written Blocks": 0,
            "Plans": [
              {
                "Node Type": "Nested Loop",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Join Type": "Inner",
                "Startup Cost": 0.01,
                "Total Cost": 8137.2,
                "Plan Rows": 625900,
                "Plan Width": 36,
                "Actual Startup Time": 0.93,
                "Actual Total Time": 65.634,
                "Actual Rows": 625900,
                "Actual Loops": 1,
                "Output": [
                  "g.i",
                  "k.kind"
                ],
                "Inner Unique": false,
                "Shared Hit Blocks": 0,
                "Shared Read Blocks": 0,
                "Shared Dirtied Blocks": 0,
                "Shared Written Blocks": 0,
                "Local Hit Blocks": 0,
                "Local Read Blocks": 0,
                "Local Dirtied Blocks": 0,
                "Local Written Blocks": 0,
                "Temp Read Blocks": 0,
                "Temp Written Blocks": 0,
                "Plans": [
                  {
                    "Node Type": "Function Scan",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Function Name": "generate_series",
                    "Schema": "pg_catalog",
                    "Alias": "g",
                    "Startup Cost": 0,
                    "Total Cost": 312.95,
                    "Plan Rows": 31295,
                    "Plan Width": 4,
                    "Actual Startup Time": 0.926,
                    "Actual Total Time": 2.005,
                    "Actual Rows": 31295,
                    "Actual Loops": 1,
                    "Output": [
                      "g.i"
                    ],
                    "Function Call": "generate_series('-100'::integer, 31194)",
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 0,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 0,
                    "Temp Written Blocks": 0
                  },
                  {
                    "Node Type": "Materialize",
                    "Parent Relationship": "Inner",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Startup Cost": 0.01,
                    "Total Cost": 0.55,
                    "Plan Rows": 20,
                    "Plan Width": 32,
                    "Actual Startup Time": 0,
                    "Actual Total Time": 0.001,
                    "Actual Rows": 20,
                    "Actual Loops": 31295,
                    "Output": [
                      "k.kind"
                    ],
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 0,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 0,
                    "Temp Written Blocks": 0,
                    "Plans": [
                      {
                        "Node Type": "Nested Loop",
                        "Parent Relationship": "Outer",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Join Type": "Inner",
                        "Startup Cost": 0.01,
                        "Total Cost": 0.45,
                        "Plan Rows": 20,
                        "Plan Width": 32,
                        "Actual Startup Time": 0.003,
                        "Actual Total Time": 0.006,
                        "Actual Rows": 20,
                        "Actual Loops": 1,
                        "Output": [
                          "k.kind"
                        ],
                        "Inner Unique": false,
                        "Shared Hit Blocks": 0,
                        "Shared Read Blocks": 0,
                        "Shared Dirtied Blocks": 0,
                        "Shared Written Blocks": 0,
                        "Local Hit Blocks": 0,
                        "Local Read Blocks": 0,
                        "Local Dirtied Blocks": 0,
                        "Local Written Blocks": 0,
                        "Temp Read Blocks": 0,
                        "Temp Written Blocks": 0,
                        "Plans": [
                          {
                            "Node Type": "Function Scan",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Function Name": "generate_series",
                            "Schema": "pg_catalog",
                            "Alias": "repetitions",
                            "Startup Cost": 0,
                            "Total Cost": 0.04,
                            "Plan Rows": 4,
                            "Plan Width": 0,
                            "Actual Startup Time": 0.001,
                            "Actual Total Time": 0.001,
                            "Actual Rows": 4,
                            "Actual Loops": 1,
                            "Output": [
                              "repetitions.repetitions"
                            ],
                            "Function Call": "generate_series(1, 4)",
                            "Shared Hit Blocks": 0,
                            "Shared Read Blocks": 0,
                            "Shared Dirtied Blocks": 0,
                            "Shared Written Blocks": 0,
                            "Local Hit Blocks": 0,
                            "Local Read Blocks": 0,
                            "Local Dirtied Blocks": 0,
                            "Local Written Blocks": 0,
                            "Temp Read Blocks": 0,
                            "Temp Written Blocks": 0
                          },
                          {
                            "Node Type": "Function Scan",
                            "Parent Relationship": "Inner",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Function Name": "unnest",
                            "Schema": "pg_catalog",
                            "Alias": "k",
                            "Startup Cost": 0,
                            "Total Cost": 0.05,
                            "Plan Rows": 5,
                            "Plan Width": 32,
                            "Actual Startup Time": 0,
                            "Actual Total Time": 0,
                            "Actual Rows": 5,
                            "Actual Loops": 4,
                            "Output": [
                              "k.kind"
                            ],
                            "Function Call": "unnest('{score,load,reps,rpe,unknown}'::text[])",
                            "Shared Hit Blocks": 0,
                            "Shared Read Blocks": 0,
                            "Shared Dirtied Blocks": 0,
                            "Shared Written Blocks": 0,
                            "Local Hit Blocks": 0,
                            "Local Read Blocks": 0,
                            "Local Dirtied Blocks": 0,
                            "Local Written Blocks": 0,
                            "Temp Read Blocks": 0,
                            "Temp Written Blocks": 0
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          "Query Identifier": -5790637449081762000,
          "Planning": {
            "Shared Hit Blocks": 4,
            "Shared Read Blocks": 0,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 0,
            "Temp Written Blocks": 0
          },
          "Planning Time": 0.122,
          "Triggers": [],
          "Execution Time": 287.442
        }
      ],
      "digest": [
        "126012|d1c780b62c196b82c61765b04b471551"
      ]
    }
  ],
  "alteredSearchPath": [
    "126012|d1c780b62c196b82c61765b04b471551"
  ],
  "finishedAt": "2026-09-11T07:45:29.247Z",
  "evidenceSource": {
    "file": "r04-histogram-profile.json",
    "sha256": "db0ab4f25a7343fdff240095204745c3185ba8cb40a320b421becebe00e7f744",
    "classification": "Diagnostic uncommitted candidate, not the final workload gate"
  }
}
