Write a query to identify the top 10% of underperforming nodes based on transaction latency.
Treat a node's latency as the average of its non-null transaction latency values. Include only nodes with at least one valid latency measurement. Round the number of returned nodes up when 10% is fractional, and break ties by node_id ascending.
node_id, node_name, avg_latency_ms, and transaction_count.node_id.| Column | Type | Description |
|---|---|---|
| node_idPK | INT | Unique node identifier |
| node_name | VARCHAR(100) | Display name of the node |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| node_id | INT | Node that processed the transaction |
| latency_ms | INT | Transaction processing latency in milliseconds |
| recorded_at | TIMESTAMP | Time when the measurement was recorded |