explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1LQ8

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

GroupAggregate (cost=0.14..73,996,683.37 rows=826 width=32) (actual rows= loops=)

  • Group Key: mp.id
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.14..73,990,709.61 rows=5,971,279 width=164) (actual rows= loops=)

  • Join Filter: ((mps."beginDate" >= mp."endDate") AND (mps.id <> mp.id) AND (SubPlan 1))
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..4,193.47 rows=551 width=40) (actual rows= loops=)

  • Join Filter: (m."membershipTypeId" = "membershipTypes".id)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..4,186.40 rows=826 width=56) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Scan using "membershipPeriods_pkey" on "membershipPeriods" mp (cost=0.08..2,939.19 rows=826 width=40) (actual rows= loops=)

  • Filter: (("endDate" >= '2019-03-01 00:00:00+00'::timestamp with time zone) AND ("endDate" <= '2019-04-01 00:00:00+00'::timestamp with time zone))
6. 0.000 0.000 ↓ 0.0

Index Scan using memberships_pkey on memberships m (cost=0.06..1.51 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (id = mp."membershipId")
7. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.01 rows=2 width=16) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on "membershipTypes" (cost=0.00..1.01 rows=2 width=16) (actual rows= loops=)

  • Filter: ((name)::text = ANY ('{ABO,BENEFACTOR_ABO}'::text[]))
9. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1,266.10 rows=65,024 width=180) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on "membershipPeriods" mps (cost=0.00..1,201.07 rows=65,024 width=180) (actual rows= loops=)

11.          

SubPlan (forNested Loop Left Join)

12. 0.000 0.000 ↓ 0.0

Index Scan using "memberships_userId_idx" on memberships (cost=0.06..4.06 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ("userId" = m."userId")