explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mfy

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 47.026 ↓ 0.0 0 1

Nested Loop (cost=32,719.37..32,727.42 rows=1 width=403) (actual time=47.026..47.026 rows=0 loops=1)

  • Output: spt.id, spt.task_name, spt.parameters, spt.initial_timestamp, spt.device_id
  • Buffers: shared hit=5145 read=6976
2.          

CTE blocking_devices

3. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=17,986.75..17,987.43 rows=68 width=4) (never executed)

  • Output: spt_1.device_id
  • Group Key: spt_1.device_id
4. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=6.72..17,782.00 rows=81,900 width=4) (never executed)

  • Output: spt_1.device_id
  • Hash Cond: (spt_1.device_id = md.id)
  • Join Filter: (((spt_1.status = 0) AND (spt_1.task_id IS NOT NULL)) OR (spt_1.status = 3) OR (spt_1.status = 1) OR (NOT md.processable))
5. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.m_dataqualifier_sequentialprocesstask spt_1 (cost=0.00..14,294.55 rows=163,799 width=154) (never executed)

  • Output: spt_1.device_id, spt_1.status, spt_1.task_id
  • Filter: ((spt_1.task_name)::text = 'm_dataqualifier.process_live_row'::text)
6. 0.000 0.000 ↓ 0.0 0

Hash (cost=5.21..5.21 rows=121 width=5) (never executed)

  • Output: md.id, md.processable
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.m_masterdata_device md (cost=0.00..5.21 rows=121 width=5) (never executed)

  • Output: md.id, md.processable
8.          

CTE available_tasks

9. 0.002 47.024 ↓ 0.0 0 1

HashAggregate (cost=14,731.51..14,731.52 rows=1 width=16) (actual time=47.024..47.024 rows=0 loops=1)

  • Output: spt_2.device_id, (first_value(spt_2.id) OVER (?)), spt_2.initial_timestamp
  • Group Key: spt_2.device_id, first_value(spt_2.id) OVER (?)
  • Buffers: shared hit=5145 read=6976
10. 0.001 47.022 ↓ 0.0 0 1

WindowAgg (cost=14,731.48..14,731.50 rows=1 width=16) (actual time=47.022..47.022 rows=0 loops=1)

  • Output: spt_2.device_id, first_value(spt_2.id) OVER (?), spt_2.initial_timestamp
  • Buffers: shared hit=5145 read=6976
11. 0.005 47.021 ↓ 0.0 0 1

Sort (cost=14,731.48..14,731.49 rows=1 width=16) (actual time=47.021..47.021 rows=0 loops=1)

  • Output: spt_2.device_id, spt_2.initial_timestamp, spt_2.id
  • Sort Key: spt_2.device_id, spt_2.initial_timestamp
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=5145 read=6976
12. 0.001 47.016 ↓ 0.0 0 1

Nested Loop Anti Join (cost=0.00..14,731.47 rows=1 width=16) (actual time=47.016..47.016 rows=0 loops=1)

  • Output: spt_2.device_id, spt_2.initial_timestamp, spt_2.id
  • Join Filter: (bd.device_id = spt_2.device_id)
  • Buffers: shared hit=5145 read=6976
13. 47.015 47.015 ↓ 0.0 0 1

Seq Scan on public.m_dataqualifier_sequentialprocesstask spt_2 (cost=0.00..14,729.26 rows=1 width=16) (actual time=47.015..47.015 rows=0 loops=1)

  • Output: spt_2.device_id, spt_2.id, spt_2.initial_timestamp
  • Filter: (((spt_2.task_name)::text = 'm_dataqualifier.process_live_row'::text) AND (spt_2.status = 0))
  • Rows Removed by Filter: 175653
  • Buffers: shared hit=5145 read=6976
14. 0.000 0.000 ↓ 0.0 0

CTE Scan on blocking_devices bd (cost=0.00..1.36 rows=68 width=4) (never executed)

  • Output: bd.device_id
15. 47.025 47.025 ↓ 0.0 0 1

CTE Scan on available_tasks ati (cost=0.00..0.02 rows=1 width=4) (actual time=47.025..47.025 rows=0 loops=1)

  • Output: ati.device_id, ati.t_id
  • Buffers: shared hit=5145 read=6976
16. 0.000 0.000 ↓ 0.0 0

Index Scan using m_dataqualifier_sequentialprocesstask_pkey on public.m_dataqualifier_sequentialprocesstask spt (cost=0.42..8.44 rows=1 width=403) (never executed)

  • Output: spt.id, spt.task_name, spt.parameters, spt.initial_timestamp, spt.device_id
  • Index Cond: (spt.id = ati.t_id)