{
  "version": 1,
  "source": "ExoBench session 2026-08-12, correlationId 0daa96e9-52fa-495e-884b-89c857b08233",
  "note": "Supplemental data for postgres-disagreed-with-itself.mdx. mcp-call blocks render as ExoBench tool cards; result strings are byte-verbatim tool-result JSON, all under correlationId 0daa96e9-52fa-495e-884b-89c857b08233. Five blocks (pairHeldSilver, controlBreak, flipRun, rpcRun, compositeGin) are from the 2026-08-12 session. Three (baselineRun, exprBtreeLure, trgmAloneRun) are from a 2026-08-14 rerun on the production pool; the latter two schemaTemplates carry one set_config line appending an 'extensions' schema to the search_path, a no-op on standard Postgres, working around a pool search_path misconfiguration. Input schemaTemplate/query/scalePoints are the reproduction payloads as sent. All three chart series are backed by cards in this file.",
  "blocks": {
    "baselineRun": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE TABLE silver_fec_efiling_itemizations (\n  id          bigint PRIMARY KEY,\n  record_type text,\n  record_data jsonb\n);\n\nINSERT INTO silver_fec_efiling_itemizations (id, record_type, record_data)\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  jsonb_build_object(\n    'form_type', 'SA11AI',\n    'filer_committee_id_number', 'C00' || lpad(((random()*99999)::int)::text, 6, '0'),\n    'transaction_id', 'SA11AI.' || i,\n    'entity_type', CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n    'contributor_organization_name', '',\n    'contributor_last_name', (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n    'contributor_first_name', (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n    'contributor_middle_name', '',\n    'contributor_street_1', ((random()*9999)::int)::text || ' MAIN STREET',\n    'contributor_city', (ARRAY['BALTIMORE','BETHESDA','ROCKVILLE','SILVER SPRING','ANNAPOLIS','COLUMBIA','FREDERICK','GAITHERSBURG','TOWSON','BOWIE'])[(random()*9)::int+1],\n    'contributor_state', (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n    'contributor_zip_code', lpad(((random()*99999)::int)::text, 5, '0'),\n    'election_code', 'P2026',\n    'contribution_date', to_char('2023-01-01'::timestamp + (random() * 1300 * interval '1 day'), 'YYYY-MM-DD\"T\"HH24:MI:SS'),\n    'contribution_amount', round((random()*2900)::numeric, 2),\n    'contribution_aggregate', round((random()*5800)::numeric, 2),\n    'contribution_purpose_descrip', 'CONTRIBUTION',\n    'contributor_employer', CASE WHEN random() < 0.0015\n         THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n         ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n              || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n       END,\n    'contributor_occupation', (ARRAY['ENGINEER','ATTORNEY','PHYSICIAN','TEACHER','CONSULTANT','EXECUTIVE','RETIRED','ANALYST','MANAGER','SALES'])[(random()*9)::int+1],\n    'memo_code', '',\n    'memo_text_description', 'EARMARKED CONTRIBUTION REPORTED ON LINE 11AI',\n    'image_number', ((random()*999999999999999)::bigint)::text,\n    'file_number', ((random()*9999999)::int)::text,\n    'sub_id', ((random()*9999999999)::bigint)::text\n  )\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_record_type ON silver_fec_efiling_itemizations (record_type);\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  record_data->>'contributor_first_name' AS first_name,\n  record_data->>'contributor_last_name'  AS last_name,\n  record_data->>'contributor_state'      AS state,\n  record_data->>'contributor_employer'   AS employer,\n  (record_data->>'contribution_amount')::numeric AS amount,\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\nFROM silver_fec_efiling_itemizations\nWHERE record_type = 'Schedule A'\n  AND record_data->>'entity_type' = 'IND'\n  AND record_data->>'contributor_state' = 'MD'\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\n  AND record_data->>'contribution_date' >= '2025-01-01'\n  AND record_data->>'contribution_date' <  '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 250000
          },
          {
            "SCALE": 1000000
          }
        ],
        "databaseType": "POSTGRES",
        "compression": "original",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-14T16:40:28.240952486Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  record_data->>'contributor_first_name' AS first_name,\\n  record_data->>'contributor_last_name'  AS last_name,\\n  record_data->>'contributor_state'      AS state,\\n  record_data->>'contributor_employer'   AS employer,\\n  (record_data->>'contribution_amount')::numeric AS amount,\\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\\nFROM silver_fec_efiling_itemizations\\nWHERE record_type = 'Schedule A'\\n  AND record_data->>'entity_type' = 'IND'\\n  AND record_data->>'contributor_state' = 'MD'\\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\\n  AND record_data->>'contribution_date' >= '2025-01-01'\\n  AND record_data->>'contribution_date' <  '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":28.314999999999998,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":250000},\"output\":\"QUERY PLAN\\nGather  (cost=1000.00..36065.39 rows=1 width=164) (actual time=38.706..46.780 rows=0 loops=1)\\n  Workers Planned: 2\\n  Workers Launched: 2\\n  Buffers: shared hit=31159\\n  ->  Parallel Seq Scan on silver_fec_efiling_itemizations  (cost=0.00..35065.29 rows=1 width=164) (actual time=36.228..36.229 rows=0 loops=3)\\n        Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text) AND ((record_data ->> 'contributor_state'::text) = 'MD'::text))\\n        Rows Removed by Filter: 83333\\n        Buffers: shared hit=31159\\nPlanning:\\n  Buffers: shared hit=46 dirtied=1\\nPlanning Time: 0.188 ms\\nExecution Time: 46.805 ms\",\"runtimeDurationMs\":55,\"rowsAreCapped\":false,\"computeSeconds\":6.79},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nGather  (cost=1000.00..141330.63 rows=1 width=164) (actual time=184.943..193.793 rows=7 loops=1)\\n  Workers Planned: 2\\n  Workers Launched: 2\\n  Buffers: shared hit=57193 read=67513\\n  ->  Parallel Seq Scan on silver_fec_efiling_itemizations  (cost=0.00..140330.53 rows=1 width=164) (actual time=118.601..181.945 rows=2 loops=3)\\n        Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text) AND ((record_data ->> 'contributor_state'::text) = 'MD'::text))\\n        Rows Removed by Filter: 333331\\n        Buffers: shared hit=57193 read=67513\\nPlanning:\\n  Buffers: shared hit=41 read=4\\nPlanning Time: 0.240 ms\\nExecution Time: 193.820 ms\",\"runtimeDurationMs\":198,\"rowsAreCapped\":false,\"computeSeconds\":21.525}],\"workerId\":\"163cfebd-403e-4508-ad56-468ac10d6856\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0\"}",
      "isError": false,
      "caption": "The baseline: btree on record_type only, parallel seq scan over the whole table at 250K and 1M rows",
      "planCaptions": {
        "250K": "Parallel Seq Scan over the whole table, 31,159 buffers, every one a cache hit. This draw's needle count at 250K rounds to zero rows returned. Execution Time 46.805 ms.",
        "1M": "Same Parallel Seq Scan at 1M rows: 124,706 buffers, 67,513 of them read cold, 7 rows survive the filter. Execution Time 193.820 ms."
      }
    },
    "exprBtreeLure": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "-- Portable no-op on standard Postgres; appends the schema ExoBench installs extensions into\nSELECT set_config('search_path', current_setting('search_path') || ',extensions', false);\n\nCREATE TABLE silver_fec_efiling_itemizations (\n  id          bigint PRIMARY KEY,\n  record_type text,\n  record_data jsonb\n);\n\nINSERT INTO silver_fec_efiling_itemizations (id, record_type, record_data)\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  jsonb_build_object(\n    'form_type', 'SA11AI',\n    'filer_committee_id_number', 'C00' || lpad(((random()*99999)::int)::text, 6, '0'),\n    'transaction_id', 'SA11AI.' || i,\n    'entity_type', CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n    'contributor_organization_name', '',\n    'contributor_last_name', (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n    'contributor_first_name', (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n    'contributor_middle_name', '',\n    'contributor_street_1', ((random()*9999)::int)::text || ' MAIN STREET',\n    'contributor_city', (ARRAY['BALTIMORE','BETHESDA','ROCKVILLE','SILVER SPRING','ANNAPOLIS','COLUMBIA','FREDERICK','GAITHERSBURG','TOWSON','BOWIE'])[(random()*9)::int+1],\n    'contributor_state', (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n    'contributor_zip_code', lpad(((random()*99999)::int)::text, 5, '0'),\n    'election_code', 'P2026',\n    'contribution_date', to_char('2023-01-01'::timestamp + (random() * 1300 * interval '1 day'), 'YYYY-MM-DD\"T\"HH24:MI:SS'),\n    'contribution_amount', round((random()*2900)::numeric, 2),\n    'contribution_aggregate', round((random()*5800)::numeric, 2),\n    'contribution_purpose_descrip', 'CONTRIBUTION',\n    'contributor_employer', CASE WHEN random() < 0.0015\n         THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n         ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n              || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n       END,\n    'contributor_occupation', (ARRAY['ENGINEER','ATTORNEY','PHYSICIAN','TEACHER','CONSULTANT','EXECUTIVE','RETIRED','ANALYST','MANAGER','SALES'])[(random()*9)::int+1],\n    'memo_code', '',\n    'memo_text_description', 'EARMARKED CONTRIBUTION REPORTED ON LINE 11AI',\n    'image_number', ((random()*999999999999999)::bigint)::text,\n    'file_number', ((random()*9999999)::int)::text,\n    'sub_id', ((random()*9999999999)::bigint)::text\n  )\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_record_type ON silver_fec_efiling_itemizations (record_type);\n\n-- Candidate A: partial composite expression btree on (state, date)\nCREATE INDEX idx_fec_state_date ON silver_fec_efiling_itemizations\n  ((record_data->>'contributor_state'), (record_data->>'contribution_date'))\n  WHERE record_type = 'Schedule A' AND record_data->>'entity_type' = 'IND';\n\n-- Candidate B: trigram GIN on employer\nCREATE INDEX idx_fec_employer_trgm ON silver_fec_efiling_itemizations\n  USING gin ((record_data->>'contributor_employer') gin_trgm_ops);\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  record_data->>'contributor_first_name' AS first_name,\n  record_data->>'contributor_last_name'  AS last_name,\n  record_data->>'contributor_state'      AS state,\n  record_data->>'contributor_employer'   AS employer,\n  (record_data->>'contribution_amount')::numeric AS amount,\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\nFROM silver_fec_efiling_itemizations\nWHERE record_type = 'Schedule A'\n  AND record_data->>'entity_type' = 'IND'\n  AND record_data->>'contributor_state' = 'MD'\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\n  AND record_data->>'contribution_date' >= '2025-01-01'\n  AND record_data->>'contribution_date' <  '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 1000000
          }
        ],
        "databaseType": "POSTGRES",
        "compression": "original",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-14T16:42:26.098105345Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  record_data->>'contributor_first_name' AS first_name,\\n  record_data->>'contributor_last_name'  AS last_name,\\n  record_data->>'contributor_state'      AS state,\\n  record_data->>'contributor_employer'   AS employer,\\n  (record_data->>'contribution_amount')::numeric AS amount,\\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\\nFROM silver_fec_efiling_itemizations\\nWHERE record_type = 'Schedule A'\\n  AND record_data->>'entity_type' = 'IND'\\n  AND record_data->>'contributor_state' = 'MD'\\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\\n  AND record_data->>'contribution_date' >= '2025-01-01'\\n  AND record_data->>'contribution_date' <  '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":1,\"totalComputeSeconds\":25.092,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nIndex Scan using idx_fec_state_date on silver_fec_efiling_itemizations  (cost=0.42..8.48 rows=1 width=164) (actual time=3.323..25.688 rows=9 loops=1)\\n  Index Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text))\\n  Filter: ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text)\\n  Rows Removed by Filter: 4145\\n  Buffers: shared hit=1780 read=2398 written=2220\\nPlanning:\\n  Buffers: shared hit=72 read=5\\nPlanning Time: 0.492 ms\\nExecution Time: 25.715 ms\",\"runtimeDurationMs\":32,\"rowsAreCapped\":false,\"computeSeconds\":25.092}],\"workerId\":\"4849ac30-9f87-436f-b558-7742f00729cf\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0\"}",
      "isError": false,
      "caption": "The lure, reproduced: with the trigram GIN present, the planner picks the (state, date) expression btree at rows=1 anyway",
      "planCaptions": {
        "1M": "The lure, reproduced. With the trigram GIN sitting right there, the planner picks the (state, date) expression btree at an estimated rows=1, fetches 4,154 rows, and discards 4,145 of them. Execution Time 25.715 ms across 4,178 buffers."
      }
    },
    "trgmAloneRun": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "-- Portable no-op on standard Postgres; appends the schema ExoBench installs extensions into\nSELECT set_config('search_path', current_setting('search_path') || ',extensions', false);\n\nCREATE TABLE silver_fec_efiling_itemizations (\n  id          bigint PRIMARY KEY,\n  record_type text,\n  record_data jsonb\n);\n\nINSERT INTO silver_fec_efiling_itemizations (id, record_type, record_data)\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  jsonb_build_object(\n    'form_type', 'SA11AI',\n    'filer_committee_id_number', 'C00' || lpad(((random()*99999)::int)::text, 6, '0'),\n    'transaction_id', 'SA11AI.' || i,\n    'entity_type', CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n    'contributor_organization_name', '',\n    'contributor_last_name', (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n    'contributor_first_name', (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n    'contributor_middle_name', '',\n    'contributor_street_1', ((random()*9999)::int)::text || ' MAIN STREET',\n    'contributor_city', (ARRAY['BALTIMORE','BETHESDA','ROCKVILLE','SILVER SPRING','ANNAPOLIS','COLUMBIA','FREDERICK','GAITHERSBURG','TOWSON','BOWIE'])[(random()*9)::int+1],\n    'contributor_state', (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n    'contributor_zip_code', lpad(((random()*99999)::int)::text, 5, '0'),\n    'election_code', 'P2026',\n    'contribution_date', to_char('2023-01-01'::timestamp + (random() * 1300 * interval '1 day'), 'YYYY-MM-DD\"T\"HH24:MI:SS'),\n    'contribution_amount', round((random()*2900)::numeric, 2),\n    'contribution_aggregate', round((random()*5800)::numeric, 2),\n    'contribution_purpose_descrip', 'CONTRIBUTION',\n    'contributor_employer', CASE WHEN random() < 0.0015\n         THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n         ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n              || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n       END,\n    'contributor_occupation', (ARRAY['ENGINEER','ATTORNEY','PHYSICIAN','TEACHER','CONSULTANT','EXECUTIVE','RETIRED','ANALYST','MANAGER','SALES'])[(random()*9)::int+1],\n    'memo_code', '',\n    'memo_text_description', 'EARMARKED CONTRIBUTION REPORTED ON LINE 11AI',\n    'image_number', ((random()*999999999999999)::bigint)::text,\n    'file_number', ((random()*9999999)::int)::text,\n    'sub_id', ((random()*9999999999)::bigint)::text\n  )\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_record_type ON silver_fec_efiling_itemizations (record_type);\n\nCREATE INDEX idx_fec_employer_trgm ON silver_fec_efiling_itemizations\n  USING gin ((record_data->>'contributor_employer') gin_trgm_ops)\n  WHERE record_type = 'Schedule A' AND record_data->>'entity_type' = 'IND';\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  record_data->>'contributor_first_name' AS first_name,\n  record_data->>'contributor_last_name'  AS last_name,\n  record_data->>'contributor_state'      AS state,\n  record_data->>'contributor_employer'   AS employer,\n  (record_data->>'contribution_amount')::numeric AS amount,\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\nFROM silver_fec_efiling_itemizations\nWHERE record_type = 'Schedule A'\n  AND record_data->>'entity_type' = 'IND'\n  AND record_data->>'contributor_state' = 'MD'\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\n  AND record_data->>'contribution_date' >= '2025-01-01'\n  AND record_data->>'contribution_date' <  '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 1000000
          }
        ],
        "databaseType": "POSTGRES",
        "compression": "original",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-14T16:41:30.988435232Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  record_data->>'contributor_first_name' AS first_name,\\n  record_data->>'contributor_last_name'  AS last_name,\\n  record_data->>'contributor_state'      AS state,\\n  record_data->>'contributor_employer'   AS employer,\\n  (record_data->>'contribution_amount')::numeric AS amount,\\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\\nFROM silver_fec_efiling_itemizations\\nWHERE record_type = 'Schedule A'\\n  AND record_data->>'entity_type' = 'IND'\\n  AND record_data->>'contributor_state' = 'MD'\\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\\n  AND record_data->>'contribution_date' >= '2025-01-01'\\n  AND record_data->>'contribution_date' <  '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":1,\"totalComputeSeconds\":23.971,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on silver_fec_efiling_itemizations  (cost=373.33..377.40 rows=1 width=164) (actual time=1.332..6.432 rows=5 loops=1)\\n  Recheck Cond: (((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text) AND (record_type = 'Schedule A'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text))\\n  Filter: (((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'contributor_state'::text) = 'MD'::text))\\n  Rows Removed by Filter: 1077\\n  Heap Blocks: exact=1080\\n  Buffers: shared hit=495 read=609 written=476\\n  ->  Bitmap Index Scan on idx_fec_employer_trgm  (cost=0.00..373.33 rows=1 width=0) (actual time=0.347..0.347 rows=1082 loops=1)\\n        Index Cond: ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text)\\n        Buffers: shared hit=24\\nPlanning:\\n  Buffers: shared hit=54 read=7\\nPlanning Time: 0.276 ms\\nExecution Time: 6.474 ms\",\"runtimeDurationMs\":9,\"rowsAreCapped\":false,\"computeSeconds\":23.971}],\"workerId\":\"44845fd6-3138-4ae0-8b87-d64ba616616a\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0\"}",
      "isError": false,
      "caption": "The partial trigram GIN alone: fast, but the heap work is the nationwide MICROSOFT population",
      "planCaptions": {
        "1M": "Bitmap Heap Scan fed by the partial trigram GIN alone. The index hands back every MICROSOFT row it covers, 1,082 against an estimate of 1, and the heap filter discards 1,077 of them across 1,080 blocks. Execution Time 6.474 ms."
      }
    },
    "pairHeldSilver": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE EXTENSION IF NOT EXISTS pg_trgm;\n\nCREATE TABLE silver_fec_efiling_itemizations (\n  id          bigint PRIMARY KEY,\n  record_type text,\n  record_data jsonb\n);\n\nINSERT INTO silver_fec_efiling_itemizations (id, record_type, record_data)\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  jsonb_build_object(\n    'form_type', 'SA11AI',\n    'filer_committee_id_number', 'C00' || lpad(((random()*99999)::int)::text, 6, '0'),\n    'transaction_id', 'SA11AI.' || i,\n    'entity_type', CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n    'contributor_organization_name', '',\n    'contributor_last_name', (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n    'contributor_first_name', (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n    'contributor_middle_name', '',\n    'contributor_street_1', ((random()*9999)::int)::text || ' MAIN STREET',\n    'contributor_city', (ARRAY['BALTIMORE','BETHESDA','ROCKVILLE','SILVER SPRING','ANNAPOLIS','COLUMBIA','FREDERICK','GAITHERSBURG','TOWSON','BOWIE'])[(random()*9)::int+1],\n    'contributor_state', (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n    'contributor_zip_code', lpad(((random()*99999)::int)::text, 5, '0'),\n    'election_code', 'P2026',\n    'contribution_date', to_char('2023-01-01'::timestamp + (random() * 1300 * interval '1 day'), 'YYYY-MM-DD\"T\"HH24:MI:SS'),\n    'contribution_amount', round((random()*2900)::numeric, 2),\n    'contribution_aggregate', round((random()*5800)::numeric, 2),\n    'contribution_purpose_descrip', 'CONTRIBUTION',\n    'contributor_employer', CASE WHEN random() < 0.0015\n         THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n         ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n              || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n       END,\n    'contributor_occupation', (ARRAY['ENGINEER','ATTORNEY','PHYSICIAN','TEACHER','CONSULTANT','EXECUTIVE','RETIRED','ANALYST','MANAGER','SALES'])[(random()*9)::int+1],\n    'memo_code', '',\n    'memo_text_description', 'EARMARKED CONTRIBUTION REPORTED ON LINE 11AI',\n    'image_number', ((random()*999999999999999)::bigint)::text,\n    'file_number', ((random()*9999999)::int)::text,\n    'sub_id', ((random()*9999999999)::bigint)::text\n  )\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_record_type ON silver_fec_efiling_itemizations (record_type);\n\n-- THE OTHER AGENT'S EXACT PROPOSAL\nCREATE INDEX idx_emp_trgm ON silver_fec_efiling_itemizations\n  USING gin ((record_data->>'contributor_employer') gin_trgm_ops);\n\nCREATE INDEX idx_state ON silver_fec_efiling_itemizations\n  ((record_data->>'contributor_state'));\n\nCREATE INDEX idx_date ON silver_fec_efiling_itemizations\n  ((record_data->>'contribution_date'));\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  record_data->>'contributor_first_name' AS first_name,\n  record_data->>'contributor_last_name'  AS last_name,\n  record_data->>'contributor_state'      AS state,\n  record_data->>'contributor_employer'   AS employer,\n  (record_data->>'contribution_amount')::numeric AS amount,\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\nFROM silver_fec_efiling_itemizations\nWHERE record_type = 'Schedule A'\n  AND record_data->>'entity_type' = 'IND'\n  AND record_data->>'contributor_state' = 'MD'\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\n  AND record_data->>'contribution_date' >= '2025-01-01'\n  AND record_data->>'contribution_date' <  '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 1000000
          },
          {
            "SCALE": 2900000
          }
        ],
        "databaseType": "POSTGRES",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-12T20:13:46.315795945Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  record_data->>'contributor_first_name' AS first_name,\\n  record_data->>'contributor_last_name'  AS last_name,\\n  record_data->>'contributor_state'      AS state,\\n  record_data->>'contributor_employer'   AS employer,\\n  (record_data->>'contribution_amount')::numeric AS amount,\\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\\nFROM silver_fec_efiling_itemizations\\nWHERE record_type = 'Schedule A'\\n  AND record_data->>'entity_type' = 'IND'\\n  AND record_data->>'contributor_state' = 'MD'\\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\\n  AND record_data->>'contribution_date' >= '2025-01-01'\\n  AND record_data->>'contribution_date' <  '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":98.43599999999999,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on silver_fec_efiling_itemizations  (cost=680.17..684.24 rows=1 width=164) (actual time=2.659..2.754 rows=6 loops=1)\\n  Recheck Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n  Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text))\\n  Rows Removed by Filter: 28\\n  Heap Blocks: exact=34\\n  Buffers: shared hit=42 read=38\\n  ->  BitmapAnd  (cost=680.17..680.17 rows=1 width=0) (actual time=2.512..2.513 rows=0 loops=1)\\n        Buffers: shared hit=26 read=20\\n        ->  Bitmap Index Scan on idx_state  (cost=0.00..211.42 rows=19066 width=0) (actual time=1.350..1.351 rows=20505 loops=1)\\n              Index Cond: ((record_data ->> 'contributor_state'::text) = 'MD'::text)\\n              Buffers: shared read=20\\n        ->  Bitmap Index Scan on idx_emp_trgm  (cost=0.00..468.50 rows=59 width=0) (actual time=0.513..0.513 rows=1502 loops=1)\\n              Index Cond: ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=26\\nPlanning:\\n  Buffers: shared hit=82 read=5\\nPlanning Time: 0.367 ms\\nExecution Time: 2.793 ms\",\"runtimeDurationMs\":11,\"rowsAreCapped\":false,\"computeSeconds\":26.779},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2900000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on silver_fec_efiling_itemizations  (cost=1968.48..3360.68 rows=1 width=164) (actual time=8.606..9.235 rows=24 loops=1)\\n  Recheck Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n  Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text))\\n  Rows Removed by Filter: 80\\n  Heap Blocks: exact=104\\n  Buffers: shared hit=66 read=154 written=23\\n  ->  BitmapAnd  (cost=1968.48..1968.48 rows=353 width=0) (actual time=8.201..8.202 rows=0 loops=1)\\n        Buffers: shared hit=56 read=60\\n        ->  Bitmap Index Scan on idx_state  (cost=0.00..651.02 rows=59545 width=0) (actual time=5.161..5.161 rows=59439 loops=1)\\n              Index Cond: ((record_data ->> 'contributor_state'::text) = 'MD'::text)\\n              Buffers: shared read=53\\n        ->  Bitmap Index Scan on idx_emp_trgm  (cost=0.00..1317.21 rows=17176 width=0) (actual time=1.374..1.374 rows=4381 loops=1)\\n              Index Cond: ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=56 read=7\\nPlanning:\\n  Buffers: shared hit=82 read=5\\nPlanning Time: 0.371 ms\\nExecution Time: 9.275 ms\",\"runtimeDurationMs\":16,\"rowsAreCapped\":false,\"computeSeconds\":71.657}],\"workerId\":\"50d0d030-6c67-4d68-9d7c-1a6e67d1d244\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0\"}",
      "isError": false,
      "caption": "The other agent's exact proposal on the JSONB table: the BitmapAnd held at 1M and 2.9M, on a 4x over-estimate at the top end",
      "planCaptions": {
        "1M": "The other agent's exact proposal on the JSONB table. BitmapAnd of idx_state (19,066 est, 20,505 actual) and idx_emp_trgm (59 est, 1,502 actual), 34 heap blocks. Execution Time 2.793 ms.",
        "2.9M": "Same call at 2.9M: the BitmapAnd held. idx_state 59,545 est against 59,439 actual, idx_emp_trgm 17,176 est against 4,381 actual, 4x high, the lucky direction. 104 heap blocks. Execution Time 9.275 ms."
      }
    },
    "controlBreak": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE EXTENSION IF NOT EXISTS pg_trgm;\n\nCREATE TABLE fec_filing_lineitems (\n  id                     bigint PRIMARY KEY,\n  schedule_code          text,\n  entity_type            text,\n  entity_state           text,\n  contributor_first_name text,\n  contributor_last_name  text,\n  contributor_employer   text,\n  contribution_amount    numeric,\n  transaction_date       date\n);\n\nINSERT INTO fec_filing_lineitems\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n  (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n  (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n  (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n  CASE WHEN random() < 0.0015\n     THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n     ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n          || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n   END,\n  round((random()*2900)::numeric, 2),\n  ('2023-01-01'::date + (random() * 1300)::int)\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_li_emp_trgm ON fec_filing_lineitems USING gin (contributor_employer gin_trgm_ops);\nCREATE INDEX idx_li_state ON fec_filing_lineitems (entity_state);\nCREATE INDEX idx_li_date  ON fec_filing_lineitems (transaction_date);\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  contributor_first_name AS first_name,\n  contributor_last_name  AS last_name,\n  entity_state           AS state,\n  contributor_employer   AS employer,\n  contribution_amount    AS amount,\n  transaction_date       AS contribution_date\nFROM fec_filing_lineitems\nWHERE schedule_code = 'Schedule A'\n  AND entity_type   = 'IND'\n  AND entity_state  = 'MD'\n  AND contributor_employer ILIKE '%MICROSOFT%'\n  AND transaction_date >= DATE '2025-01-01'\n  AND transaction_date <  DATE '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 1000000
          },
          {
            "SCALE": 2900000
          }
        ],
        "databaseType": "POSTGRES",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-12T20:16:59.162324789Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  contributor_first_name AS first_name,\\n  contributor_last_name  AS last_name,\\n  entity_state           AS state,\\n  contributor_employer   AS employer,\\n  contribution_amount    AS amount,\\n  transaction_date       AS contribution_date\\nFROM fec_filing_lineitems\\nWHERE schedule_code = 'Schedule A'\\n  AND entity_type   = 'IND'\\n  AND entity_state  = 'MD'\\n  AND contributor_employer ILIKE '%MICROSOFT%'\\n  AND transaction_date >= DATE '2025-01-01'\\n  AND transaction_date <  DATE '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":28.45,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=575.60..1005.27 rows=23 width=44) (actual time=1.829..1.876 rows=6 loops=1)\\n  Recheck Cond: ((entity_state = 'MD'::text) AND (contributor_employer ~~* '%MICROSOFT%'::text))\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text))\\n  Rows Removed by Filter: 21\\n  Heap Blocks: exact=27\\n  Buffers: shared hit=49 read=20\\n  ->  BitmapAnd  (cost=575.60..575.60 rows=115 width=0) (actual time=1.790..1.791 rows=0 loops=1)\\n        Buffers: shared hit=22 read=20\\n        ->  Bitmap Index Scan on idx_li_state  (cost=0.00..213.68 rows=19367 width=0) (actual time=0.968..0.968 rows=20320 loops=1)\\n              Index Cond: (entity_state = 'MD'::text)\\n              Buffers: shared read=20\\n        ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..361.66 rows=5916 width=0) (actual time=0.467..0.467 rows=1499 loops=1)\\n              Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=22\\nPlanning:\\n  Buffers: shared hit=55\\nPlanning Time: 0.255 ms\\nExecution Time: 1.909 ms\",\"runtimeDurationMs\":6,\"rowsAreCapped\":false,\"computeSeconds\":7.465},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2900000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=856.81..1502.28 rows=1 width=44) (actual time=2.423..17.428 rows=22 loops=1)\\n  Recheck Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text) AND (entity_state = 'MD'::text))\\n  Rows Removed by Filter: 4398\\n  Heap Blocks: exact=4176\\n  Buffers: shared hit=4229\\n  ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..856.80 rows=169 width=0) (actual time=1.481..1.481 rows=4420 loops=1)\\n        Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n        Buffers: shared hit=53\\nPlanning:\\n  Buffers: shared hit=75\\nPlanning Time: 0.325 ms\\nExecution Time: 17.786 ms\",\"runtimeDurationMs\":22,\"rowsAreCapped\":false,\"computeSeconds\":20.985}],\"workerId\":\"33dd1a45-3f71-40c4-b66f-2b9645ae16b3\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0\"}",
      "isError": false,
      "caption": "The same index set on the plain-column control: BitmapAnd at 1M, gone at 2.9M, 27 heap blocks to 4,176",
      "planCaptions": {
        "1M": "The same three indexes on the plain-column control. BitmapAnd of idx_li_state (19,367 est, 20,320 actual) and idx_li_emp_trgm (5,916 est, 1,499 actual), 27 heap blocks. Execution Time 1.909 ms.",
        "2.9M": "Grown to 2.9M, the BitmapAnd is gone. The trigram estimate came in at 169 against 4,420 actual, the intersection priced as pointless, 4,176 heap blocks. Execution Time 17.786 ms."
      }
    },
    "flipRun": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE EXTENSION IF NOT EXISTS pg_trgm;\n\nCREATE TABLE fec_filing_lineitems (\n  id                     bigint PRIMARY KEY,\n  schedule_code          text,\n  entity_type            text,\n  entity_state           text,\n  contributor_first_name text,\n  contributor_last_name  text,\n  contributor_employer   text,\n  contribution_amount    numeric,\n  transaction_date       date\n);\n\nINSERT INTO fec_filing_lineitems\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n  (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n  (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n  (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n  CASE WHEN random() < 0.0015\n     THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n     ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n          || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n   END,\n  round((random()*2900)::numeric, 2),\n  ('2023-01-01'::date + (random() * 1300)::int)\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_li_emp_trgm ON fec_filing_lineitems USING gin (contributor_employer gin_trgm_ops);\nCREATE INDEX idx_li_state ON fec_filing_lineitems (entity_state);\nCREATE INDEX idx_li_date  ON fec_filing_lineitems (transaction_date);\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  contributor_first_name AS first_name,\n  contributor_last_name  AS last_name,\n  entity_state           AS state,\n  contributor_employer   AS employer,\n  contribution_amount    AS amount,\n  transaction_date       AS contribution_date\nFROM fec_filing_lineitems\nWHERE schedule_code = 'Schedule A'\n  AND entity_type   = 'IND'\n  AND entity_state  = 'MD'\n  AND contributor_employer ILIKE '%MICROSOFT%'\n  AND transaction_date >= DATE '2025-01-01'\n  AND transaction_date <  DATE '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 2400000
          },
          {
            "SCALE": 2400000
          }
        ],
        "databaseType": "POSTGRES",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-12T21:51:49.160582747Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  contributor_first_name AS first_name,\\n  contributor_last_name  AS last_name,\\n  entity_state           AS state,\\n  contributor_employer   AS employer,\\n  contribution_amount    AS amount,\\n  transaction_date       AS contribution_date\\nFROM fec_filing_lineitems\\nWHERE schedule_code = 'Schedule A'\\n  AND entity_type   = 'IND'\\n  AND entity_state  = 'MD'\\n  AND contributor_employer ILIKE '%MICROSOFT%'\\n  AND transaction_date >= DATE '2025-01-01'\\n  AND transaction_date <  DATE '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":34.733,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2400000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=724.66..1263.08 rows=1 width=44) (actual time=1.670..6.821 rows=14 loops=1)\\n  Recheck Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text) AND (entity_state = 'MD'::text))\\n  Rows Removed by Filter: 3675\\n  Heap Blocks: exact=3449\\n  Buffers: shared hit=3498\\n  ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..724.66 rows=141 width=0) (actual time=1.102..1.103 rows=3689 loops=1)\\n        Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n        Buffers: shared hit=49\\nPlanning:\\n  Buffers: shared hit=55\\nPlanning Time: 0.256 ms\\nExecution Time: 6.856 ms\",\"runtimeDurationMs\":10,\"rowsAreCapped\":false,\"computeSeconds\":17.237},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2400000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=1231.62..1243.60 rows=1 width=44) (actual time=4.436..4.568 rows=19 loops=1)\\n  Recheck Cond: ((entity_state = 'MD'::text) AND (contributor_employer ~~* '%MICROSOFT%'::text))\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text))\\n  Rows Removed by Filter: 54\\n  Heap Blocks: exact=73\\n  Buffers: shared hit=122 read=44\\n  ->  BitmapAnd  (cost=1231.62..1231.62 rows=3 width=0) (actual time=4.377..4.378 rows=0 loops=1)\\n        Buffers: shared hit=49 read=44\\n        ->  Bitmap Index Scan on idx_li_state  (cost=0.00..510.83 rows=46720 width=0) (actual time=2.388..2.389 rows=49257 loops=1)\\n              Index Cond: (entity_state = 'MD'::text)\\n              Buffers: shared read=44\\n        ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..720.54 rows=141 width=0) (actual time=1.063..1.063 rows=3507 loops=1)\\n              Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=49\\nPlanning:\\n  Buffers: shared hit=57\\nPlanning Time: 0.266 ms\\nExecution Time: 4.604 ms\",\"runtimeDurationMs\":9,\"rowsAreCapped\":false,\"computeSeconds\":17.496}],\"workerId\":\"23e7f650-4db2-41fb-954b-790d8e1782e4\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0-dirty\"}",
      "isError": false,
      "caption": "Two independent 2.4M-row draws of the same schema: trigram-alone on the first, BitmapAnd on the second, priced 19 cost units apart",
      "planCaptions": {
        "2.4M#1": "First 2.4M-row draw. Bitmap Heap Scan fed by idx_li_emp_trgm alone, Recheck Cond is just the ILIKE, 3,449 heap blocks, 3,675 rows removed by filter. The trigram estimate was 141 against 3,689 actual. Execution Time 6.856 ms, total cost 1,263.08.",
        "2.4M#2": "Second 2.4M-row draw of the same generator. BitmapAnd of idx_li_state (46,720 est, 49,257 actual) and idx_li_emp_trgm (141 est, 3,507 actual), 73 heap blocks. Execution Time 4.604 ms, total cost 1,243.60, 19 units under the other plan."
      }
    },
    "rpcRun": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE EXTENSION IF NOT EXISTS pg_trgm;\n\nCREATE TABLE fec_filing_lineitems (\n  id                     bigint PRIMARY KEY,\n  schedule_code          text,\n  entity_type            text,\n  entity_state           text,\n  contributor_first_name text,\n  contributor_last_name  text,\n  contributor_employer   text,\n  contribution_amount    numeric,\n  transaction_date       date\n);\n\nINSERT INTO fec_filing_lineitems\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n  (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n  (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n  (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n  CASE WHEN random() < 0.0015\n     THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n     ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n          || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n   END,\n  round((random()*2900)::numeric, 2),\n  ('2023-01-01'::date + (random() * 1300)::int)\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_li_emp_trgm ON fec_filing_lineitems USING gin (contributor_employer gin_trgm_ops);\nCREATE INDEX idx_li_state ON fec_filing_lineitems (entity_state);\nCREATE INDEX idx_li_date  ON fec_filing_lineitems (transaction_date);\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  contributor_first_name AS first_name,\n  contributor_last_name  AS last_name,\n  entity_state           AS state,\n  contributor_employer   AS employer,\n  contribution_amount    AS amount,\n  transaction_date       AS contribution_date\nFROM fec_filing_lineitems\nWHERE schedule_code = 'Schedule A'\n  AND entity_type   = 'IND'\n  AND entity_state  = 'MD'\n  AND contributor_employer ILIKE '%MICROSOFT%'\n  AND transaction_date >= DATE '2025-01-01'\n  AND transaction_date <  DATE '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 2400000
          },
          {
            "SCALE": 2400000
          }
        ],
        "databaseType": "POSTGRES",
        "preBenchmarkSql": "SET random_page_cost = 10;",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-12T21:53:09.251313620Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  contributor_first_name AS first_name,\\n  contributor_last_name  AS last_name,\\n  entity_state           AS state,\\n  contributor_employer   AS employer,\\n  contribution_amount    AS amount,\\n  transaction_date       AS contribution_date\\nFROM fec_filing_lineitems\\nWHERE schedule_code = 'Schedule A'\\n  AND entity_type   = 'IND'\\n  AND entity_state  = 'MD'\\n  AND contributor_employer ILIKE '%MICROSOFT%'\\n  AND transaction_date >= DATE '2025-01-01'\\n  AND transaction_date <  DATE '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":34.900999999999996,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2400000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=2596.14..5123.92 rows=56 width=44) (actual time=4.592..4.797 rows=12 loops=1)\\n  Recheck Cond: ((entity_state = 'MD'::text) AND (contributor_employer ~~* '%MICROSOFT%'::text))\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text))\\n  Rows Removed by Filter: 55\\n  Heap Blocks: exact=67\\n  Buffers: shared hit=116 read=44\\n  ->  BitmapAnd  (cost=2596.14..2596.14 rows=277 width=0) (actual time=4.525..4.525 rows=0 loops=1)\\n        Buffers: shared hit=49 read=44\\n        ->  Bitmap Index Scan on idx_li_state  (cost=0.00..750.83 rows=46720 width=0) (actual time=2.365..2.365 rows=48669 loops=1)\\n              Index Cond: (entity_state = 'MD'::text)\\n              Buffers: shared read=44\\n        ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..1845.03 rows=14215 width=0) (actual time=1.120..1.120 rows=3619 loops=1)\\n              Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=49\\nPlanning:\\n  Buffers: shared hit=57\\nPlanning Time: 0.292 ms\\nExecution Time: 4.830 ms\",\"runtimeDurationMs\":10,\"rowsAreCapped\":false,\"computeSeconds\":17.323},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2400000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on fec_filing_lineitems  (cost=2558.34..2588.14 rows=1 width=44) (actual time=4.401..4.530 rows=17 loops=1)\\n  Recheck Cond: ((entity_state = 'MD'::text) AND (contributor_employer ~~* '%MICROSOFT%'::text))\\n  Filter: ((transaction_date >= '2025-01-01'::date) AND (transaction_date < '2026-01-01'::date) AND (schedule_code = 'Schedule A'::text) AND (entity_type = 'IND'::text))\\n  Rows Removed by Filter: 54\\n  Heap Blocks: exact=70\\n  Buffers: shared hit=119 read=44\\n  ->  BitmapAnd  (cost=2558.34..2558.34 rows=3 width=0) (actual time=4.338..4.339 rows=0 loops=1)\\n        Buffers: shared hit=49 read=44\\n        ->  Bitmap Index Scan on idx_li_state  (cost=0.00..783.43 rows=48400 width=0) (actual time=2.296..2.296 rows=48671 loops=1)\\n              Index Cond: (entity_state = 'MD'::text)\\n              Buffers: shared read=44\\n        ->  Bitmap Index Scan on idx_li_emp_trgm  (cost=0.00..1774.66 rows=140 width=0) (actual time=1.096..1.096 rows=3525 loops=1)\\n              Index Cond: (contributor_employer ~~* '%MICROSOFT%'::text)\\n              Buffers: shared hit=49\\nPlanning:\\n  Buffers: shared hit=55\\nPlanning Time: 0.268 ms\\nExecution Time: 4.562 ms\",\"runtimeDurationMs\":10,\"rowsAreCapped\":false,\"computeSeconds\":17.578}],\"workerId\":\"e180bbf1-5b30-4d48-a1ae-32a485c6d304\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0-dirty\"}",
      "isError": false,
      "caption": "The same pair of indexes with random_page_cost = 10: the BitmapAnd held on both draws, including the one where the trigram estimate came back 25x under",
      "planCaptions": {
        "2.4M#1": "random_page_cost = 10, first draw. BitmapAnd held even though the trigram estimate came back 14,215 against 3,619 actual, 4x high. 67 heap blocks, Execution Time 4.830 ms.",
        "2.4M#2": "random_page_cost = 10, second draw. BitmapAnd held again, this time with the trigram estimate at 140 against 3,525 actual, 25x low. 70 heap blocks, Execution Time 4.562 ms. Same plan shape as the first draw."
      }
    },
    "compositeGin": {
      "type": "mcp-call",
      "name": "benchmarkSql",
      "input": {
        "schemaTemplate": "CREATE EXTENSION IF NOT EXISTS pg_trgm;\nCREATE EXTENSION IF NOT EXISTS btree_gin;\n\nCREATE TABLE silver_fec_efiling_itemizations (\n  id          bigint PRIMARY KEY,\n  record_type text,\n  record_data jsonb\n);\n\nINSERT INTO silver_fec_efiling_itemizations (id, record_type, record_data)\nSELECT\n  i,\n  CASE WHEN random() < 0.80 THEN 'Schedule A'\n       WHEN random() < 0.50 THEN 'Schedule B'\n       ELSE 'Schedule E' END,\n  jsonb_build_object(\n    'form_type', 'SA11AI',\n    'filer_committee_id_number', 'C00' || lpad(((random()*99999)::int)::text, 6, '0'),\n    'transaction_id', 'SA11AI.' || i,\n    'entity_type', CASE WHEN random() < 0.90 THEN 'IND' WHEN random() < 0.5 THEN 'ORG' ELSE 'PAC' END,\n    'contributor_organization_name', '',\n    'contributor_last_name', (ARRAY['SMITH','JOHNSON','WILLIAMS','BROWN','JONES','GARCIA','MILLER','DAVIS','RODRIGUEZ','MARTINEZ','HERNANDEZ','LOPEZ','GONZALEZ','WILSON','ANDERSON','THOMAS','TAYLOR','MOORE','JACKSON','MARTIN'])[(random()*19)::int+1],\n    'contributor_first_name', (ARRAY['JAMES','MARY','ROBERT','PATRICIA','JOHN','JENNIFER','MICHAEL','LINDA','DAVID','ELIZABETH','WILLIAM','BARBARA','RICHARD','SUSAN','JOSEPH','JESSICA','THOMAS','SARAH','CHARLES','KAREN'])[(random()*19)::int+1],\n    'contributor_middle_name', '',\n    'contributor_street_1', ((random()*9999)::int)::text || ' MAIN STREET',\n    'contributor_city', (ARRAY['BALTIMORE','BETHESDA','ROCKVILLE','SILVER SPRING','ANNAPOLIS','COLUMBIA','FREDERICK','GAITHERSBURG','TOWSON','BOWIE'])[(random()*9)::int+1],\n    'contributor_state', (ARRAY['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'])[(random()*49)::int+1],\n    'contributor_zip_code', lpad(((random()*99999)::int)::text, 5, '0'),\n    'election_code', 'P2026',\n    'contribution_date', to_char('2023-01-01'::timestamp + (random() * 1300 * interval '1 day'), 'YYYY-MM-DD\"T\"HH24:MI:SS'),\n    'contribution_amount', round((random()*2900)::numeric, 2),\n    'contribution_aggregate', round((random()*5800)::numeric, 2),\n    'contribution_purpose_descrip', 'CONTRIBUTION',\n    'contributor_employer', CASE WHEN random() < 0.0015\n         THEN (ARRAY['MICROSOFT','MICROSOFT CORPORATION','MICROSOFT CORP'])[(random()*2)::int+1]\n         ELSE (ARRAY['ACME','GLOBEX','INITECH','UMBRELLA','STARK','WAYNE','TYRELL','SOYLENT','MASSIVE','VANDELAY','HOOLI','CYBERDYNE','OSCORP','ABSTERGO','APERTURE','WEYLAND','NAKATOMI','SABRE','LUMON','ENCOM','RETIRED','NOT EMPLOYED','SELF EMPLOYED','NORTHROP','LOCKHEED','JOHNS HOPKINS','MARRIOTT','UNDER ARMOUR','T ROWE PRICE','MCCORMICK'])[(random()*29)::int+1]\n              || ' ' || (ARRAY['INC','LLC','CORPORATION','GROUP','HOLDINGS','SYSTEMS','TECHNOLOGIES','PARTNERS','SERVICES','INTERNATIONAL'])[(random()*9)::int+1]\n       END,\n    'contributor_occupation', (ARRAY['ENGINEER','ATTORNEY','PHYSICIAN','TEACHER','CONSULTANT','EXECUTIVE','RETIRED','ANALYST','MANAGER','SALES'])[(random()*9)::int+1],\n    'memo_code', '',\n    'memo_text_description', 'EARMARKED CONTRIBUTION REPORTED ON LINE 11AI',\n    'image_number', ((random()*999999999999999)::bigint)::text,\n    'file_number', ((random()*9999999)::int)::text,\n    'sub_id', ((random()*9999999999)::bigint)::text\n  )\nFROM generate_series(1, ${SCALE}) i;\n\nCREATE INDEX idx_record_type ON silver_fec_efiling_itemizations (record_type);\n\n-- SINGLE multicolumn GIN: btree_gin for state equality + pg_trgm for employer ILIKE\nCREATE INDEX idx_fec_multi_gin ON silver_fec_efiling_itemizations\n  USING gin (\n    (record_data->>'contributor_state'),\n    (record_data->>'contributor_employer') gin_trgm_ops\n  );\n\nVACUUM ANALYZE;",
        "query": "EXPLAIN (ANALYZE, BUFFERS) SELECT\n  record_data->>'contributor_first_name' AS first_name,\n  record_data->>'contributor_last_name'  AS last_name,\n  record_data->>'contributor_state'      AS state,\n  record_data->>'contributor_employer'   AS employer,\n  (record_data->>'contribution_amount')::numeric AS amount,\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\nFROM silver_fec_efiling_itemizations\nWHERE record_type = 'Schedule A'\n  AND record_data->>'entity_type' = 'IND'\n  AND record_data->>'contributor_state' = 'MD'\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\n  AND record_data->>'contribution_date' >= '2025-01-01'\n  AND record_data->>'contribution_date' <  '2026-01-01'",
        "scalePoints": [
          {
            "SCALE": 1000000
          },
          {
            "SCALE": 2900000
          }
        ],
        "databaseType": "POSTGRES",
        "correlationId": "0daa96e9-52fa-495e-884b-89c857b08233",
        "exobenchServerVersion": "1.4.0"
      },
      "result": "{\"timestamp\":\"2026-08-12T21:42:41.801693786Z\",\"databaseType\":\"postgres\",\"sql\":\"EXPLAIN (ANALYZE, BUFFERS) SELECT\\n  record_data->>'contributor_first_name' AS first_name,\\n  record_data->>'contributor_last_name'  AS last_name,\\n  record_data->>'contributor_state'      AS state,\\n  record_data->>'contributor_employer'   AS employer,\\n  (record_data->>'contribution_amount')::numeric AS amount,\\n  LEFT(record_data->>'contribution_date',10)::date AS contribution_date\\nFROM silver_fec_efiling_itemizations\\nWHERE record_type = 'Schedule A'\\n  AND record_data->>'entity_type' = 'IND'\\n  AND record_data->>'contributor_state' = 'MD'\\n  AND record_data->>'contributor_employer' ILIKE '%MICROSOFT%'\\n  AND record_data->>'contribution_date' >= '2025-01-01'\\n  AND record_data->>'contribution_date' <  '2026-01-01'\",\"warmCacheIterations\":0,\"scalePointCount\":2,\"totalComputeSeconds\":96.40100000000001,\"results\":[{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":1000000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on silver_fec_efiling_itemizations  (cost=497.41..501.47 rows=1 width=164) (actual time=0.653..0.721 rows=2 loops=1)\\n  Recheck Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n  Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text))\\n  Rows Removed by Filter: 28\\n  Heap Blocks: exact=30\\n  Buffers: shared hit=55 read=15\\n  ->  Bitmap Index Scan on idx_fec_multi_gin  (cost=0.00..497.41 rows=1 width=0) (actual time=0.559..0.560 rows=30 loops=1)\\n        Index Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n        Buffers: shared hit=40\\nPlanning:\\n  Buffers: shared hit=67 read=5 dirtied=1\\nPlanning Time: 0.924 ms\\nExecution Time: 0.760 ms\",\"runtimeDurationMs\":11,\"rowsAreCapped\":false,\"computeSeconds\":27.055},{\"kind\":\"postgres_explain_analyze\",\"scalePoint\":{\"SCALE\":2900000},\"output\":\"QUERY PLAN\\nBitmap Heap Scan on silver_fec_efiling_itemizations  (cost=1293.54..1305.66 rows=1 width=164) (actual time=1.846..11.453 rows=22 loops=1)\\n  Recheck Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n  Filter: ((record_type = 'Schedule A'::text) AND ((record_data ->> 'contribution_date'::text) >= '2025-01-01'::text) AND ((record_data ->> 'contribution_date'::text) < '2026-01-01'::text) AND ((record_data ->> 'entity_type'::text) = 'IND'::text))\\n  Rows Removed by Filter: 68\\n  Heap Blocks: exact=90\\n  Buffers: shared hit=112 read=77\\n  ->  Bitmap Index Scan on idx_fec_multi_gin  (cost=0.00..1293.54 rows=3 width=0) (actual time=1.642..1.643 rows=90 loops=1)\\n        Index Cond: (((record_data ->> 'contributor_state'::text) = 'MD'::text) AND ((record_data ->> 'contributor_employer'::text) ~~* '%MICROSOFT%'::text))\\n        Buffers: shared hit=99\\nPlanning:\\n  Buffers: shared hit=69 read=2\\nPlanning Time: 0.344 ms\\nExecution Time: 11.503 ms\",\"runtimeDurationMs\":18,\"rowsAreCapped\":false,\"computeSeconds\":69.346}],\"workerId\":\"ddc30106-a378-4124-b232-314e7a8175e3\",\"correlationId\":\"0daa96e9-52fa-495e-884b-89c857b08233\",\"correlationIdInstruction\":\"Echo correlationId on subsequent ExoBench tool calls. Tracking only \u2014 it does NOT preserve DB state.\",\"version\":\"1.4.0-dirty\"}",
      "isError": false,
      "caption": "The composite btree_gin + pg_trgm index on the JSONB table: one Bitmap Index Scan, both predicates in the Index Cond, at 1M and 2.9M rows",
      "planCaptions": {
        "1M": "Composite btree_gin + pg_trgm on the JSONB table at 1M rows. One Bitmap Index Scan on idx_fec_multi_gin, both predicates in the Index Cond, 30 heap blocks. Index scan 0.559 ms, Execution Time 0.760 ms.",
        "2.9M": "Same composite GIN at 2.9M rows, same plan shape: one Bitmap Index Scan, both predicates in the Index Cond, 90 heap blocks. Index scan 1.642 ms. Execution Time 11.503 ms is mostly cold reads, 77 of 189 buffers off disk."
      }
    },
    "stabilityChart": {
      "type": "chart",
      "chartType": "multi-line",
      "scales": [
        "1M rows",
        "2.9M rows"
      ],
      "xLabel": "Table size",
      "yLabel": "Heap blocks touched",
      "yUnit": "blocks",
      "maxY": 4500,
      "caption": "Heap blocks touched as the table grows. Two index shapes crawl along the floor. The red line is the identical two-index pair on the control table after one growth step convinced the planner to drop the BitmapAnd: 27 blocks to 4,176.",
      "summaryCaption": "Two index shapes hold near the floor from 1M to 2.9M rows: the pair on the JSONB table (34 to 104 heap blocks) and the composite (30 to 90). The identical pair on the control table flipped plans at 2.9M and went from 27 blocks to 4,176.",
      "dataAsProse": "Two indexes on the JSONB table (held): 34 heap blocks at 1M rows, 104 at 2.9M. Two indexes on the plain-column control (flipped when grown): 27 at 1M, 4,176 at 2.9M. Composite btree_gin: 30 at 1M, 90 at 2.9M.",
      "series": [
        {
          "label": "Two indexes, JSONB table (held)",
          "data": [
            34,
            104
          ],
          "color": "#BA7517",
          "pointStyle": "triangle"
        },
        {
          "label": "Two indexes, control (flipped when grown)",
          "data": [
            27,
            4176
          ],
          "color": "#E24B4A",
          "style": "dashed",
          "pointStyle": "rectRot"
        },
        {
          "label": "Composite btree_gin",
          "data": [
            30,
            90
          ],
          "color": "#1D9E75",
          "fill": true,
          "pointStyle": "circle"
        }
      ]
    }
  }
}
