explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GlSY

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 921.693 ↑ 1.0 25 1

Limit (cost=44,291.05..44,332.39 rows=25 width=353) (actual time=916.278..921.693 rows=25 loops=1)

2. 0.010 921.687 ↑ 10,079.3 25 1

Subquery Scan on taskview0_ (cost=44,291.05..460,907.59 rows=251,982 width=353) (actual time=916.277..921.687 rows=25 loops=1)

3. 0.050 921.677 ↑ 10,079.3 25 1

Merge Left Join (cost=44,291.05..458,387.77 rows=251,982 width=366) (actual time=916.275..921.677 rows=25 loops=1)

  • Merge Cond: (t.id = pnr.task)
4. 0.048 914.493 ↑ 10,079.3 25 1

Merge Left Join (cost=44,290.50..74,282.20 rows=251,982 width=349) (actual time=914.318..914.493 rows=25 loops=1)

  • Merge Cond: (t.id = contact_dates.task)
5. 474.257 914.208 ↑ 10,079.3 25 1

Sort (cost=44,290.07..44,920.03 rows=251,982 width=341) (actual time=914.187..914.208 rows=25 loops=1)

  • Sort Key: t.id DESC
  • Sort Method: external merge Disk: 66824kB
6. 86.919 439.951 ↑ 1.0 247,363 1

Hash Join (cost=4.53..21,683.56 rows=251,982 width=341) (actual time=0.101..439.951 rows=247,363 loops=1)

  • Hash Cond: (t.priority = p.id)
7. 86.160 353.018 ↑ 1.0 247,363 1

Hash Join (cost=3.46..18,217.74 rows=251,982 width=328) (actual time=0.074..353.018 rows=247,363 loops=1)

  • Hash Cond: (t.operator = o.id)
8. 117.899 266.834 ↑ 1.0 247,363 1

Hash Join (cost=1.09..14,750.61 rows=251,982 width=309) (actual time=0.027..266.834 rows=247,363 loops=1)

  • Hash Cond: (t.type = tt.id)
  • Join Filter: ((NOT t.is_sabre_ix) OR (NOT t.is_transfer) OR (tt.name <> 'Изменение терминала'::text))
  • Rows Removed by Join Filter: 4186
9. 148.927 148.927 ↑ 1.0 251,549 1

Seq Scan on tasks t (cost=0.00..10,654.44 rows=252,005 width=269) (actual time=0.008..148.927 rows=251,549 loops=1)

  • Filter: (NOT deleted)
  • Rows Removed by Filter: 22516
10. 0.005 0.008 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=48) (actual time=0.008..0.008 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.003 0.003 ↑ 1.0 4 1

Seq Scan on task_types tt (cost=0.00..1.04 rows=4 width=48) (actual time=0.002..0.003 rows=4 loops=1)

12. 0.014 0.024 ↑ 1.0 61 1

Hash (cost=1.61..1.61 rows=61 width=31) (actual time=0.024..0.024 rows=61 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
13. 0.010 0.010 ↑ 1.0 61 1

Seq Scan on operators o (cost=0.00..1.61 rows=61 width=31) (actual time=0.003..0.010 rows=61 loops=1)

14. 0.007 0.014 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=21) (actual time=0.014..0.014 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.007 0.007 ↑ 1.0 3 1

Seq Scan on priorities p (cost=0.00..1.03 rows=3 width=21) (actual time=0.006..0.007 rows=3 loops=1)

16. 0.011 0.237 ↑ 9,640.6 28 1

Materialize (cost=0.42..25,579.85 rows=269,936 width=16) (actual time=0.123..0.237 rows=28 loops=1)

17. 0.092 0.226 ↑ 9,640.6 28 1

GroupAggregate (cost=0.42..22,205.65 rows=269,936 width=16) (actual time=0.119..0.226 rows=28 loops=1)

  • Group Key: contact_dates.task
18. 0.134 0.134 ↑ 13,168.8 57 1

Index Only Scan Backward using contact_date_task_datetime on contact_dates (cost=0.42..15,753.19 rows=750,620 width=16) (actual time=0.110..0.134 rows=57 loops=1)

  • Heap Fetches: 57
19. 0.009 7.134 ↑ 7,017.4 27 1

Materialize (cost=0.56..380,632.98 rows=189,471 width=12) (actual time=1.005..7.134 rows=27 loops=1)

20. 0.221 7.125 ↑ 7,017.4 27 1

GroupAggregate (cost=0.56..378,264.59 rows=189,471 width=12) (actual time=1.003..7.125 rows=27 loops=1)

  • Group Key: pnr.task
21. 6.904 6.904 ↑ 5,336.1 813 1

Index Only Scan Backward using pnr_pass_status_task on pnr (cost=0.56..354,678.70 rows=4,338,237 width=12) (actual time=0.079..6.904 rows=813 loops=1)

  • Heap Fetches: 813
Planning time : 5.235 ms