explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6iZs

Settings
# exclusive inclusive rows x rows loops node
1. 12.508 3,642.750 ↑ 3,346,124.0 1 1

Nested Loop Left Join (cost=21,736.41..30,024,072.15 rows=3,346,124 width=1,714) (actual time=3,466.550..3,642.750 rows=1 loops=1)

2. 65.205 3,630.016 ↑ 168,570.0 1 1

Hash Join (cost=21,730.69..78,031.72 rows=168,570 width=1,666) (actual time=3,453.817..3,630.016 rows=1 loops=1)

  • Hash Cond: (wn.id = t_work_note_answ.id_note)
3. 231.474 3,559.011 ↓ 1.0 337,391 1

Hash Left Join (cost=9,259.40..62,800.08 rows=337,141 width=1,666) (actual time=215.710..3,559.011 rows=337,391 loops=1)

  • Hash Cond: (wn.id_reason = st.id)
4. 241.825 3,312.568 ↓ 1.0 337,391 1

Hash Left Join (cost=8,726.00..61,381.45 rows=337,141 width=1,604) (actual time=200.488..3,312.568 rows=337,391 loops=1)

  • Hash Cond: (w_user.id_employee = e.id)
5. 289.664 3,028.875 ↓ 1.0 337,391 1

Hash Left Join (cost=7,426.22..59,196.59 rows=337,141 width=1,555) (actual time=158.253..3,028.875 rows=337,391 loops=1)

  • Hash Cond: (wn.id_worker = w_user.id)
6. 222.104 2,679.119 ↓ 1.0 337,391 1

Hash Left Join (cost=3,941.26..54,826.54 rows=337,141 width=1,457) (actual time=97.420..2,679.119 rows=337,391 loops=1)

  • Hash Cond: (wn.id_base_target = bt.id)
7. 210.543 2,453.297 ↓ 1.0 337,391 1

Hash Left Join (cost=3,720.17..53,719.80 rows=337,141 width=1,424) (actual time=93.579..2,453.297 rows=337,391 loops=1)

  • Hash Cond: (wn.id_note_type = wt.id)
8. 229.468 2,242.218 ↓ 1.0 337,391 1

Hash Left Join (cost=3,706.06..52,804.18 rows=337,141 width=1,098) (actual time=92.978..2,242.218 rows=337,391 loops=1)

  • Hash Cond: (wn.id_base = b.id)
9. 412.022 2,006.949 ↓ 1.0 337,391 1

Hash Left Join (cost=3,484.96..51,697.45 rows=337,141 width=1,065) (actual time=87.044..2,006.949 rows=337,391 loops=1)

  • Hash Cond: (wn.id_user_target = w.id)
10. 1,508.727 1,508.727 ↓ 1.0 337,391 1

Seq Scan on t_work_note wn (cost=0.00..47,327.41 rows=337,141 width=1,007) (actual time=0.057..1,508.727 rows=337,391 loops=1)

11. 20.941 86.200 ↑ 1.3 33,018 1

Hash (cost=2,956.65..2,956.65 rows=42,265 width=62) (actual time=86.199..86.200 rows=33,018 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 3,591kB
12. 65.259 65.259 ↑ 1.3 33,018 1

Seq Scan on t_workers w (cost=0.00..2,956.65 rows=42,265 width=62) (actual time=0.043..65.259 rows=33,018 loops=1)

13. 2.385 5.801 ↑ 1.0 5,718 1

Hash (cost=148.82..148.82 rows=5,782 width=37) (actual time=5.801..5.801 rows=5,718 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 463kB
14. 3.416 3.416 ↑ 1.0 5,718 1

Seq Scan on t_bases b (cost=0.00..148.82 rows=5,782 width=37) (actual time=0.042..3.416 rows=5,718 loops=1)

15. 0.124 0.536 ↑ 1.0 227 1

Hash (cost=11.27..11.27 rows=227 width=330) (actual time=0.536..0.536 rows=227 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
16. 0.412 0.412 ↑ 1.0 227 1

Seq Scan on t_work_note_type wt (cost=0.00..11.27 rows=227 width=330) (actual time=0.059..0.412 rows=227 loops=1)

17. 2.251 3.718 ↑ 1.0 5,718 1

Hash (cost=148.82..148.82 rows=5,782 width=37) (actual time=3.718..3.718 rows=5,718 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 463kB
18. 1.467 1.467 ↑ 1.0 5,718 1

Seq Scan on t_bases bt (cost=0.00..148.82 rows=5,782 width=37) (actual time=0.015..1.467 rows=5,718 loops=1)

19. 19.027 60.092 ↑ 1.3 33,018 1

Hash (cost=2,956.65..2,956.65 rows=42,265 width=102) (actual time=60.092..60.092 rows=33,018 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 3,988kB
20. 41.065 41.065 ↑ 1.3 33,018 1

Seq Scan on t_workers w_user (cost=0.00..2,956.65 rows=42,265 width=102) (actual time=0.020..41.065 rows=33,018 loops=1)

21. 12.410 41.868 ↑ 1.0 24,390 1

Hash (cost=994.90..994.90 rows=24,390 width=57) (actual time=41.867..41.868 rows=24,390 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,435kB
22. 29.458 29.458 ↑ 1.0 24,390 1

Seq Scan on t_employee e (cost=0.00..994.90 rows=24,390 width=57) (actual time=0.066..29.458 rows=24,390 loops=1)

23. 6.871 14.969 ↑ 1.0 13,628 1

Hash (cost=361.51..361.51 rows=13,751 width=66) (actual time=14.969..14.969 rows=13,628 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 1,454kB
24. 8.098 8.098 ↑ 1.0 13,628 1

Seq Scan on t_subst_text st (cost=0.00..361.51 rows=13,751 width=66) (actual time=0.046..8.098 rows=13,628 loops=1)

25. 0.014 5.800 ↑ 200.0 1 1

Hash (cost=12,468.80..12,468.80 rows=200 width=8) (actual time=5.800..5.800 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
26. 0.028 5.786 ↑ 200.0 1 1

HashAggregate (cost=12,466.80..12,468.80 rows=200 width=8) (actual time=5.783..5.786 rows=1 loops=1)

  • Group Key: t_work_note_answ.id_note
27. 5.610 5.758 ↑ 4,689.0 1 1

Bitmap Heap Scan on t_work_note_answ (cost=104.76..12,455.08 rows=4,689 width=8) (actual time=5.757..5.758 rows=1 loops=1)

  • Recheck Cond: (id_order = '311001246393613'::bigint)
  • Heap Blocks: exact=1
28. 0.148 0.148 ↑ 4,689.0 1 1

Bitmap Index Scan on ix_t_work_note_answ_id_order (cost=0.00..103.59 rows=4,689 width=0) (actual time=0.148..0.148 rows=1 loops=1)

  • Index Cond: (id_order = '311001246393613'::bigint)
29. 0.004 0.226 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.71..57.50 rows=20 width=81) (actual time=0.226..0.226 rows=0 loops=1)

30. 0.011 0.222 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.44..31.12 rows=20 width=53) (actual time=0.222..0.222 rows=0 loops=1)

31. 0.034 0.211 ↓ 0.0 0 1

Bitmap Heap Scan on t_remind rem (cost=5.16..22.93 rows=20 width=53) (actual time=0.211..0.211 rows=0 loops=1)

  • Recheck Cond: (id_object @> ARRAY[wn.id])
  • Filter: ((id_worker IS NULL) AND (c_blocked = 0) AND (c_class_code = 'T_WORK_NOTE'::text) AND (c_view_code = 'V_WORK_NOTE'::text))
32. 0.177 0.177 ↓ 0.0 0 1

Bitmap Index Scan on idx_t_remind_id_object (cost=0.00..5.15 rows=686 width=0) (actual time=0.177..0.177 rows=0 loops=1)

  • Index Cond: (id_object @> ARRAY[wn.id])
33. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_t_bases on t_bases b_1 (cost=0.28..0.41 rows=1 width=8) (never executed)

  • Index Cond: (id = rem.id_base)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_t_time_zone on t_time_zone tz (cost=0.28..0.30 rows=1 width=36) (never executed)

  • Index Cond: (id = b_1.id_time_zone)
Planning time : 154.703 ms
Execution time : 3,645.339 ms