explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bdXZn

Settings
# exclusive inclusive rows x rows loops node
1. 1.611 17.151 ↓ 4.0 16 1

GroupAggregate (cost=1,158.30..1,158.41 rows=4 width=46) (actual time=15.367..17.151 rows=16 loops=1)

  • Group Key: tenants.name, audiences.audience_id, audience_touchpoints.audience_touchpoint_id, templates.template_id, templates.template_type
2. 5.947 15.540 ↓ 1,675.5 6,702 1

Sort (cost=1,158.30..1,158.31 rows=4 width=45) (actual time=15.122..15.540 rows=6,702 loops=1)

  • Sort Key: tenants.name, audiences.audience_id, audience_touchpoints.audience_touchpoint_id, templates.template_id, templates.template_type
  • Sort Method: quicksort Memory: 995kB
3. 0.632 9.593 ↓ 1,675.5 6,702 1

Nested Loop (cost=1.12..1,158.26 rows=4 width=45) (actual time=0.079..9.593 rows=6,702 loops=1)

4. 0.007 1.017 ↓ 6.0 24 1

Nested Loop Left Join (cost=0.56..259.77 rows=4 width=104) (actual time=0.061..1.017 rows=24 loops=1)

5. 0.003 0.914 ↓ 6.0 24 1

Nested Loop (cost=0.28..226.51 rows=4 width=94) (actual time=0.050..0.914 rows=24 loops=1)

6. 0.029 0.029 ↑ 1.0 1 1

Seq Scan on tenants (cost=0.00..13.90 rows=1 width=85) (actual time=0.018..0.029 rows=1 loops=1)

  • Filter: ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text)
  • Rows Removed by Filter: 79
7. 0.019 0.882 ↓ 6.0 24 1

Nested Loop (cost=0.28..212.57 rows=4 width=138) (actual time=0.031..0.882 rows=24 loops=1)

8. 0.767 0.767 ↓ 2.0 24 1

Seq Scan on audience_touchpoints (cost=0.00..172.91 rows=12 width=72) (actual time=0.017..0.767 rows=24 loops=1)

  • Filter: ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text)
  • Rows Removed by Filter: 2612
9. 0.096 0.096 ↑ 1.0 1 24

Index Only Scan using pk_audiences on audiences (cost=0.28..3.29 rows=1 width=66) (actual time=0.004..0.004 rows=1 loops=24)

  • Index Cond: ((audience_id = (audience_touchpoints.audience_id)::text) AND (tenant_key = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text))
  • Heap Fetches: 2
10. 0.096 0.096 ↑ 1.0 1 24

Index Scan using pk_templates on templates (cost=0.28..8.30 rows=1 width=77) (actual time=0.003..0.004 rows=1 loops=24)

  • Index Cond: (((audience_touchpoints.template_id)::text = (template_id)::text) AND ((audience_touchpoints.tenant_key)::text = (tenant_key)::text) AND ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text))
11. 7.944 7.944 ↓ 279.0 279 24

Index Scan using ix_communications__audience_touchpoint_id on communications (cost=0.56..224.61 rows=1 width=77) (actual time=0.011..0.331 rows=279 loops=24)

  • Index Cond: (((audience_touchpoint_id)::text = (audience_touchpoints.audience_touchpoint_id)::text) AND ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text))
  • Filter: ((audience_touchpoints.audience_id)::text = (audience_id)::text)