explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CnUJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.046 1,018.518 ↑ 91.4 92 1

Hash Anti Join (cost=130,285.40..216,065.99 rows=8,413 width=21) (actual time=762.955..1,018.518 rows=92 loops=1)

  • Hash Cond: (cdt1.id = cdtq1.cinema_data_task_id)
2. 0.112 1,018.462 ↑ 91.4 92 1

Nested Loop Anti Join (cost=130,284.39..215,958.77 rows=8,413 width=21) (actual time=762.937..1,018.462 rows=92 loops=1)

3. 0.201 1,017.655 ↑ 60.7 139 1

Nested Loop Left Join (cost=130,283.96..197,739.71 rows=8,437 width=25) (actual time=762.610..1,017.655 rows=139 loops=1)

  • Filter: ((cdte2.id IS NULL) OR cdte2.execution_is_successful)
4. 161.725 1,016.898 ↑ 66.7 139 1

Hash Left Join (cost=130,283.54..178,508.10 rows=9,267 width=29) (actual time=762.590..1,016.898 rows=139 loops=1)

  • Hash Cond: (cdt1.last_cinema_data_task_execution_id = cdte1.id)
  • Filter: ((cdt1.venue_id IS NULL) OR (SubPlan 1) OR (NOT cdte1.execution_is_successful))
  • Rows Removed by Filter: 451
5. 92.086 92.086 ↑ 28.7 590 1

Index Scan using cinema_data_task_last_successful_cinema_data_task_execution_id_ on cinema_data_task cdt1 (cost=0.42..43,903.50 rows=16,945 width=32) (actual time=0.095..92.086 rows=590 loops=1)

  • Index Cond: (last_successful_cinema_data_task_execution_id IS NULL)
  • Filter: ((terminated_reason IS NULL) AND (attempt_count <= maximum_execution_attempt_count) AND (last_attempted_at < (now() - '00:01:00'::interval)))
  • Rows Removed by Filter: 54575
6. 235.203 761.317 ↑ 1.0 1,031,480 1

Hash (cost=113,187.05..113,187.05 rows=1,035,305 width=5) (actual time=761.317..761.317 rows=1,031,480 loops=1)

  • Buckets: 524288 Batches: 4 Memory Usage: 14176kB
7. 526.114 526.114 ↑ 1.0 1,031,480 1

Seq Scan on cinema_data_task_execution cdte1 (cost=0.00..113,187.05 rows=1,035,305 width=5) (actual time=0.009..526.114 rows=1,031,480 loops=1)

8.          

SubPlan (for Hash Left Join)

9. 0.296 1.770 ↓ 2.0 4 590

Materialize (cost=109.75..207.43 rows=2 width=4) (actual time=0.001..0.003 rows=4 loops=590)

10. 0.515 1.474 ↓ 3.0 6 1

Hash Join (cost=109.75..207.42 rows=2 width=4) (actual time=0.451..1.474 rows=6 loops=1)

  • Hash Cond: (tr1.venue_id = v1.id)
  • Join Filter: (c1.maximum_cinema_data_task_concurrency < ((tr1.queued_task_count + tr1.running_task_count) + tr1.failing_task_count))
  • Rows Removed by Join Filter: 6
11. 0.533 0.533 ↑ 1.0 4,624 1

Seq Scan on task_report tr1 (cost=0.00..80.24 rows=4,624 width=28) (actual time=0.012..0.533 rows=4,624 loops=1)

12. 0.003 0.426 ↓ 2.4 12 1

Hash (cost=109.69..109.69 rows=5 width=8) (actual time=0.426..0.426 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.008 0.423 ↓ 2.4 12 1

Nested Loop (cost=0.28..109.69 rows=5 width=8) (actual time=0.105..0.423 rows=12 loops=1)

14. 0.382 0.382 ↓ 3.0 3 1

Seq Scan on cinema c1 (cost=0.00..103.52 rows=1 width=8) (actual time=0.087..0.382 rows=3 loops=1)

  • Filter: (new_cinema_data_task_execution_disabled_until_at > now())
  • Rows Removed by Filter: 965
15. 0.033 0.033 ↑ 1.2 4 3

Index Scan using public_venue_cinema_id0_idx on venue v1 (cost=0.28..6.12 rows=5 width=8) (actual time=0.007..0.011 rows=4 loops=3)

  • Index Cond: (cinema_id = c1.id)
16. 0.556 0.556 ↑ 1.0 1 139

Index Scan using cinema_data_task_execution_pkey on cinema_data_task_execution cdte2 (cost=0.42..2.07 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=139)

  • Index Cond: (id = cdt1.parent_cinema_data_task_execution_id)
17. 0.695 0.695 ↓ 0.0 0 139

Index Scan using cinema_data_task_execution_cinema_data_task_id_idx on cinema_data_task_execution cdte1_1 (cost=0.42..2.15 rows=1 width=13) (actual time=0.005..0.005 rows=0 loops=139)

  • Index Cond: (cinema_data_task_id = cdt1.id)
  • Filter: (((NOT execution_is_successful) OR (ended_at IS NULL)) AND (((NOT execution_is_successful) AND (ended_at > ((now() - '00:01:00'::interval) - ('00:00:01'::interval * (bound_power((cdt1.attempt_count + 1), 4, 1, 1440))::double precision)))) OR (ended_at IS NULL)))
  • Rows Removed by Filter: 0
18. 0.000 0.010 ↓ 0.0 0 1

Hash (cost=1.00..1.00 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
19. 0.010 0.010 ↓ 0.0 0 1

Seq Scan on cinema_data_task_queue cdtq1 (cost=0.00..1.00 rows=1 width=4) (actual time=0.009..0.010 rows=0 loops=1)

  • Filter: (attempted_at IS NULL)
Planning time : 1.975 ms
Execution time : 1,018.729 ms