explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mkoJ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3,439.749 3,456.633 ↓ 0.0 0 1

Delete on builds_datafield (cost=2,826.97..7,054.79 rows=500 width=34) (actual time=3,456.633..3,456.633 rows=0 loops=1)

2. 0.687 16.884 ↑ 1.0 500 1

Nested Loop (cost=2,826.97..7,054.79 rows=500 width=34) (actual time=12.297..16.884 rows=500 loops=1)

3. 0.667 12.697 ↑ 1.0 500 1

HashAggregate (cost=2,826.54..2,831.54 rows=500 width=32) (actual time=12.285..12.697 rows=500 loops=1)

  • Group Key: "ANY_subquery".id
4. 0.238 12.030 ↑ 1.0 500 1

Subquery Scan on ANY_subquery (cost=1.42..2,825.29 rows=500 width=32) (actual time=7.501..12.030 rows=500 loops=1)

5. 0.088 11.792 ↑ 1.0 500 1

Limit (cost=1.42..2,820.29 rows=500 width=4) (actual time=7.494..11.792 rows=500 loops=1)

6. 0.278 11.704 ↑ 12,464.6 500 1

Merge Join (cost=1.42..35,136,103.41 rows=6,232,303 width=4) (actual time=7.493..11.704 rows=500 loops=1)

  • Merge Cond: (dp.id = df.packet_id)
7. 4.587 8.270 ↑ 2,232.4 64 1

Nested Loop (cost=0.99..4,261,602.76 rows=142,876 width=4) (actual time=0.233..8.270 rows=64 loops=1)

  • Join Filter: (r.session_id = s.id)
  • Rows Removed by Join Filter: 24911
8. 0.069 0.675 ↑ 3,405.0 64 1

Nested Loop (cost=0.99..2,966,875.54 rows=217,922 width=8) (actual time=0.086..0.675 rows=64 loops=1)

9. 0.110 0.414 ↑ 3,405.0 64 1

Nested Loop (cost=0.71..1,524,695.40 rows=217,922 width=8) (actual time=0.078..0.414 rows=64 loops=1)

10. 0.112 0.112 ↑ 3,405.0 64 1

Index Scan using builds_datapacket_pkey on builds_datapacket dp (cost=0.42..32,718.78 rows=217,922 width=8) (actual time=0.068..0.112 rows=64 loops=1)

11. 0.192 0.192 ↑ 1.0 1 64

Index Scan using builds_datafile_pkey on builds_datafile dff (cost=0.29..6.84 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=64)

  • Index Cond: (id = dp.file_id)
12. 0.192 0.192 ↑ 1.0 1 64

Index Scan using flights_run_pkey on flights_run r (cost=0.28..6.61 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=64)

  • Index Cond: (id = dff.run_id)
13. 2.452 3.008 ↑ 1.0 390 64

Materialize (cost=0.00..271.53 rows=396 width=4) (actual time=0.000..0.047 rows=390 loops=64)

14. 0.556 0.556 ↑ 1.0 395 1

Seq Scan on flights_session s (cost=0.00..269.55 rows=396 width=4) (actual time=0.007..0.556 rows=395 loops=1)

  • Filter: (start_time < '2019-01-01 00:00:00-08'::timestamp with time zone)
  • Rows Removed by Filter: 209
15. 3.156 3.156 ↑ 19,011.7 500 1

Index Scan using builds_datafield_packet_id_idx on builds_datafield df (cost=0.43..30,856,634.50 rows=9,505,836 width=8) (actual time=1.456..3.156 rows=500 loops=1)

16. 3.500 3.500 ↑ 1.0 1 500

Index Scan using builds_datafield_pkey on builds_datafield (cost=0.43..8.44 rows=1 width=10) (actual time=0.007..0.007 rows=1 loops=500)

  • Index Cond: (id = "ANY_subquery".id)
Planning time : 6.330 ms
Execution time : 3,456.797 ms