# Optimization PR Stack Handoff

## PR Stack (order of merge)

| PR | Title | Status |
|----|-------|--------|
| #231 | perf: Use `executemany` for SQLite batch inserts | Merged |
| #229 | perf: Batch term collection in indexing pipeline | Merged |
| #230 | perf: Batch SQLite INSERTs for indexing pipeline | Awaiting re-review |
| #232 | perf: Batch metadata query | Blocked on #230 |

## What was done in #230

- Addressed all 10 review comments from @bmerkle
- Deleted `text_range_from_location` (was identical to `text_range_from_message_chunk` from messageutils)
- Deleted `add_entity_to_index`, `add_action_to_index`, `add_topic_to_index` (duplicates of `add_entity`, `add_action`, `add_topic`)
- Updated all callers (tests) to use the unified functions directly
- Fixed pre-existing bug: `inverse_actions` were silently skipped in both the batch path (`add_metadata_to_index_from_list`) and the async iterator path (`add_metadata_to_index`)
- Moved inline imports to top-level in `sqlite/propindex.py` per AGENTS.md guidelines
- Summary comment posted on #230, heads-up comment posted on #232

## What's next

1. Wait for @bmerkle / @gvanrossum to re-review #230
2. Once #230 merges, rebase #232 (`perf/batch-metadata-query`) on `main` and resolve conflicts
   - #232 will have conflicts in `semrefindex.py` due to our function renames and deduplication
3. CI checks on #230 were still queued at last check — monitor for results
