Real T3 Code server: status-filtered turn-item read comparison
Linux x86_64; Node v26.13.1; same machine; separate commit checkouts and synthetic state.
Actual action: MCP t3_thread_interrupt(parent, stop=true), which inspects the long child thread while stopping a stale native task.
31,000 child items (~97.6 MiB text); nine active items; 31,000 unrelated padding items; ~3.33 GiB database.
The real-server read adds run_id IS NULL selection to the reported status filter. The exact status-only service comparison is provided separately.
Warm: one discarded action then 15 measured actions. Cold: seven fresh server processes per commit, alternating commit order; own-DB file-cache eviction requested after startup and fixture preparation.
Each action returned the same nine ordered child payloads; each parent task ended interrupted.
The query timer runs in the actual production SQLite worker; the full MCP timer covers tools.call request/response.

BASE 90fc3e900b3d839d0be2fc5b49e60b71a52b9c61
Linux x86_64; Node v26.13.1; same machine, sequential measurements
Same action and synthetic fixture on both commits.

WARM — Status-filtered read:
Samples (ms): 40.835, 29.525, 29.690, 37.289, 29.175, 29.611, 37.794, 29.364, 28.625, 29.906, 37.599, 40.355, 29.332, 28.962, 36.413
Median 29.690 ms; range 28.625-40.835; spread 12.209 ms

WARM — Full MCP Stop action:
Samples (ms): 87.959, 53.672, 56.642, 65.580, 57.943, 55.640, 61.306, 52.887, 52.074, 50.643, 77.017, 81.301, 52.178, 46.285, 56.618
Median 56.618 ms; range 46.285-87.959; spread 41.673 ms

COLD — Status-filtered read:
Samples (ms): 3559.340, 4053.447, 3854.909, 2945.658, 2894.132, 2929.381, 2952.779
Median 2952.779 ms; range 2894.132-4053.447; spread 1159.316 ms

COLD — Full MCP Stop action:
Samples (ms): 3624.313, 4110.095, 3948.031, 3019.221, 2959.396, 2995.945, 3022.007
Median 3022.007 ms; range 2959.396-4110.095; spread 1150.700 ms

Read rows: 9
Ordinals: [3100, 6200, 9300, 12400, 15500, 18600, 21700, 24800, 27900]
Full ordered payload SHA256: ca4a8fce7a91419de2b73a40de38c57bdf57b0a47d47b7eed8717cfd5cf7ceef
All parent task outcomes: interrupted
MCP result: no_active_run (the completed parent has no active root run; Stop still interrupts the stale native task).
Actual query plan:
SEARCH orchestration_v2_projection_turn_items USING INDEX orchestration_v2_projection_turn_items_thread_ordinal_idx (thread_id=?)
LIST SUBQUERY 1
SCAN json_each VIRTUAL TABLE INDEX 1:
LIST SUBQUERY 2
SCAN json_each VIRTUAL TABLE INDEX 1:

Actual SQL:

                SELECT payload_json
                FROM orchestration_v2_projection_turn_items
                WHERE 
      thread_id = ?
        
        
        AND status IN (SELECT value FROM json_each(?))
        
        
        AND (run_id IN (SELECT value FROM json_each(?)) OR (? = 1 AND run_id IS NULL))
    
                ORDER BY ordinal ASC, turn_item_id ASC
              
Bindings: ["thread:perf-proof", "[\"pending\",\"running\",\"waiting\"]", "[]", 1]

HEAD 1afd5cb2123eda0364897765ff8391d8aadc613f
Linux x86_64; Node v26.13.1; same machine, sequential measurements
Same action and synthetic fixture on both commits.

WARM — Status-filtered read:
Samples (ms): 1.933, 1.835, 1.816, 1.911, 2.044, 1.824, 1.846, 1.839, 1.998, 1.888, 1.844, 1.940, 1.882, 1.907, 1.993
Median 1.888 ms; range 1.816-2.044; spread 0.228 ms

WARM — Full MCP Stop action:
Samples (ms): 33.634, 21.995, 18.292, 30.006, 25.399, 21.674, 30.194, 30.416, 22.417, 24.428, 19.642, 25.832, 28.882, 32.505, 23.691
Median 25.399 ms; range 18.292-33.634; spread 15.341 ms

COLD — Status-filtered read:
Samples (ms): 48.174, 42.473, 48.800, 38.136, 45.673, 48.166, 46.922
Median 46.922 ms; range 38.136-48.800; spread 10.665 ms

COLD — Full MCP Stop action:
Samples (ms): 133.880, 95.916, 117.845, 101.504, 99.490, 114.537, 113.020
Median 113.020 ms; range 95.916-133.880; spread 37.964 ms

Read rows: 9
Ordinals: [3100, 6200, 9300, 12400, 15500, 18600, 21700, 24800, 27900]
Full ordered payload SHA256: ca4a8fce7a91419de2b73a40de38c57bdf57b0a47d47b7eed8717cfd5cf7ceef
All parent task outcomes: interrupted
MCP result: no_active_run (the completed parent has no active root run; Stop still interrupts the stale native task).
Actual query plan:
SEARCH orchestration_v2_projection_turn_items USING INTEGER PRIMARY KEY (rowid=?)
LIST SUBQUERY 3
SEARCH orchestration_v2_projection_turn_items USING INDEX orchestration_v2_projection_turn_items_thread_type_idx (thread_id=?)
LIST SUBQUERY 1
SCAN json_each VIRTUAL TABLE INDEX 1:
LIST SUBQUERY 2
SCAN json_each VIRTUAL TABLE INDEX 1:
USE TEMP B-TREE FOR ORDER BY

Actual SQL:

                SELECT payload_json
                FROM orchestration_v2_projection_turn_items
                WHERE rowid IN (
                    SELECT rowid FROM orchestration_v2_projection_turn_items
                    WHERE 
      thread_id = ?
        
        
        AND status IN (SELECT value FROM json_each(?))
        
        
        AND (run_id IN (SELECT value FROM json_each(?)) OR (? = 1 AND run_id IS NULL))
    
                  )
                ORDER BY ordinal ASC, turn_item_id ASC
              
Bindings: ["thread:perf-proof", "[\"pending\",\"running\",\"waiting\"]", "[]", 1]

warm ms: 15.73x; median difference 27.802 ms; sum of spreads 12.438 ms.
warm actionMs: 2.23x; median difference 31.218 ms; sum of spreads 57.015 ms.
cold ms: 62.93x; median difference 2905.858 ms; sum of spreads 1169.980 ms.
cold actionMs: 26.74x; median difference 2908.987 ms; sum of spreads 1188.663 ms.
