File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
tycho-storage/migrations/2025-07-21_index_protocol_components Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ DROP INDEX IF EXISTS idx_protocol_system_id_external_id;
2+ DROP INDEX IF EXISTS idx_protocol_component_system_id;
Original file line number Diff line number Diff line change 1+ # Database Query Optimizations
2+
3+ ## 1. EntryPoint Query Optimization
4+
5+ - ** Purpose** : Speed up lookup queries on ` (protocol_system_id, external_id) ` for EntryPoint resolution.
6+ - ** Initial Execution Time** : 130ms
7+ - ** Optimized Execution Time** : 0.1ms
8+
9+ ** Index Added:**
10+
11+ ``` sql
12+ CREATE INDEX IF NOT EXISTS idx_protocol_system_id_external_id ON protocol_component (protocol_system_id, external_id);
13+ ```
14+
15+ ## 1. ProtocolComponent count Query Optimization
16+
17+ - ** Purpose** : Improve efficiency of count queries (e.g., for pagination) by filtering on protocol_system_id.
18+ - ** Initial Execution Time** : 100ms
19+ - ** Optimized Execution Time** : 50ms
20+
21+ ** Index Added:**
22+
23+ ``` sql
24+ CREATE INDEX idx_protocol_component_system_id ON protocol_component (protocol_system_id);
25+ ```
Original file line number Diff line number Diff line change 1+ CREATE INDEX IF NOT EXISTS idx_protocol_system_id_external_id ON protocol_component (protocol_system_id, external_id);
2+ CREATE INDEX idx_protocol_component_system_id ON protocol_component (protocol_system_id);
You can’t perform that action at this time.
0 commit comments