explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PKs8

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

Nested Loop (cost=232.03..5,399.47 rows=1 width=198) (never executed)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231.74..5,399.06 rows=1 width=168) (never executed)

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231.74..2,184.61 rows=1 width=168) (never executed)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231.33..2,179.29 rows=2 width=172) (never executed)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231.05..2,178.57 rows=2 width=188) (never executed)

6. 0.000 0.000 ↓ 0.0

Hash Join (cost=230.91..2,178.25 rows=2 width=188) (never executed)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=216.64..2,163.94 rows=5 width=220) (never executed)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=216.38..2,160.9 rows=7 width=220) (never executed)

9. 0.000 0.000 ↓ 0.0

Hash Join (cost=216.1..2,158.56 rows=7 width=180) (never executed)

10. 0.000 0.000 ↓ 0.0

Seq Scan on _sales_raw s (cost=0..1,704.41 rows=41,069 width=116) (never executed)

  • Filter: (s.redistributor_company_id IS NOT NULL)
11. 0.000 0.000 ↓ 0.0

Hash (cost=213.51..213.51 rows=207 width=94) (never executed)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=188.24..213.51 rows=207 width=94) (never executed)

13. 0.000 0.000 ↓ 0.0

HashAggregate (cost=126.68..140.84 rows=1,416 width=32) (never executed)

  • Group Key: cagg.contract_family_id, cagg.company_id
14. 0.000 0.000 ↓ 0.0

Seq Scan on _contractee_agg cagg (cost=0..98.45 rows=5,645 width=32) (never executed)

15. 0.000 0.000 ↓ 0.0

Hash (cost=55.07..55.07 rows=520 width=62) (never executed)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=14.7..55.07 rows=520 width=62) (never executed)

17. 0.000 0.000 ↓ 0.0

Seq Scan on contract_renew_version crv (cost=0..29.94 rows=1,394 width=46) (never executed)

18. 0.000 0.000 ↓ 0.0

Hash (cost=8.2..8.2 rows=520 width=16) (never executed)

19. 0.000 0.000 ↓ 0.0

Seq Scan on _contract_renew_version crx (cost=0..8.2 rows=520 width=16) (never executed)

20. 0.000 0.000 ↓ 0.0

Index Scan using contract_family_pkey on contract_family cf (cost=0.28..0.33 rows=1 width=40) (never executed)

  • Index Cond: (cf.contract_family_id = crv.contract_family_id)
21. 0.000 0.000 ↓ 0.0

Index Scan using grouping_company_pkey on grouping_company gc (cost=0.27..0.41 rows=1 width=16) (never executed)

  • Index Cond: (gc.grouping_id = cf.contractee_grouping_id)
  • Filter: (gc.grouping_company_type = 'BUYING_GROUP'::enum.grouping_company_type)
22. 0.000 0.000 ↓ 0.0

Hash (cost=8.01..8.01 rows=501 width=16) (never executed)

23. 0.000 0.000 ↓ 0.0

Seq Scan on _contract_family xcf (cost=0..8.01 rows=501 width=16) (never executed)

24. 0.000 0.000 ↓ 0.0

Index Scan using grouping_company_parent_pkey on grouping_company_parent gcp (cost=0.14..0.16 rows=1 width=32) (never executed)

  • Index Cond: (gcp.grouping_id = cf.contractee_grouping_id)
25. 0.000 0.000 ↓ 0.0

Index Scan using contract_amend_version_contract_renew_version_id_idx on contract_amend_version cav (cost=0.28..0.35 rows=1 width=32) (never executed)

  • Index Cond: (cav.contract_renew_version_id = crv.contract_renew_version_id)
26. 0.000 0.000 ↓ 0.0

Index Scan using contract_product_materialized_pkey on contract_product_materialized contract_product_materialized (cost=0.42..2.64 rows=1 width=52) (never executed)

  • Index Cond: ((contract_product_materialized.contract_id = cav.contract_amend_version_id) AND (contract_product_materialized.product_id = s.product_id))
27. 0.000 0.000 ↓ 0.0

Seq Scan on _sales_potential_earnings x (cost=0..2,228.98 rows=65,698 width=32) (never executed)

28. 0.000 0.000 ↓ 0.0

Index Scan using ix_tmp_contractee_agg_company on _contractee_agg xx (cost=0.28..0.35 rows=4 width=32) (never executed)

  • Index Cond: (xx.company_id = s.redistributor_company_id)
Planning time : 70.334 ms