explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vghD

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 25,422.540 ↑ 1.0 25 1

Limit (cost=0.83..220,148.37 rows=25 width=392) (actual time=25,294.380..25,422.540 rows=25 loops=1)

2. 0.352 25,422.523 ↑ 1,060.1 25 1

Nested Loop Left Join (cost=0.83..233,382,804.92 rows=26,503 width=392) (actual time=25,294.378..25,422.523 rows=25 loops=1)

3. 58.560 25,286.846 ↑ 1,060.1 25 1

Nested Loop Left Join (cost=0.72..233,370,577.36 rows=26,503 width=382) (actual time=25,198.564..25,286.846 rows=25 loops=1)

  • Join Filter: (t26._idrref = t28.fld12108_rrref)
  • Rows Removed by Join Filter: 578696
4. 0.198 13.736 ↑ 1,060.1 25 1

Nested Loop Semi Join (cost=0.50..7,002,952.16 rows=26,503 width=222) (actual time=0.343..13.736 rows=25 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. 12.638 12.638 ↑ 1,060.1 25 1

Index Scan Backward using _document231_bydocdate_trl on _document231 t26 (cost=0.16..8,422.84 rows=26,503 width=282) (actual time=0.065..12.638 rows=25 loops=1)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_date_time < '2019-03-01 16:32:36'::timestamp without time zone))
6. 0.023 0.250 ↑ 16.0 1 25

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

7. 0.003 0.227 ↑ 16.0 1 1

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

8. 0.001 0.046 ↑ 16.5 2 1

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

9. 0.019 0.019 ↑ 1.0 1 1

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

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

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

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

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

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

SubPlan (forIndex Only Scan)

13. 0.022 0.166 ↑ 1.0 1 2

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

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

Index Scan using _inforg11310_bydims11314_rr on _inforg11310 t43 (cost=0.11..15.21 rows=5 width=33) (actual time=0.008..0.012 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.010 0.120 ↓ 2.3 7 10

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

16. 0.110 0.110 ↓ 2.7 8 2

Seq Scan on _reference60_vt1572 t44 (cost=0.00..8.73 rows=3 width=33) (actual time=0.011..0.055 rows=8 loops=2)

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

SubPlan (forNested Loop Semi Join)

18. 0.200 0.200 ↓ 0.0 0 25

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t45 (cost=0.11..8.13 rows=1 width=1) (actual time=0.008..0.008 rows=0 loops=25)

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

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t46 (cost=0.11..8.13 rows=1 width=1) (actual time=0.004..0.004 rows=0 loops=25)

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

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t47 (cost=0.11..8.13 rows=1 width=1) (actual time=0.004..0.004 rows=0 loops=25)

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

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t48 (cost=0.11..8.13 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=25)

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

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t49 (cost=0.11..8.13 rows=1 width=1) (actual time=0.004..0.004 rows=0 loops=25)

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

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t50 (cost=0.11..8.13 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=25)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10662rref = '\\x88353eea6d0419194442c04adbed9b27'::bytea) AND (_fld10661rref = t41._idrref) AND (_fld10663 = true))
  • Filter: _fld10663
  • Heap Fetches: 0
24. 29.939 25,214.550 ↓ 4.8 23,148 25

Materialize (cost=0.22..224,818,794.75 rows=4,870 width=180) (actual time=0.060..1,008.582 rows=23,148 loops=25)

25. 4.226 25,184.611 ↓ 4.8 23,148 1

Subquery Scan on t28 (cost=0.22..224,818,785.01 rows=4,870 width=180) (actual time=1.487..25,184.611 rows=23,148 loops=1)

26. 86.386 25,180.385 ↓ 4.8 23,148 1

GroupAggregate (cost=0.22..224,818,736.31 rows=4,870 width=321) (actual time=1.486..25,180.385 rows=23,148 loops=1)

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

GroupAggregate (cost=0.22..224,816,676.19 rows=48,703 width=321) (actual time=0.895..25,093.999 rows=23,148 loops=1)

  • Group Key: t30._fld12108_type, t30._fld12108_rtref, t30._fld12108_rrref
  • Filter: ((sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN t30._fld12112 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN '0'::numeric ELSE t30._fld12112 END) <> '0'::numeric) OR (sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN t30._fld12111 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN '0'::numeric ELSE t30._fld12111 END) <> '0'::numeric) OR (sum('0'::numeric) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN t30._fld12110 ELSE '0'::numeric END) <> '0'::numeric) OR (sum(CASE WHEN (t30._recordkind = '0'::numeric) THEN '0'::numeric ELSE t30._fld12110 END) <> '0'::numeric))
28. 260.589 24,819.672 ↓ 2.0 221,253 1

Index Scan using _accumrg12106_bydims12120_rtrn on _accumrg12106 t30 (cost=0.22..224,811,259.22 rows=109,544 width=50) (actual time=0.303..24,819.672 rows=221,253 loops=1)

  • Index Cond: ((_fld601 = '0'::numeric) AND ('\\x08'::bytea = _fld12108_type) AND ('\\x000000e7'::bytea = _fld12108_rtref))
  • Filter: (_active AND (SubPlan 11))
29.          

SubPlan (forIndex Scan)

30. 221.253 24,559.083 ↑ 1.0 1 221,253

Nested Loop (cost=0.50..1,025.88 rows=1 width=0) (actual time=0.111..0.111 rows=1 loops=221,253)

31. 221.253 24,337.830 ↑ 1.0 1 221,253

Nested Loop Semi Join (cost=0.50..1,025.85 rows=1 width=0) (actual time=0.110..0.110 rows=1 loops=221,253)

  • Join Filter: (CASE WHEN (SubPlan 9) THEN true ELSE false END = CASE WHEN (SubPlan 10) THEN true ELSE false END)
32. 663.759 663.759 ↑ 1.0 1 221,253

Index Only Scan using _inforg10383_byresource10390_rrrr on _inforg10383 t31 (cost=0.16..8.18 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=221,253)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10387rref = t30._fld12107rref))
  • Heap Fetches: 221253
33. 442.506 22,346.553 ↑ 16.0 1 221,253

Nested Loop (cost=0.33..988.33 rows=16 width=20) (actual time=0.101..0.101 rows=1 loops=221,253)

34. 0.000 2,876.289 ↑ 16.5 2 221,253

Nested Loop (cost=0.28..188.14 rows=33 width=20) (actual time=0.013..0.013 rows=2 loops=221,253)

35. 663.759 663.759 ↑ 1.0 1 221,253

Index Only Scan using _reference83_byfieldfld1971_sr on _reference83 t32 (cost=0.11..8.13 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=221,253)

  • Index Cond: (_fld1971 = 'РегистрНакопления.РасчетыСПоставщиками'::mvarchar)
  • Heap Fetches: 221253
36. 2,212.530 2,212.530 ↑ 50.5 2 221,253

Index Only Scan using _inforg11383_bydims_rr on _inforg11383 t34 (cost=0.17..179.01 rows=101 width=40) (actual time=0.009..0.010 rows=2 loops=221,253)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld11384rref = t32._idrref))
  • Heap Fetches: 442506
37. 885.012 19,027.758 ↑ 1.0 1 442,506

Index Only Scan using _reference60hpk on _reference60 t33 (cost=0.06..24.23 rows=1 width=20) (actual time=0.043..0.043 rows=1 loops=442,506)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_idrref = t34._fld11385rref))
  • Filter: (SubPlan 8)
  • Rows Removed by Filter: 1
  • Heap Fetches: 442506
38.          

SubPlan (forIndex Only Scan)

39. 2,655.036 18,142.746 ↑ 1.0 1 442,506

Nested Loop (cost=0.11..24.15 rows=1 width=0) (actual time=0.041..0.041 rows=1 loops=442,506)

  • Join Filter: ((t35._fld11311_type = t36._fld1574_type) AND (t35._fld11311_rtref = t36._fld1574_rtref) AND (t35._fld11311_rrref = t36._fld1574_rrref))
  • Rows Removed by Join Filter: 35
40. 2,212.530 2,212.530 ↑ 1.0 5 442,506

Index Scan using _inforg11310_bydims11314_rr on _inforg11310 t35 (cost=0.11..15.21 rows=5 width=33) (actual time=0.004..0.005 rows=5 loops=442,506)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld11312_type = '\\x08'::bytea) AND (_fld11312_rtref = '\\x0000007f'::bytea) AND (_fld11312_rrref = '\\x2b8000259072bf6c11e3d6848243f7b6'::bytea))
  • Filter: _fld11313
41. 1,770.024 13,275.180 ↓ 2.3 7 2,212,530

Materialize (cost=0.00..8.74 rows=3 width=33) (actual time=0.001..0.006 rows=7 loops=2,212,530)

42. 11,505.156 11,505.156 ↓ 2.7 8 442,506

Seq Scan on _reference60_vt1572 t36 (cost=0.00..8.73 rows=3 width=33) (actual time=0.002..0.026 rows=8 loops=442,506)

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

SubPlan (forNested Loop Semi Join)

44. 663.759 663.759 ↓ 0.0 0 221,253

Index Only Scan using _inforg10660_bydims10666_rrrl on _inforg10660 t37 (cost=0.11..8.13 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=221,253)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10664_type = '\\x08'::bytea) AND (_fld10664_rtref = '\\x00000075'::bytea) AND (_fld10664_rrref = t31._fld10385rref) AND (_fld10661rref = t33._idrref) AND (_fld10662rref = '\\x91a4c8a3ef0ea8164d35d4f3c47cdf9a'::bytea) AND (_fld10663 = false))
  • Filter: (NOT _fld10663)
  • Heap Fetches: 0
45. 442.506 442.506 ↓ 0.0 0 221,253

Index Only Scan using _inforg10660_bydims10665_rrlr on _inforg10660 t38 (cost=0.11..8.13 rows=1 width=1) (actual time=0.002..0.002 rows=0 loops=221,253)

  • Index Cond: ((_fld601 = '0'::numeric) AND (_fld10662rref = '\\x91a4c8a3ef0ea8164d35d4f3c47cdf9a'::bytea) AND (_fld10661rref = t33._idrref) AND (_fld10663 = true))
  • Filter: _fld10663
  • Heap Fetches: 0
46. 0.000 0.000 ↑ 1.0 1 221,253

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

47. 135.325 135.325 ↑ 1.0 1 25

Index Scan using _reference68hpk on _reference68 t39 (cost=0.11..0.29 rows=1 width=40) (actual time=5.413..5.413 rows=1 loops=25)

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