explain.depesz.com

A tool for finding a real cause for slow queries.

Result: A66g

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 215.939 11,248.902 ↓ 33,176.0 33,176 1

HashAggregate (cost=209.57..209.60 rows=1 width=391) (actual time=11,212.913..11,248.902 rows=33,176 loops=1)

  • rows=8 width=29) (actual time=0.000..0.143 rows=28 loops=28)
  • Index Cond: ((departments.id)::integer = (workareas.id)::integer)
2. 295.919 11,032.963 ↓ 34,197.0 34,197 1

GroupAggregate (cost=209.47..209.54 rows=1 width=391) (actual time=10,673.061..11,032.963 rows=34,197 loops=1)

3. 1,527.579 10,737.044 ↓ 34,401.0 34,401 1

Sort (cost=209.47..209.47 rows=1 width=391) (actual time=10,673.061..10,737.044 rows=34,401 loops=1)

  • Sort Key: p.surname, p.name, p.patronymic, workareas.name, workareas.name, ek.name, e.name, el.name, ert.name, e.id, reg.name, learninggroups.grade, ok.name, ok.id, pf.name
  • Sort Method: external merge Disk: 14632kB
4. 464.591 9,209.465 ↓ 34,401.0 34,401 1

Nested Loop (cost=0.00..209.46 rows=1 width=391) (actual time=0.000..9,209.465 rows=34,401 loops=1)

  • Join Filter: ((e.level)::integer = (el.id)::integer)
5. 293.462 8,469.666 ↓ 34,401.0 34,401 1

Nested Loop (cost=0.00..208.23 rows=1 width=363) (actual time=0.000..8,469.666 rows=34,401 loops=1)

  • Join Filter: ((ep.resulttypes)::integer = (ert.id)::integer)
6. 87.156 7,969.798 ↓ 34,401.0 34,401 1

Nested Loop Left Join (cost=0.00..207.08 rows=1 width=335) (actual time=0.000..7,969.798 rows=34,401 loops=1)

7. 122.619 7,813.840 ↓ 34,401.0 34,401 1

Nested Loop Left Join (cost=0.00..206.57 rows=1 width=287) (actual time=0.000..7,813.840 rows=34,401 loops=1)

8. 102.804 7,553.913 ↓ 34,327.0 34,327 1

Nested Loop Anti Join (cost=0.00..198.29 rows=1 width=283) (actual time=0.000..7,553.913 rows=34,327 loops=1)

9. 105.000 7,325.973 ↓ 41,712.0 41,712 1

Nested Loop Anti Join (cost=0.00..189.99 rows=1 width=287) (actual time=0.000..7,325.973 rows=41,712 loops=1)

10. 178.207 7,054.045 ↓ 41,732.0 41,732 1

Nested Loop Left Join (cost=0.00..188.87 rows=1 width=291) (actual time=0.000..7,054.045 rows=41,732 loops=1)

11. 112.995 6,834.106 ↓ 41,732.0 41,732 1

Nested Loop Left Join (cost=0.00..188.59 rows=1 width=259) (actual time=0.000..6,834.106 rows=41,732 loops=1)

12. 152.477 6,554.183 ↓ 41,732.0 41,732 1

Nested Loop (cost=0.00..187.71 rows=1 width=255) (actual time=0.000..6,554.183 rows=41,732 loops=1)

13. 186.728 6,318.242 ↓ 41,732.0 41,732 1

Nested Loop (cost=0.00..187.43 rows=1 width=227) (actual time=0.000..6,318.242 rows=41,732 loops=1)

14. 422.522 5,922.349 ↓ 41,833.0 41,833 1

Nested Loop (cost=0.00..179.15 rows=1 width=160) (actual time=0.000..5,922.349 rows=41,833 loops=1)

  • Join Filter: ((ep.participationform)::integer = (pf.id)::integer)
15. 202.070 5,206.548 ↓ 20,948.5 41,897 1

Nested Loop (cost=0.00..176.88 rows=2 width=132) (actual time=0.000..5,206.548 rows=41,897 loops=1)

16. 371.540 4,758.678 ↓ 30,725.0 61,450 1

Nested Loop (cost=0.00..174.19 rows=2 width=136) (actual time=0.000..4,758.678 rows=61,450 loops=1)

17. 275.561 3,970.894 ↓ 69,374.0 138,748 1

Nested Loop Anti Join (cost=0.00..170.90 rows=2 width=128) (actual time=0.000..3,970.894 rows=138,748 loops=1)

18. 493.923 3,279.089 ↓ 46,249.3 138,748 1

Nested Loop (cost=0.00..167.81 rows=3 width=132) (actual time=0.000..3,279.089 rows=138,748 loops=1)

19. 368.268 2,091.426 ↓ 46,249.3 138,748 1

Nested Loop Anti Join (cost=0.00..164.19 rows=3 width=75) (actual time=0.000..2,091.426 rows=138,748 loops=1)

20. 222.238 1,271.646 ↓ 37,626.0 150,504 1

Nested Loop (cost=0.00..160.10 rows=4 width=79) (actual time=0.000..1,271.646 rows=150,504 loops=1)

21. 37.077 839.768 ↓ 8,735.0 8,735 1

Nested Loop Anti Join (cost=0.00..144.96 rows=1 width=79) (actual time=0.000..839.768 rows=8,735 loops=1)

22. 85.605 739.795 ↓ 15,724.0 15,724 1

Nested Loop (cost=0.00..136.67 rows=1 width=83) (actual time=0.000..739.795 rows=15,724 loops=1)

23. 41.617 559.846 ↓ 15,724.0 15,724 1

Nested Loop (cost=0.00..135.71 rows=1 width=99) (actual time=0.000..559.846 rows=15,724 loops=1)

24. 308.345 423.885 ↓ 15,724.0 15,724 1

Nested Loop (cost=0.00..135.40 rows=1 width=95) (actual time=0.000..423.885 rows=15,724 loops=1)

  • -> Nested Loop (cost=0.00..134.42 rows=1 width=87) (actual time=0.000..283.922 rows=23108 loop
  • -> Nested Loop (cost=0.00..133.44 rows=1 width=83) (actual time=0.000..111.968 rows=2310
  • -> Nested Loop (cost=0.00..127.58 rows=1 width=50) (actual time=0.000..7.998 rows=
  • -> Nested Loop (cost=0.00..111.29 rows=58 width=46) (actual time=0.000..3.99
  • -> Index Scan using "fki_workareas_FK3" on workareas reg (cost=0.00..1
  • Index Cond: ((padre)::integer = 4974)
  • -> Index Scan using "fki_workareas_FK3" on workareas (cost=0.00..13.92
  • Index Cond: ((workareas.padre)::integer = (reg.id)::integer)
  • -> Index Scan using "fki_eduinstitutions_FK1" on eduinstitutions (cost=0.00.
  • Index Cond: ((eduinstitutions.id)::integer = (workareas.id)::integer)
  • -> Index Scan using "fki_workareas_FK3" on workareas (cost=0.00..5.76 rows=8 width
  • Index Cond: ((workareas.padre)::integer = (workareas.id)::integer)
25. 115.540 115.540 ↑ 1.0 1 23,108

Index Scan using primary_learninggroups on learninggroups (cost=0.00..0.97 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=23,108)

  • Index Cond: ((learninggroups.id)::integer = (workareas.id)::integer)
26. 94.344 94.344 ↑ 1.0 1 15,724

Index Scan using "fki_schools_FK1" on schools (cost=0.00..0.30 rows=1 width=4) (actual time=0.003..0.006 rows=1 loops=15,724)

  • Index Cond: ((schools.id)::integer = (workareas.id)::integer)
27. 94.344 94.344 ↑ 1.0 1 15,724

Index Scan using "fki_organizations_FK1" on organizations (cost=0.00..0.95 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=15,724)

  • Index Cond: ((organizations.id)::integer = (schools.id)::integer)
28. 62.896 62.896 ↓ 0.0 0 15,724

Index Scan using aspectinactive_pkey on aspectinactive lgai (cost=0.00..8.28 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=15,724)

  • Index Cond: ((lgai.id)::integer = (workareas.aspect)::integer)
29. 209.640 209.640 ↑ 1.3 17 8,735

Index Scan using "fki_employees_FK4" on employees (cost=0.00..14.86 rows=22 width=16) (actual time=0.004..0.024 rows=17 loops=8,735)

  • Index Cond: ((employees.department)::integer = (learninggroups.id)::integer)
30. 451.512 451.512 ↓ 0.0 0 150,504

Index Scan using aspectinactive_pkey on aspectinactive stai (cost=0.00..1.02 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=150,504)

  • Index Cond: ((stai.id)::integer = (employees.aspect)::integer)
31. 693.740 693.740 ↑ 1.0 1 138,748

Index Scan using primary_persons on persons p (cost=0.00..1.19 rows=1 width=57) (actual time=0.004..0.005 rows=1 loops=138,748)

  • Index Cond: ((p.id)::integer = (employees.person)::integer)
32. 416.244 416.244 ↓ 0.0 0 138,748

Index Scan using aspectinactive_pkey on aspectinactive pai (cost=0.00..1.03 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=138,748)

  • Index Cond: ((pai.id)::integer = (p.aspect)::integer)
33. 416.244 416.244 ↓ 0.0 0 138,748

Index Scan using "fki_eventparticipants_FK273" on eventparticipants ep (cost=0.00..1.61 rows=3 width=20) (actual time=0.003..0.003 rows=0 loops=138,748)

  • Index Cond: ((ep.person)::integer = (p.id)::integer)
34. 245.800 245.800 ↑ 1.0 1 61,450

Index Scan using primary_students on students (cost=0.00..1.33 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=61,450)

  • Index Cond: ((students.id)::integer = (employees.id)::integer)
35. 293.279 293.279 ↑ 1.0 6 41,897

Seq Scan on participationforms pf (cost=0.00..1.06 rows=6 width=36) (actual time=0.001..0.007 rows=6 loops=41,897)

36. 209.165 209.165 ↑ 1.0 1 41,833

Index Scan using primary_events on events e (cost=0.00..8.27 rows=1 width=71) (actual time=0.004..0.005 rows=1 loops=41,833)

  • Index Cond: ((e.id)::integer = (ep.event)::integer)
37. 83.464 83.464 ↑ 1.0 1 41,732

Index Scan using primary_eventkinds on eventkinds ek (cost=0.00..0.27 rows=1 width=36) (actual time=0.001..0.002 rows=1 loops=41,732)

  • Index Cond: ((ek.id)::integer = (e.kind)::integer)
38. 166.928 166.928 ↓ 0.0 0 41,732

Index Scan using "fki_olympiads_FK413" on olympiads o (cost=0.00..0.87 rows=1 width=8) (actual time=0.003..0.004 rows=0 loops=41,732)

  • Index Cond: ((o.id)::integer = (e.id)::integer)
39. 41.732 41.732 ↓ 0.0 0 41,732

Index Scan using primary_olympiadkinds on olympiadkinds ok (cost=0.00..0.27 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=41,732)

  • Index Cond: ((ok.id)::integer = (o.olympkind)::integer)
40. 166.928 166.928 ↓ 0.0 0 41,732

Index Scan using aspectinactive_pkey on aspectinactive eai (cost=0.00..1.11 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=41,732)

  • Index Cond: ((eai.id)::integer = (e.aspect)::integer)
41. 125.136 125.136 ↓ 0.0 0 41,712

Index Scan using aspectinactive_pkey on aspectinactive epai (cost=0.00..8.28 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=41,712)

  • Index Cond: ((epai.id)::integer = (ep.aspect)::integer)
42. 137.308 137.308 ↓ 0.0 0 34,327

Index Scan using "fki_event2subject_FK267" on event2subject e2s (cost=0.00..8.27 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=34,327)

  • Index Cond: ((e2s.event)::integer = (e.id)::integer)
43. 68.802 68.802 ↓ 0.0 0 34,401

Index Scan using primary_subjects on subjects sub (cost=0.00..0.50 rows=1 width=56) (actual time=0.002..0.002 rows=0 loops=34,401)

  • Index Cond: ((sub.id)::integer = (e2s.subject)::integer)
44. 206.406 206.406 ↑ 1.0 7 34,401

Seq Scan on eventresulttypes ert (cost=0.00..1.07 rows=7 width=36) (actual time=0.002..0.006 rows=7 loops=34,401)

45. 275.208 275.208 ↑ 1.0 10 34,401

Seq Scan on eventlevels el (cost=0.00..1.10 rows=10 width=36) (actual time=0.001..0.008 rows=10 loops=34,401)