explain.depesz.com

A tool for finding a real cause for slow queries.

Result: fL6

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=36980.50..37102.10 rows=66 width=216) (actual time=.. rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=36980.50..36980.66 rows=66 width=216) (actual time=.. rows= loops=)

  • Sort Key: o.name, s.abbr, o.id, co.abn, s.id
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=35331.13..36978.50 rows=66 width=216) (actual time=.. rows= loops=)

4. 0.000 0.000 ↓ 0.0

Seq Scan on state s (cost=0.00..1.10 rows=1 width=42) (actual time=.. rows= loops=)

  • Filter: (id = 1)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=35331.13..36976.74 rows=66 width=178) (actual time=.. rows= loops=)

  • Join Filter: (ip.payslip = ts.payslip)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13864.01..15061.06 rows=1 width=150) (actual time=.. rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13864.01..15060.38 rows=1 width=126) (actual time=.. rows= loops=)

  • Join Filter: (e.company = co.id)
8. 0.000 0.000 ↓ 0.0

Index Scan using company_organisation_idx on company co (cost=0.00..29.55 rows=209 width=40) (actual time=.. rows= loops=)

9. 0.000 0.000 ↓ 0.0

Materialize (cost=13864.01..15027.70 rows=1 width=94) (actual time=.. rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13864.01..15027.69 rows=1 width=94) (actual time=.. rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=13864.01..15027.41 rows=1 width=90) (actual time=.. rows= loops=)

  • Hash Cond: (ps.id = ip.payslip)
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1139.14 rows=882 width=54) (actual time=.. rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on processing_schedule pr (cost=0.00..51.74 rows=9 width=20) (actual time=.. rows= loops=)

  • Filter: (((COALESCE(done, "time"))::date >= '2011-07-01'::date) AND ((COALESCE(done, "time"))::date <= '2012-06-30'::date))
14. 0.000 0.000 ↓ 0.0

Index Scan using payslip_process_idx on payslip ps (cost=0.00..118.93 rows=151 width=42) (actual time=.. rows= loops=)

  • Index Cond: (ps.process = pr.id)
  • Filter: (ps.status <> 1)
15. 0.000 0.000 ↓ 0.0

Hash (cost=13861.51..13861.51 rows=200 width=36) (actual time=.. rows= loops=)

16. 0.000 0.000 ↓ 0.0

Subquery Scan on ip (cost=13856.01..13861.51 rows=200 width=36) (actual time=.. rows= loops=)

17. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13856.01..13859.51 rows=200 width=36) (actual time=.. rows= loops=)

  • Filter: (sum(((((ts.quantity * (r.amount)::numeric))::aud))::numeric) <> 0::numeric)
18. 0.000 0.000 ↓ 0.0

Append (cost=690.73..12404.38 rows=193550 width=36) (actual time=.. rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=690.73..10315.88 rows=180421 width=18) (actual time=.. rows= loops=)

  • Hash Cond: (ts.rate = r.id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on timesheet ts (cost=0.00..4437.49 rows=180462 width=15) (actual time=.. rows= loops=)

  • Filter: (quantity <> 0::numeric)
21. 0.000 0.000 ↓ 0.0

Hash (cost=468.39..468.39 rows=17787 width=11) (actual time=.. rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on rate r (cost=0.00..468.39 rows=17787 width=11) (actual time=.. rows= loops=)

  • Filter: ((amount)::numeric <> 0::numeric)
23. 0.000 0.000 ↓ 0.0

Seq Scan on oncharge oc (cost=0.00..280.51 rows=12951 width=36) (actual time=.. rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on income i (cost=0.00..3.78 rows=178 width=14) (actual time=.. rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Scan using employment_pkey on employment e (cost=0.00..0.27 rows=1 width=12) (actual time=.. rows= loops=)

  • Index Cond: (e.id = ps.employment)
26. 0.000 0.000 ↓ 0.0

Index Scan using organisation_pkey on organisation o (cost=0.00..0.67 rows=1 width=28) (actual time=.. rows= loops=)

  • Index Cond: (o.id = co.organisation)
27. 0.000 0.000 ↓ 0.0

HashAggregate (cost=21467.12..21627.32 rows=12816 width=40) (actual time=.. rows= loops=)

28. 0.000 0.000 ↓ 0.0

Append (cost=1629.66..20505.92 rows=128160 width=40) (actual time=.. rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash Join (cost=1629.66..9794.18 rows=120537 width=22) (actual time=.. rows= loops=)

  • Hash Cond: (ts.rate = r.id)
  • Join Filter: ((ts.quantity <> 0::numeric) OR ((r.amount)::numeric <> 0::numeric))
30. 0.000 0.000 ↓ 0.0

Seq Scan on timesheet ts (cost=0.00..3910.99 rows=210599 width=15) (actual time=.. rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash (cost=1502.38..1502.38 rows=10183 width=15) (actual time=.. rows= loops=)

32. 0.000 0.000 ↓ 0.0

Hash Join (cost=843.19..1502.38 rows=10183 width=15) (actual time=.. rows= loops=)

  • Hash Cond: (r.contract_duration = cd.id)
33. 0.000 0.000 ↓ 0.0

Seq Scan on rate r (cost=0.00..423.91 rows=17791 width=15) (actual time=.. rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash (cost=741.21..741.21 rows=8159 width=8) (actual time=.. rows= loops=)

35. 0.000 0.000 ↓ 0.0

Hash Join (cost=304.25..741.21 rows=8159 width=8) (actual time=.. rows= loops=)

  • Hash Cond: (cd.contract = cn.id)
36. 0.000 0.000 ↓ 0.0

Seq Scan on contract_duration cd (cost=0.00..248.93 rows=14193 width=8) (actual time=.. rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash (cost=248.92..248.92 rows=4426 width=8) (actual time=.. rows= loops=)

38. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.79..248.92 rows=4426 width=8) (actual time=.. rows= loops=)

  • Hash Cond: (cn.wc = wp.id)
39. 0.000 0.000 ↓ 0.0

Seq Scan on contract cn (cost=0.00..167.00 rows=7700 width=8) (actual time=.. rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash (cost=6.68..6.68 rows=169 width=8) (actual time=.. rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on wc_policy wp (cost=0.00..6.68 rows=169 width=8) (actual time=.. rows= loops=)

  • Filter: (state = 1)
42. 0.000 0.000 ↓ 0.0

Hash Join (cost=6780.89..9427.70 rows=7445 width=17) (actual time=.. rows= loops=)

  • Hash Cond: (cp.contract_duration = cd.id)
43. 0.000 0.000 ↓ 0.0

Hash Join (cost=5937.69..6477.22 rows=12951 width=17) (actual time=.. rows= loops=)

  • Hash Cond: (oc.period = cp.id)
44. 0.000 0.000 ↓ 0.0

Seq Scan on oncharge oc (cost=0.00..280.51 rows=12951 width=17) (actual time=.. rows= loops=)

45. 0.000 0.000 ↓ 0.0

Hash (cost=3399.53..3399.53 rows=203053 width=8) (actual time=.. rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on contract_period cp (cost=0.00..3399.53 rows=203053 width=8) (actual time=.. rows= loops=)

47. 0.000 0.000 ↓ 0.0

Hash (cost=741.21..741.21 rows=8159 width=8) (actual time=.. rows= loops=)

48. 0.000 0.000 ↓ 0.0

Hash Join (cost=304.25..741.21 rows=8159 width=8) (actual time=.. rows= loops=)

  • Hash Cond: (cd.contract = cn.id)
49. 0.000 0.000 ↓ 0.0

Seq Scan on contract_duration cd (cost=0.00..248.93 rows=14193 width=8) (actual time=.. rows= loops=)

50. 0.000 0.000 ↓ 0.0

Hash (cost=248.92..248.92 rows=4426 width=8) (actual time=.. rows= loops=)

51. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.79..248.92 rows=4426 width=8) (actual time=.. rows= loops=)

  • Hash Cond: (cn.wc = wp.id)
52. 0.000 0.000 ↓ 0.0

Seq Scan on contract cn (cost=0.00..167.00 rows=7700 width=8) (actual time=.. rows= loops=)

53. 0.000 0.000 ↓ 0.0

Hash (cost=6.68..6.68 rows=169 width=8) (actual time=.. rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on wc_policy wp (cost=0.00..6.68 rows=169 width=8) (actual time=.. rows= loops=)

  • Filter: (state = 1)
55. 0.000 0.000 ↓ 0.0

Seq Scan on income i (cost=0.00..4.22 rows=178 width=18) (actual time=.. rows= loops=)

  • Filter: (state = 1)