explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4EJk0

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 509,736.051 ↑ 1.0 2 1

Unique (cost=34,944,389.67..34,944,389.71 rows=2 width=60) (actual time=509,736.050..509,736.051 rows=2 loops=1)

  • Buffers: shared hit=198857 read=10680 dirtied=6509, local hit=1
2. 0.054 509,736.049 ↑ 1.0 2 1

Sort (cost=34,944,389.67..34,944,389.67 rows=2 width=60) (actual time=509,736.049..509,736.049 rows=2 loops=1)

  • Sort Key: t2._fld13664rref, t2._fld13665_type, t2._fld13665_rtref, t2._fld13665_rrref, t5._idrref, (CASE WHEN (t5._idrref IS NULL) THEN false ELSE true END), (CASE WHEN (t5._idrref IS NULL) THEN true ELSE false END)
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=198857 read=10680 dirtied=6509, local hit=1
3. 0.013 509,735.995 ↑ 1.0 2 1

Nested Loop (cost=8,018,403.52..34,944,389.66 rows=2 width=60) (actual time=176,177.077..509,735.995 rows=2 loops=1)

  • Buffers: shared hit=198852 read=10680 dirtied=6509, local hit=1
4. 20.410 509,718.332 ↑ 1.0 2 1

Merge Join (cost=8,018,403.39..34,944,389.34 rows=2 width=58) (actual time=176,159.427..509,718.332 rows=2 loops=1)

  • Merge Cond: (t2._fld13666rref = t1.fld16361rref)
  • Buffers: shared hit=198851 read=10678 dirtied=6509, local hit=1
5. 370,674.525 509,697.891 ↑ 1.5 151,081 1

Nested Loop Left Join (cost=0.42..54,177,591.47 rows=231,695 width=75) (actual time=78,587.243..509,697.891 rows=151,081 loops=1)

  • Join Filter: ((t2._fld13664rref = t5._fld11564rref) AND (t2._fld13665_type = CASE WHEN (t5._fld11565rref IS NOT NULL) THEN '\\010'::bytea ELSE NULL::bytea END) AND (t2._fld13665_rtref = CASE WHEN (t5._fld11565rref IS NOT NULL) THE (...)
  • Rows Removed by Join Filter: 1743150878
  • Buffers: shared hit=198851 read=10678 dirtied=6509
6. 1,389.486 1,389.486 ↑ 1.5 151,080 1

Index Only Scan using _inforg13662_byresource13669_rrrr on _inforg13662 t2 (cost=0.42..16,257.02 rows=231,695 width=58) (actual time=0.082..1,389.486 rows=151,080 loops=1)

  • Index Cond: (_fld717 = '0'::numeric)
  • Heap Fetches: 6681
  • Buffers: shared hit=570 read=1789 dirtied=1
7. 59,084.242 137,633.880 ↓ 11,538.0 11,538 151,080

Materialize (cost=0.00..54,156,121.32 rows=1 width=51) (actual time=0.004..0.911 rows=11,538 loops=151,080)

  • Buffers: shared hit=198281 read=8889 dirtied=6508
8. 691.214 78,549.638 ↓ 11,538.0 11,538 1

Seq Scan on _document375 t5 (cost=0.00..54,156,121.31 rows=1 width=51) (actual time=605.617..78,549.638 rows=11,538 loops=1)

  • Filter: ((NOT _marked) AND (_fld717 = '0'::numeric) AND (_fld11568 = '2019-05-01 00:00:00'::timestamp without time zone) AND ((((((('2000-01-01 00:00:00'::timestamp without time zone + (((((date_part('YEAR'::text, _fld (...)
  • Rows Removed by Filter: 1167488
  • Buffers: shared hit=198281 read=8889 dirtied=6508
9.          

SubPlan (forSeq Scan)

10. 69.228 77,858.424 ↑ 1.0 1 11,538

Nested Loop Semi Join (cost=13.11..46.11 rows=1 width=0) (actual time=6.748..6.748 rows=1 loops=11,538)

  • Join Filter: (CASE WHEN (SubPlan 1) THEN true ELSE false END = CASE WHEN (alternatives: SubPlan 2 or hashed SubPlan 3) THEN true ELSE false END)
  • Buffers: shared hit=156778 read=8889 dirtied=6508
11. 46.152 67,854.978 ↑ 1.0 1 11,538

Nested Loop Left Join (cost=0.42..7.47 rows=1 width=17) (actual time=5.881..5.881 rows=1 loops=11,538)

  • Filter: (CASE WHEN (t6._fld3020rref IS NULL) THEN '\\001'::bytea ELSE CASE WHEN (t6._fld3020rref IS NOT NULL) THEN '\\010'::bytea ELSE NULL::bytea END END <> '\\001'::bytea)
  • Buffers: shared hit=39182 read=7039 dirtied=6446
12. 0.000 0.000 ↑ 1.0 1 11,538

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=11,538)

13. 67,808.826 67,808.826 ↑ 1.0 1 11,538

Index Scan using _reference124hpk on _reference124 t6 (cost=0.42..7.44 rows=1 width=17) (actual time=5.877..5.877 rows=1 loops=11,538)

  • Index Cond: ((_fld717 = '0'::numeric) AND (t5._fld11565rref = _idrref))
  • Buffers: shared hit=39182 read=7039 dirtied=6446
14. 2.539 11.538 ↑ 1.0 1 11,538

Materialize (cost=12.69..23.29 rows=1 width=17) (actual time=0.001..0.001 rows=1 loops=11,538)

  • Buffers: shared hit=24 read=1
15. 0.005 8.999 ↑ 1.0 1 1

Nested Loop (cost=12.69..23.29 rows=1 width=17) (actual time=8.999..8.999 rows=1 loops=1)

  • Buffers: shared hit=24 read=1
16. 0.004 8.959 ↑ 1.0 1 1

Nested Loop (cost=12.42..22.99 rows=1 width=38) (actual time=8.959..8.959 rows=1 loops=1)

  • Buffers: shared hit=20 read=1
17. 8.806 8.806 ↑ 1.0 1 1

Index Only Scan using _reference105_byfield2798_sr on _reference105 t9 (cost=0.41..7.42 rows=1 width=20) (actual time=8.806..8.806 rows=1 loops=1)

  • Index Cond: (_fld2789 = 'Документ.СверкаВзаиморасчетов'::mvarchar)
  • Heap Fetches: 0
  • Buffers: shared hit=6 read=1
18. 0.010 0.149 ↑ 1.0 1 1

Nested Loop (cost=12.01..15.55 rows=1 width=57) (actual time=0.149..0.149 rows=1 loops=1)

  • Buffers: shared hit=14
19. 0.006 0.111 ↑ 1.0 1 1

HashAggregate (cost=11.59..11.60 rows=1 width=19) (actual time=0.111..0.111 rows=1 loops=1)

  • Group Key: t10._reference73_idrref
  • Buffers: shared hit=10
20. 0.013 0.105 ↓ 3.0 3 1

Nested Loop (cost=0.56..11.59 rows=1 width=19) (actual time=0.102..0.105 rows=3 loops=1)

  • Buffers: shared hit=10
21. 0.034 0.034 ↑ 1.0 2 1

Index Only Scan using _inforg14726_bydims14730_rr on _inforg14726 t11 (cost=0.28..3.83 rows=2 width=24) (actual time=0.033..0.034 rows=2 loops=1)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld14728_type = '\\010'::bytea) AND (_fld14728_rtref = '\\000\\000\\000\\254'::bytea) AND (_fld14728_rrref = 'P\\2140Z:wL\\3 (...)
  • Heap Fetches: 0
  • Buffers: shared hit=3
22. 0.058 0.058 ↑ 1.5 2 2

Index Only Scan using _reference73_vt2103_byfield2106_rr on _reference73_vt2103 t10 (cost=0.28..3.85 rows=3 width=49) (actual time=0.029..0.029 rows=2 loops=2)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld2105_type = t11._fld14727_type) AND (_fld2105_rtref = t11._fld14727_rtref) AND (_fld2105_rrref = t11._fld14727_rrref))
  • Heap Fetches: 2
  • Buffers: shared hit=7
23. 0.028 0.028 ↑ 1.0 1 1

Index Only Scan using _inforg14845_bydims14850_rr on _inforg14845 t8 (cost=0.42..3.94 rows=1 width=38) (actual time=0.028..0.028 rows=1 loops=1)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld14847rref = t10._reference73_idrref) AND (_fld14846rref = t9._idrref))
  • Heap Fetches: 0
  • Buffers: shared hit=4
24. 0.035 0.035 ↑ 1.0 1 1

Index Only Scan using _reference73hpk on _reference73 t7 (cost=0.27..0.29 rows=1 width=17) (actual time=0.035..0.035 rows=1 loops=1)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_idrref = t8._fld14847rref))
  • Heap Fetches: 1
  • Buffers: shared hit=4
25.          

SubPlan (forNested Loop Semi Join)

26. 46.152 9,749.610 ↑ 1.0 1 11,538

Nested Loop (cost=0.83..11.39 rows=1 width=0) (actual time=0.845..0.845 rows=1 loops=11,538)

  • Buffers: shared hit=82960 read=1846 dirtied=62
27. 9,484.236 9,484.236 ↑ 1.0 1 11,538

Index Only Scan using _inforg13761_bydims_rrn on _inforg13761 t13 (cost=0.42..7.45 rows=1 width=24) (actual time=0.822..0.822 rows=1 loops=11,538)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld13762_type = CASE WHEN (t6._fld3020rref IS NOT NULL) THEN '\\010'::bytea ELSE NULL::bytea END) AND (_fld13762_rtref = CASE WHEN (t6._fld3020rref IS N (...)
  • Heap Fetches: 3894
  • Buffers: shared hit=36813 read=1840 dirtied=62
28. 219.222 219.222 ↑ 1.0 1 11,538

Index Only Scan using _inforg13931_bydims13935_rr on _inforg13931 t12 (cost=0.41..3.93 rows=1 width=27) (actual time=0.019..0.019 rows=1 loops=11,538)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld13933_type = t13._fld13763_type) AND (_fld13933_rtref = t13._fld13763_rtref) AND (_fld13933_rrref = t13._fld13763_rrref) AND (_fld13932rref = t7._idr (...)
  • Heap Fetches: 11538
  • Buffers: shared hit=46147 read=6
29. 173.070 173.070 ↑ 1.0 1 11,538

Index Only Scan using _inforg13938_byresource13945_lrr on _inforg13938 t14 (cost=0.41..3.93 rows=1 width=0) (actual time=0.015..0.015 rows=1 loops=11,538)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld13941 = false) AND (_fld13939rref = t7._idrref) AND (_fld13940_type = CASE WHEN (t6._fld3020rref IS NOT NULL) THEN '\\010'::bytea ELSE NULL::bytea END) AND (...)
  • Filter: (NOT _fld13941)
  • Heap Fetches: 0
  • Buffers: shared hit=34612 read=3
30. 0.000 0.000 ↓ 0.0 0

Index Only Scan using _inforg13938_byresource13945_lrr on _inforg13938 t14_1 (cost=0.41..199.45 rows=1,027 width=24) (never executed)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_fld13941 = false))
  • Filter: (NOT _fld13941)
  • Heap Fetches: 0
31. 0.024 0.031 ↑ 1.0 2 1

Sort (cost=1.03..1.03 rows=2 width=17) (actual time=0.030..0.031 rows=2 loops=1)

  • Sort Key: t1.fld16361rref
  • Sort Method: quicksort Memory: 25kB
  • Buffers: local hit=1
32. 0.007 0.007 ↑ 1.0 2 1

Seq Scan on tt999 t1 (cost=0.00..1.02 rows=2 width=17) (actual time=0.007..0.007 rows=2 loops=1)

  • Buffers: local hit=1
33. 17.650 17.650 ↑ 1.0 1 2

Index Only Scan using _reference148hpk on _reference148 t3 (cost=0.13..0.15 rows=1 width=17) (actual time=8.824..8.825 rows=1 loops=2)

  • Index Cond: ((_fld717 = '0'::numeric) AND (_idrref = t2._fld13664rref))
  • Heap Fetches: 0
  • Buffers: shared hit=1 read=2
Planning time : 152.060 ms
Execution time : 509,736.547 ms