explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FxR2

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 920.933 ↑ 1.0 45 1

Limit (cost=41,166.58..56,021.69 rows=45 width=392) (actual time=805.207..920.933 rows=45 loops=1)

2. 0.335 920.919 ↑ 592.1 45 1

Nested Loop Left Join (cost=41,166.58..8,837,372.11 rows=26,646 width=392) (actual time=805.206..920.919 rows=45 loops=1)

3. 84.790 865.639 ↑ 592.1 45 1

Nested Loop Left Join (cost=41,166.46..8,825,101.37 rows=26,646 width=382) (actual time=750.795..865.639 rows=45 loops=1)

  • Join Filter: (t1._idrref = t3.fld12108_rrref)
  • Rows Removed by Join Filter: 1041630
4. 0.278 1.584 ↑ 592.1 45 1

Nested Loop Semi Join (cost=0.50..7,040,675.40 rows=26,646 width=222) (actual time=0.278..1.584 rows=45 loops=1)

  • Join Filter: ((CASE WHEN (SubPlan 2) THEN true ELSE false END = CASE WHEN (SubPlan 3) THEN true ELSE false END) AND (CASE WHEN (SubPlan 4) THEN true ELSE false END = CASE WHEN (SubPlan 5) THEN true ELSE false END) AND (CASE WHEN (SubPlan 6) THEN true ELSE false END = CASE WHEN (SubPlan 7) THEN true ELSE false END))
5. 0.406 0.406 ↑ 592.1 45 1

Index Scan Backward using _document231_bydocdate_trl on _document231 t1 (cost=0.16..8,411.63 rows=26,646 width=282) (actual time=0.061..0.406 rows=45 loops=1)

  • Index Cond: (_fld601 = '0'::numeric)
6. 0.003 0.180 ↑ 16.0 1 45

Materialize (cost=0.33..988.36 rows=16 width=20) (actual time=0.004..0.004 rows=1 loops=45)

7. 0.001 0.177 ↑ 16.0 1 1

Nested Loop (cost=0.33..988.33 rows=16 width=20) (actual time=0.177..0.177 rows=1 loops=1)

8. 0.002 0.056 ↑ 16.5 2 1

Nested Loop (cost=0.28..188.14 rows=33 width=20) (actual time=0.055..0.056 rows=2 loops=1)

9. 0.014 0.014 ↑ 1.0 1 1

Index Only Scan using _reference83_byfieldfld1971_sr on _reference83 t7 (cost=0.11..8.13 rows=1 width=20) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (_fld1971 = 'Документ.ЗаказПоставщику'::mvarchar)
  • Heap Fetches: 1
10. 0.040 0.040 ↑ 50.5 2 1

Index Only Scan using _inforg11383_bydims_rr on _inforg11383 t9 (cost=0.17..179.01 rows=101 width=40) (actual time=0.040..0.040 rows=2 loops=1)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld11384rref = t7._idrref))
  • Heap Fetches: 2
11. 0.012 0.120 ↑ 1.0 1 2

Index Only Scan using _reference60hpk on _reference60 t8 (cost=0.06..24.23 rows=1 width=20) (actual time=0.060..0.060 rows=1 loops=2)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_idrref = t9._fld11385rref))
  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 1
  • Heap Fetches: 2
12.          

SubPlan (forIndex Only Scan)

13. 0.008 0.108 ↑ 1.0 1 2

Nested Loop (cost=0.11..24.15 rows=1 width=0) (actual time=0.054..0.054 rows=1 loops=2)

  • Join Filter: ((t10._fld11311_type = t11._fld1574_type) AND (t10._fld11311_rtref = t11._fld1574_rtref) AND (t10._fld11311_rrref = t11._fld1574_rrref))
  • Rows Removed by Join Filter: 35
14. 0.020 0.020 ↑ 1.0 5 2

Index Scan using _inforg11310_bydims11314_rr on _inforg11310 t10 (cost=0.11..15.21 rows=5 width=33) (actual time=0.006..0.010 rows=5 loops=2)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld11312_type = '\\x08'::bytea) AND (_fld11312_rtref = '\\x0000007f'::bytea) AND (_fld11312_rrref = '\\x2b8000259072bf6c11e3d6848243f7b6'::bytea))
  • Filter: _fld11313
15. 0.014 0.080 ↓ 2.3 7 10

Materialize (cost=0.00..8.74 rows=3 width=33) (actual time=0.002..0.008 rows=7 loops=10)

16. 0.066 0.066 ↓ 2.7 8 2

Seq Scan on _reference60_vt1572 t11 (cost=0.00..8.73 rows=3 width=33) (actual time=0.006..0.033 rows=8 loops=2)

  • Filter: ((_reference60_idrref = t8._idrref) AND (_fld601 = '0'::numeric))
  • Rows Removed by Filter: 303
17.          

SubPlan (forNested Loop Semi Join)

18. 0.225 0.225 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t12 (cost=0.11..8.13 rows=1 width=1) (actual time=0.005..0.005 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10664_type = '\\x08'::bytea) AND (_fld10664_rtref = '\\x00000075'::bytea) AND (_fld10664_rrref = t1._fld5814rref) AND (_fld10661rref = t8._idrref) AND (_fld10662rref = '\\x91a4c8a3ef0ea8164d35d4f3c47cdf9a'::bytea) AND (_fld10663 = false))
  • Filter: (NOT _fld10663)
  • Heap Fetches: 0
19. 0.090 0.090 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t13 (cost=0.11..8.13 rows=1 width=1) (actual time=0.002..0.002 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10662rref = '\\x91a4c8a3ef0ea8164d35d4f3c47cdf9a'::bytea) AND (_fld10661rref = t8._idrref) AND (_fld10663 = true))
  • Filter: _fld10663
  • Heap Fetches: 0
20. 0.135 0.135 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t14 (cost=0.11..8.13 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10664_type = '\\x08'::bytea) AND (_fld10664_rtref = '\\x000000a6'::bytea) AND (_fld10664_rrref = t1._fld5816rref) AND (_fld10661rref = t8._idrref) AND (_fld10662rref = '\\x952ec3166361e238431777c1ef06b88b'::bytea) AND (_fld10663 = false))
  • Filter: (NOT _fld10663)
  • Heap Fetches: 0
21. 0.090 0.090 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t15 (cost=0.11..8.13 rows=1 width=1) (actual time=0.002..0.002 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10662rref = '\\x952ec3166361e238431777c1ef06b88b'::bytea) AND (_fld10661rref = t8._idrref) AND (_fld10663 = true))
  • Filter: _fld10663
  • Heap Fetches: 0
22. 0.090 0.090 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t16 (cost=0.11..8.13 rows=1 width=1) (actual time=0.002..0.002 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10664_type = '\\x08'::bytea) AND (_fld10664_rtref = '\\x000000b2'::bytea) AND (_fld10664_rrref = t1._fld5841rref) AND (_fld10661rref = t8._idrref) AND (_fld10662rref = '\\x88353eea6d0419194442c04adbed9b27'::bytea) AND (_fld10663 = false))
  • Filter: (NOT _fld10663)
  • Heap Fetches: 0
23. 0.090 0.090 ↓ 0.0 0 45

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t17 (cost=0.11..8.13 rows=1 width=1) (actual time=0.002..0.002 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10662rref = '\\x88353eea6d0419194442c04adbed9b27'::bytea) AND (_fld10661rref = t8._idrref) AND (_fld10663 = true))
  • Filter: _fld10663
  • Heap Fetches: 0
24. 35.369 779.265 ↓ 4.3 23,148 45

Materialize (cost=41,165.96..52,974.30 rows=5,415 width=180) (actual time=10.363..17.317 rows=23,148 loops=45)

25. 1.966 743.896 ↓ 4.3 23,148 1

Subquery Scan on t3 (cost=41,165.96..52,963.47 rows=5,415 width=180) (actual time=466.343..743.896 rows=23,148 loops=1)

26. 60.089 741.930 ↓ 4.3 23,148 1

GroupAggregate (cost=41,165.96..52,909.32 rows=5,415 width=321) (actual time=466.342..741.930 rows=23,148 loops=1)

  • Group Key: t5._fld12108_type, t5._fld12108_rtref, t5._fld12108_rrref
  • Filter: ((sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12112 ELSE '0'::numeric END))) <> '0'::numeric) OR (sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12112 END))) <> '0'::numeric) OR (sum((((sum('0'::numeric)) + (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12112 ELSE '0'::numeric END))) - (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12112 END)))) <> '0'::numeric) OR (sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12111 ELSE '0'::numeric END))) <> '0'::numeric) OR (sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12111 END))) <> '0'::numeric) OR (sum((((sum('0'::numeric)) + (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12111 ELSE '0'::numeric END))) - (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12111 END)))) <> '0'::numeric) OR (sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12110 ELSE '0'::numeric END))) <> '0'::numeric) OR (sum((sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12110 END))) <> '0'::numeric) OR (sum((((sum('0'::numeric)) + (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12110 ELSE '0'::numeric END))) - (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12110 END)))) <> '0'::numeric))
27. 183.101 681.841 ↑ 2.3 23,148 1

GroupAggregate (cost=41,165.96..50,618.62 rows=54,154 width=321) (actual time=466.328..681.841 rows=23,148 loops=1)

  • Group Key: t5._fld12108_type, t5._fld12108_rtref, t5._fld12108_rrref
  • Filter: ((sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12112 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12112 END) <> '0'::numeric) OR (sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12111 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12111 END) <> '0'::numeric) OR (sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN t5._fld12110 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t5._recordkind = '0'::numeric) THEN '0'::numeric ELSE t5._fld12110 END) <> '0'::numeric))
28. 149.080 498.740 ↓ 1.0 221,253 1

Sort (cost=41,165.96..41,385.05 rows=219,087 width=50) (actual time=466.310..498.740 rows=221,253 loops=1)

  • Sort Key: t5._fld12108_rrref
  • Sort Method: external merge Disk: 11728kB
29. 349.660 349.660 ↓ 1.0 221,253 1

Seq Scan on _accumrg12106 t5 (cost=0.00..25,902.26 rows=219,087 width=50) (actual time=1.441..349.660 rows=221,253 loops=1)

  • Filter: (_active AND (_fld601 = '0'::numeric) AND ('\\x08'::bytea = _fld12108_type) AND ('\\x000000e7'::bytea = _fld12108_rtref))
  • Rows Removed by Filter: 323459
30. 54.945 54.945 ↓ 0.0 0 45

Index Scan using _reference68hpk on _reference68 t6 (cost=0.11..0.29 rows=1 width=40) (actual time=1.221..1.221 rows=0 loops=45)

  • Index Cond: ((_fld601 = '0'::numeric) AND (t1._fld5845rref = _idrref))