explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qQGl

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=8,087.04..8,087.04 rows=2 width=592) (actual rows= loops=)

  • Sort Key: o_e.partner_reporting_date
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8,070.75..8,087.03 rows=2 width=592) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Unique (cost=8,070.60..8,070.64 rows=2 width=476) (actual rows= loops=)

4.          

CTE reasons_cte

5. 0.000 0.000 ↓ 0.0

Unique (cost=2,505.29..2,505.31 rows=1 width=35) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Sort (cost=2,505.29..2,505.30 rows=1 width=35) (actual rows= loops=)

  • Sort Key: obligation_reasons.id, obligation_reasons.kind, obligation_reasons.external_id
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.17..2,505.28 rows=1 width=35) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8.88..2,504.89 rows=1 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8.60..2,504.56 rows=1 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.31..2,498.67 rows=19 width=8) (actual rows= loops=)

  • Hash Cond: (obligations_2.from_party_id = from_parties_2.id)
11. 0.000 0.000 ↓ 0.0

Seq Scan on obligations obligations_2 (cost=0.00..2,216.49 rows=104,249 width=12) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=8.30..8.30 rows=1 width=4) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using parties_idx_uniq on parties from_parties_2 (cost=0.28..8.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((external_id = '5bec27212440da00050000df'::bpchar) AND ((kind)::text = 'partner'::text))
14. 0.000 0.000 ↓ 0.0

Index Scan using parties_pkey on parties to_parties_2 (cost=0.28..0.31 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = obligations_2.to_party_id)
  • Filter: (((kind)::text = 'driver'::text) AND (external_id = '5bebe344b344be0010aa42db'::bpchar))
15. 0.000 0.000 ↓ 0.0

Index Scan using obligation_events_pkey on obligation_events o_e_2 (cost=0.29..0.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = obligations_2.event_id)
  • Filter: ((partner_reporting_date >= '2017-01-01 00:00:00'::timestamp without time zone) AND (partner_reporting_date < '2020-01-01 00:00:00'::timestamp without time zone) AND ((event_kind)::text = 'create'::text))
16. 0.000 0.000 ↓ 0.0

Index Scan using obligation_reasons_pkey on obligation_reasons (cost=0.28..0.40 rows=1 width=35) (actual rows= loops=)

  • Index Cond: (id = o_e_2.reason_id)
17. 0.000 0.000 ↓ 0.0

Sort (cost=5,565.29..5,565.30 rows=2 width=476) (actual rows= loops=)

  • Sort Key: from_parties.external_id, to_parties.external_id, o_e.event_kind, reasons_cte.cte_reason_external_id, reasons_cte.cte_reason_kind, obligations.kind_id, o_e.partner_reporting_date, obligations.amount
18. 0.000 0.000 ↓ 0.0

Append (cost=285.18..5,565.28 rows=2 width=476) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=285.18..2,782.63 rows=1 width=299) (actual rows= loops=)

  • Hash Cond: (o_e.reason_id = reasons_cte.cte_id)
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=285.15..2,782.53 rows=15 width=81) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Join (cost=284.86..2,777.71 rows=15 width=66) (actual rows= loops=)

  • Hash Cond: (obligations.to_party_id = to_parties.id)
22. 0.000 0.000 ↓ 0.0

Hash Join (cost=142.20..2,632.55 rows=950 width=44) (actual rows= loops=)

  • Hash Cond: (obligations.from_party_id = from_parties.id)
23. 0.000 0.000 ↓ 0.0

Seq Scan on obligations (cost=0.00..2,216.49 rows=104,249 width=22) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=141.57..141.57 rows=50 width=30) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on parties from_parties (cost=0.00..141.57 rows=50 width=30) (actual rows= loops=)

  • Filter: ((kind)::text = 'partner'::text)
26. 0.000 0.000 ↓ 0.0

Hash (cost=141.57..141.57 rows=87 width=30) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on parties to_parties (cost=0.00..141.57 rows=87 width=30) (actual rows= loops=)

  • Filter: ((kind)::text = 'driver'::text)
28. 0.000 0.000 ↓ 0.0

Index Scan using obligation_events_pkey on obligation_events o_e (cost=0.29..0.32 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (id = obligations.event_id)
29. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=226) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

CTE Scan on reasons_cte (cost=0.00..0.02 rows=1 width=226) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash Join (cost=285.18..2,782.63 rows=1 width=299) (actual rows= loops=)

  • Hash Cond: (o_e_1.reason_id = reasons_cte_1.cte_id)
32. 0.000 0.000 ↓ 0.0

Nested Loop (cost=285.15..2,782.53 rows=15 width=81) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash Join (cost=284.86..2,777.71 rows=15 width=66) (actual rows= loops=)

  • Hash Cond: (obligations_1.from_party_id = from_parties_1.id)
34. 0.000 0.000 ↓ 0.0

Hash Join (cost=142.20..2,632.55 rows=950 width=44) (actual rows= loops=)

  • Hash Cond: (obligations_1.to_party_id = to_parties_1.id)
35. 0.000 0.000 ↓ 0.0

Seq Scan on obligations obligations_1 (cost=0.00..2,216.49 rows=104,249 width=22) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Hash (cost=141.57..141.57 rows=50 width=30) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Seq Scan on parties to_parties_1 (cost=0.00..141.57 rows=50 width=30) (actual rows= loops=)

  • Filter: ((kind)::text = 'partner'::text)
38. 0.000 0.000 ↓ 0.0

Hash (cost=141.57..141.57 rows=87 width=30) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on parties from_parties_1 (cost=0.00..141.57 rows=87 width=30) (actual rows= loops=)

  • Filter: ((kind)::text = 'driver'::text)
40. 0.000 0.000 ↓ 0.0

Index Scan using obligation_events_pkey on obligation_events o_e_1 (cost=0.29..0.32 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (id = obligations_1.event_id)
41. 0.000 0.000 ↓ 0.0

Hash (cost=0.02..0.02 rows=1 width=226) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

CTE Scan on reasons_cte reasons_cte_1 (cost=0.00..0.02 rows=1 width=226) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Index Scan using obligation_kinds_pkey on obligation_kinds o_k (cost=0.15..8.17 rows=1 width=120) (actual rows= loops=)

  • Index Cond: (id = obligations.kind_id)