explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZJyp

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 406.303 ↑ 1.0 2 1

Unique (cost=13,787,623.62..13,787,623.66 rows=2 width=60) (actual time=406.302..406.303 rows=2 loops=1)

  • Buffers: shared hit=42979, local hit=1
2. 0.028 406.302 ↑ 1.0 2 1

Sort (cost=13,787,623.62..13,787,623.63 rows=2 width=60) (actual time=406.302..406.302 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=42979, local hit=1
3. 0.009 406.274 ↑ 1.0 2 1

Nested Loop (cost=3,163,718.29..13,787,623.61 rows=2 width=60) (actual time=334.903..406.274 rows=2 loops=1)

  • Buffers: shared hit=42974, local hit=1
4. 8.411 406.245 ↑ 1.0 2 1

Merge Join (cost=3,163,718.16..13,787,623.30 rows=2 width=58) (actual time=334.881..406.245 rows=2 loops=1)

  • Merge Cond: (t2._fld13666rref = t1.fld16361rref)
  • Buffers: shared hit=42971, local hit=1
5. 67.312 397.819 ↑ 1.5 150,321 1

Nested Loop Left Join (cost=0.42..21,375,984.87 rows=230,947 width=75) (actual time=313.729..397.819 rows=150,321 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: 150321
  • Buffers: shared hit=42971
6. 29.865 29.865 ↑ 1.5 150,321 1

Index Only Scan using _inforg13662_byresource13669_rrrr on _inforg13662 t2 (cost=0.42..8,218.10 rows=230,947 width=58) (actual time=0.062..29.865 rows=150,321 loops=1)

  • Index Cond: (_fld717 = '0'::numeric)
  • Heap Fetches: 5996
  • Buffers: shared hit=2331
7. 0.000 300.642 ↑ 1.0 1 150,321

Materialize (cost=0.00..21,362,570.46 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=150,321)

  • Buffers: shared hit=40640
8. 313.383 313.660 ↑ 1.0 1 1

Seq Scan on _document375 t5 (cost=0.00..21,362,570.46 rows=1 width=51) (actual time=313.656..313.660 rows=1 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: 1167470
  • Buffers: shared hit=40640
9.          

SubPlan (forSeq Scan)

10. 0.007 0.277 ↑ 1.0 1 1

Nested Loop Semi Join (cost=6.21..18.51 rows=1 width=0) (actual time=0.277..0.277 rows=1 loops=1)

  • 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=41
11. 0.006 0.043 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.42..2.88 rows=1 width=17) (actual time=0.043..0.043 rows=1 loops=1)

  • 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=4
12. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

13. 0.036 0.036 ↑ 1.0 1 1

Index Scan using _reference124hpk on _reference124 t6 (cost=0.42..2.84 rows=1 width=17) (actual time=0.036..0.036 rows=1 loops=1)

  • Index Cond: ((_fld717 = '0'::numeric) AND (t5._fld11565rref = _idrref))
  • Buffers: shared hit=4
14. 0.002 0.149 ↑ 1.0 1 1

Materialize (cost=5.79..9.49 rows=1 width=17) (actual time=0.149..0.149 rows=1 loops=1)

  • Buffers: shared hit=23
15. 0.003 0.147 ↑ 1.0 1 1

Nested Loop (cost=5.79..9.49 rows=1 width=17) (actual time=0.147..0.147 rows=1 loops=1)

  • Buffers: shared hit=23
16. 0.001 0.130 ↑ 1.0 1 1

Nested Loop (cost=5.52..9.19 rows=1 width=38) (actual time=0.130..0.130 rows=1 loops=1)

  • Buffers: shared hit=19
17. 0.060 0.060 ↑ 1.0 1 1

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

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

Nested Loop (cost=5.11..6.36 rows=1 width=57) (actual time=0.069..0.069 rows=1 loops=1)

  • Buffers: shared hit=12
19. 0.004 0.044 ↑ 1.0 1 1

HashAggregate (cost=4.70..4.71 rows=1 width=19) (actual time=0.044..0.044 rows=1 loops=1)

  • Group Key: t10._reference73_idrref
  • Buffers: shared hit=8
20. 0.004 0.040 ↓ 3.0 3 1

Nested Loop (cost=0.56..4.69 rows=1 width=19) (actual time=0.040..0.040 rows=3 loops=1)

  • Buffers: shared hit=8
21. 0.018 0.018 ↑ 1.0 2 1

Index Only Scan using _inforg14726_bydims14730_rr on _inforg14726 t11 (cost=0.28..1.53 rows=2 width=24) (actual time=0.018..0.018 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.018 0.018 ↑ 1.5 2 2

Index Only Scan using _reference73_vt2103_byfield2106_rr on _reference73_vt2103 t10 (cost=0.28..1.55 rows=3 width=49) (actual time=0.009..0.009 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: 0
  • Buffers: shared hit=5
23. 0.018 0.018 ↑ 1.0 1 1

Index Only Scan using _inforg14845_bydims14850_rr on _inforg14845 t8 (cost=0.42..1.64 rows=1 width=38) (actual time=0.018..0.018 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.014 0.014 ↑ 1.0 1 1

Index Only Scan using _reference73hpk on _reference73 t7 (cost=0.27..0.29 rows=1 width=17) (actual time=0.014..0.014 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. 0.007 0.053 ↑ 1.0 1 1

Nested Loop (cost=0.83..4.49 rows=1 width=0) (actual time=0.053..0.053 rows=1 loops=1)

  • Buffers: shared hit=9
27. 0.025 0.025 ↑ 1.0 1 1

Index Only Scan using _inforg13761_bydims_rrn on _inforg13761 t13 (cost=0.42..2.85 rows=1 width=24) (actual time=0.025..0.025 rows=1 loops=1)

  • 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: 0
  • Buffers: shared hit=4
28. 0.021 0.021 ↑ 1.0 1 1

Index Only Scan using _inforg13931_bydims13935_rr on _inforg13931 t12 (cost=0.41..1.63 rows=1 width=27) (actual time=0.021..0.021 rows=1 loops=1)

  • 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: 1
  • Buffers: shared hit=5
29. 0.025 0.025 ↑ 1.0 1 1

Index Only Scan using _inforg13938_byresource13945_lrr on _inforg13938 t14 (cost=0.41..1.64 rows=1 width=0) (actual time=0.025..0.025 rows=1 loops=1)

  • 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: 1
  • Buffers: shared hit=5
30. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

  • Index Cond: ((_fld717 = '0'::numeric) AND (_idrref = t2._fld13664rref))
  • Heap Fetches: 0
  • Buffers: shared hit=3
Planning time : 37.131 ms
Execution time : 406.552 ms