explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AKT

Settings
# exclusive inclusive rows x rows loops node
1. 197.814 244,008.250 ↓ 434,075.7 1,302,227 1

Unique (cost=35,609.94..35,609.97 rows=3 width=38) (actual time=243,675.870..244,008.250 rows=1,302,227 loops=1)

2. 3,492.852 243,810.436 ↓ 434,075.7 1,302,227 1

Sort (cost=35,609.94..35,609.94 rows=3 width=38) (actual time=243,675.869..243,810.436 rows=1,302,227 loops=1)

  • Sort Key: a.alert_id, (rank() OVER (?)), sash.solution
  • Sort Method: external sort Disk: 65736kB
3. 652.187 240,317.584 ↓ 434,075.7 1,302,227 1

WindowAgg (cost=35,609.85..35,609.91 rows=3 width=38) (actual time=239,505.119..240,317.584 rows=1,302,227 loops=1)

4. 3,078.162 239,665.397 ↓ 434,075.7 1,302,227 1

Sort (cost=35,609.85..35,609.86 rows=3 width=30) (actual time=239,505.113..239,665.397 rows=1,302,227 loops=1)

  • Sort Key: a.alert_id, sash.solution_date DESC
  • Sort Method: external merge Disk: 52112kB
5. 414.978 236,587.235 ↓ 434,075.7 1,302,227 1

Nested Loop (cost=3,497.05..35,609.83 rows=3 width=30) (actual time=99.079..236,587.235 rows=1,302,227 loops=1)

6. 485.488 231,087.647 ↓ 508,461.0 508,461 1

Nested Loop Left Join (cost=3,496.50..35,608.80 rows=1 width=57) (actual time=99.054..231,087.647 rows=508,461 loops=1)

  • Filter: (((dtas.batch_type_id IS NOT NULL) AND (dtas.decision_tree_id = dt.decision_tree_id)) OR ((dta.batch_type_id IS NOT NULL) AND (dta.decision_tree_id = dt.decision_tree_id)))
7. 917.368 229,585.237 ↓ 508,461.0 508,461 1

Nested Loop Left Join (cost=3,496.36..35,608.63 rows=1 width=99) (actual time=99.046..229,585.237 rows=508,461 loops=1)

8. 104,019.331 226,634.025 ↓ 508,461.0 508,461 1

Nested Loop (cost=3,496.22..35,608.47 rows=1 width=78) (actual time=99.027..226,634.025 rows=508,461 loops=1)

  • Join Filter: (a.ai_model_id = m.ai_model_id)
9. 12,698.662 13,295.579 ↓ 508,461.0 508,461 1

Gather (cost=3,496.22..35,606.42 rows=1 width=78) (actual time=98.114..13,295.579 rows=508,461 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 221.980 596.917 ↓ 169,487.0 169,487 3

Hash Left Join (cost=2,496.22..34,606.32 rows=1 width=78) (actual time=77.701..596.917 rows=169,487 loops=3)

  • Hash Cond: (a.alert_id = s.alert_id)
  • Filter: (s.alert_solution_id IS NULL)
  • Rows Removed by Filter: 14285
11. 322.053 322.053 ↑ 1.3 183,772 3

Parallel Seq Scan on sens_alert a (cost=0.00..31,071.96 rows=229,910 width=78) (actual time=18.579..322.053 rows=183,772 loops=3)

  • Filter: ((state)::text <> 'DAMAGED'::text)
  • Rows Removed by Filter: 2850
12. 17.093 52.884 ↑ 1.0 42,854 3

Hash (cost=1,960.54..1,960.54 rows=42,854 width=16) (actual time=52.884..52.884 rows=42,854 loops=3)

  • Buckets: 65536 Batches: 1 Memory Usage: 2521kB
13. 35.791 35.791 ↑ 1.0 42,854 3

Seq Scan on sens_alert_solution s (cost=0.00..1,960.54 rows=42,854 width=16) (actual time=2.386..35.791 rows=42,854 loops=3)

14. 105,759.888 109,319.115 ↑ 1.0 1 508,461

Nested Loop (cost=0.00..2.03 rows=1 width=24) (actual time=0.214..0.215 rows=1 loops=508,461)

  • Join Filter: (m.ai_model_id = dt.ai_model_id)
15. 1,525.383 1,525.383 ↑ 1.0 1 508,461

Seq Scan on sens_ai_model m (cost=0.00..1.01 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=508,461)

16. 2,033.844 2,033.844 ↑ 1.0 1 508,461

Seq Scan on sens_decision_tree dt (cost=0.00..1.01 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=508,461)

17. 2,033.844 2,033.844 ↑ 1.0 1 508,461

Index Scan using pk_sens_decision_tree_activation on sens_decision_tree_activation dta (cost=0.14..0.16 rows=1 width=21) (actual time=0.004..0.004 rows=1 loops=508,461)

  • Index Cond: ((a.batch_type_id)::text = (batch_type_id)::text)
18. 1,016.922 1,016.922 ↑ 1.0 1 508,461

Index Scan using ix_sens_decision_tree_assignment_batch_type_id on sens_decision_tree_assignment dtas (cost=0.14..0.16 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=508,461)

  • Index Cond: ((a.batch_type_id)::text = (batch_type_id)::text)
19. 5,084.610 5,084.610 ↑ 1.3 3 508,461

Index Scan using ix_sens_alert_solution_history_alert_external_id on sens_alert_solution_history sash (cost=0.55..0.99 rows=4 width=71) (actual time=0.009..0.010 rows=3 loops=508,461)

  • Index Cond: ((alert_external_id)::text = (a.external_id)::text)
Planning time : 27.407 ms
Execution time : 244,115.696 ms