{
  "observed_at_utc": "2026-12-05T23:08:13.044784+00:00",
  "environment": {
    "postgres": "PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit",
    "image_reference": "postgres@sha256:67f41722b7a8cbdb868a44a4995c846eddfdc2973bccb291ce937dce88ad5675",
    "image_id": "sha256:651ddcd1c769a6d94cf4aaca9756f2abb6acd65e712f4a386a2ff4e730586d5b",
    "network": "none",
    "published_ports": [],
    "cpus": 1,
    "memory_mib": 768
  },
  "scope": "Synthetic PostgreSQL RLS checks; auth.uid is a local stub.",
  "passed": 15,
  "checks": [
    "PASS: RLS is active for the tested role",
    "PASS: tested role has no RLS bypass",
    "PASS: member reads only published articles in own workspace",
    "PASS: guessed foreign article ID returns no rows",
    "PASS: forged workspace filter returns no rows",
    "PASS: member cannot read another author draft",
    "PASS: cross-workspace update changes no rows",
    "PASS: cross-workspace insert rejected",
    "PASS: TRUNCATE privilege is absent",
    "PASS: member can create and read own draft",
    "PASS: owner sees all own workspace articles",
    "PASS: owner has no global workspace access",
    "PASS: outsider reads no articles",
    "PASS: missing identity reads no articles",
    "PASS: revoked member reads no articles"
  ],
  "benchmark": {
    "observed_at_utc": "2026-12-05T23:08:25.477112+00:00",
    "environment": {
      "postgres": "PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit",
      "image_reference": "postgres@sha256:67f41722b7a8cbdb868a44a4995c846eddfdc2973bccb291ce937dce88ad5675",
      "image_id": "sha256:651ddcd1c769a6d94cf4aaca9756f2abb6acd65e712f4a386a2ff4e730586d5b",
      "network": "none",
      "published_ports": [],
      "cpus": 1,
      "memory_mib": 768
    },
    "synthetic_articles": 600000,
    "workspaces": 5000,
    "memberships": 10,
    "admin_memberships": 3,
    "warmups_per_variant": 2,
    "measurements_per_variant": 7,
    "query": "select id from public.kb_articles order by updated_at desc limit 20",
    "limits": "Single bulk timestamp; NULL created_by; no JWT, network, UI or live customer workload. Tied LIMIT row identities are not compared; full visible ID digests are compared.",
    "results": {
      "subquery_in": {
        "semantics": {
          "role": "authenticated",
          "rls_active": true,
          "visible_rows": 640,
          "id_digest": "5038a5a0baf8a068a746625e96e3ac41"
        },
        "outsider_visible_rows": 0,
        "execution_ms": [
          69.815,
          64.793,
          64.818,
          63.866,
          63.942,
          65.603,
          65.162
        ],
        "planning_ms": [
          0.347,
          0.291,
          0.308,
          0.346,
          0.296,
          0.301,
          0.283
        ],
        "last_explain_plan": {
          "Node Type": "Limit",
          "Parallel Aware": false,
          "Async Capable": false,
          "Startup Cost": 26649.17,
          "Total Cost": 26649.22,
          "Plan Rows": 20,
          "Plan Width": 24,
          "Actual Rows": 20,
          "Actual Loops": 1,
          "Shared Hit Blocks": 7085,
          "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": "Result",
              "Parent Relationship": "InitPlan",
              "Subplan Name": "InitPlan 3",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 0.0,
              "Total Cost": 0.03,
              "Plan Rows": 1,
              "Plan Width": 16,
              "Actual Rows": 1,
              "Actual Loops": 1,
              "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": "Sort",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 26649.14,
              "Total Cost": 27525.29,
              "Plan Rows": 350460,
              "Plan Width": 24,
              "Actual Rows": 20,
              "Actual Loops": 1,
              "Sort Key": [
                "kb_articles.updated_at DESC"
              ],
              "Sort Method": "top-N heapsort",
              "Sort Space Used": 26,
              "Sort Space Type": "Memory",
              "Shared Hit Blocks": 7085,
              "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": "Seq Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Async Capable": false,
                  "Relation Name": "kb_articles",
                  "Alias": "kb_articles",
                  "Startup Cost": 15.53,
                  "Total Cost": 17323.53,
                  "Plan Rows": 350460,
                  "Plan Width": 24,
                  "Actual Rows": 640,
                  "Actual Loops": 1,
                  "Filter": "((ANY (workspace_id = (hashed SubPlan 1).col1)) OR ((ANY (workspace_id = (hashed SubPlan 2).col1)) AND (published OR (created_by = (InitPlan 3).col1))))",
                  "Rows Removed by Filter": 599360,
                  "Shared Hit Blocks": 7082,
                  "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": "ProjectSet",
                      "Parent Relationship": "SubPlan",
                      "Subplan Name": "SubPlan 1",
                      "Parallel Aware": false,
                      "Async Capable": false,
                      "Startup Cost": 0.0,
                      "Total Cost": 5.27,
                      "Plan Rows": 1000,
                      "Plan Width": 16,
                      "Actual Rows": 3,
                      "Actual Loops": 1,
                      "Shared Hit Blocks": 273,
                      "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": "Result",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Async Capable": false,
                          "Startup Cost": 0.0,
                          "Total Cost": 0.01,
                          "Plan Rows": 1,
                          "Plan Width": 0,
                          "Actual Rows": 1,
                          "Actual Loops": 1,
                          "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": "ProjectSet",
                      "Parent Relationship": "SubPlan",
                      "Subplan Name": "SubPlan 2",
                      "Parallel Aware": false,
                      "Async Capable": false,
                      "Startup Cost": 0.0,
                      "Total Cost": 5.27,
                      "Plan Rows": 1000,
                      "Plan Width": 16,
                      "Actual Rows": 10,
                      "Actual Loops": 1,
                      "Shared Hit Blocks": 1,
                      "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": "Result",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Async Capable": false,
                          "Startup Cost": 0.0,
                          "Total Cost": 0.01,
                          "Plan Rows": 1,
                          "Plan Width": 0,
                          "Actual Rows": 1,
                          "Actual Loops": 1,
                          "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
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        "median_execution_ms": 64.818
      },
      "array_any": {
        "semantics": {
          "role": "authenticated",
          "rls_active": true,
          "visible_rows": 640,
          "id_digest": "5038a5a0baf8a068a746625e96e3ac41"
        },
        "outsider_visible_rows": 0,
        "execution_ms": [
          1.081,
          1.037,
          0.988,
          1.104,
          1.044,
          1.133,
          1.034
        ],
        "planning_ms": [
          0.343,
          0.349,
          0.335,
          0.35,
          0.361,
          0.378,
          0.362
        ],
        "last_explain_plan": {
          "Node Type": "Limit",
          "Parallel Aware": false,
          "Async Capable": false,
          "Startup Cost": 5058.72,
          "Total Cost": 5058.77,
          "Plan Rows": 20,
          "Plan Width": 24,
          "Actual Rows": 20,
          "Actual Loops": 1,
          "Shared Hit Blocks": 424,
          "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": "ProjectSet",
              "Parent Relationship": "InitPlan",
              "Subplan Name": "InitPlan 1",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 0.0,
              "Total Cost": 5.27,
              "Plan Rows": 1000,
              "Plan Width": 16,
              "Actual Rows": 3,
              "Actual Loops": 1,
              "Shared Hit Blocks": 270,
              "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": "Result",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Async Capable": false,
                  "Startup Cost": 0.0,
                  "Total Cost": 0.01,
                  "Plan Rows": 1,
                  "Plan Width": 0,
                  "Actual Rows": 1,
                  "Actual Loops": 1,
                  "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": "ProjectSet",
              "Parent Relationship": "InitPlan",
              "Subplan Name": "InitPlan 2",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 0.0,
              "Total Cost": 5.27,
              "Plan Rows": 1000,
              "Plan Width": 16,
              "Actual Rows": 10,
              "Actual Loops": 1,
              "Shared Hit Blocks": 1,
              "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": "Result",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Async Capable": false,
                  "Startup Cost": 0.0,
                  "Total Cost": 0.01,
                  "Plan Rows": 1,
                  "Plan Width": 0,
                  "Actual Rows": 1,
                  "Actual Loops": 1,
                  "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": "Result",
              "Parent Relationship": "InitPlan",
              "Subplan Name": "InitPlan 3",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 0.0,
              "Total Cost": 0.03,
              "Plan Rows": 1,
              "Plan Width": 16,
              "Actual Rows": 1,
              "Actual Loops": 1,
              "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": "Sort",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Async Capable": false,
              "Startup Cost": 5048.16,
              "Total Cost": 5052.16,
              "Plan Rows": 1601,
              "Plan Width": 24,
              "Actual Rows": 20,
              "Actual Loops": 1,
              "Sort Key": [
                "kb_articles.updated_at DESC"
              ],
              "Sort Method": "top-N heapsort",
              "Sort Space Used": 26,
              "Sort Space Type": "Memory",
              "Shared Hit Blocks": 424,
              "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": "Bitmap Heap Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Async Capable": false,
                  "Relation Name": "kb_articles",
                  "Alias": "kb_articles",
                  "Startup Cost": 107.3,
                  "Total Cost": 5005.56,
                  "Plan Rows": 1601,
                  "Plan Width": 24,
                  "Actual Rows": 640,
                  "Actual Loops": 1,
                  "Recheck Cond": "((workspace_id = ANY ((InitPlan 1).col1)) OR (workspace_id = ANY ((InitPlan 2).col1)))",
                  "Rows Removed by Index Recheck": 0,
                  "Filter": "((workspace_id = ANY ((InitPlan 1).col1)) OR ((workspace_id = ANY ((InitPlan 2).col1)) AND (published OR (created_by = (InitPlan 3).col1))))",
                  "Rows Removed by Filter": 560,
                  "Exact Heap Blocks": 143,
                  "Lossy Heap Blocks": 0,
                  "Shared Hit Blocks": 421,
                  "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": "BitmapOr",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "Async Capable": false,
                      "Startup Cost": 107.3,
                      "Total Cost": 107.3,
                      "Plan Rows": 2397,
                      "Plan Width": 0,
                      "Actual Rows": 0,
                      "Actual Loops": 1,
                      "Shared Hit Blocks": 278,
                      "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": "Bitmap Index Scan",
                          "Parent Relationship": "Member",
                          "Parallel Aware": false,
                          "Async Capable": false,
                          "Index Name": "kb_articles_workspace_id_idx",
                          "Startup Cost": 0.0,
                          "Total Cost": 53.25,
                          "Plan Rows": 1198,
                          "Plan Width": 0,
                          "Actual Rows": 360,
                          "Actual Loops": 1,
                          "Index Cond": "(workspace_id = ANY ((InitPlan 1).col1))",
                          "Shared Hit Blocks": 273,
                          "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": "Bitmap Index Scan",
                          "Parent Relationship": "Member",
                          "Parallel Aware": false,
                          "Async Capable": false,
                          "Index Name": "kb_articles_workspace_id_idx",
                          "Startup Cost": 0.0,
                          "Total Cost": 53.25,
                          "Plan Rows": 1198,
                          "Plan Width": 0,
                          "Actual Rows": 1200,
                          "Actual Loops": 1,
                          "Index Cond": "(workspace_id = ANY ((InitPlan 2).col1))",
                          "Shared Hit Blocks": 5,
                          "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
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        "median_execution_ms": 1.044
      }
    }
  }
}
