explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mpBE

Settings
# exclusive inclusive rows x rows loops node
1. 17.046 1,950.052 ↑ 196.4 20 1

GroupAggregate (cost=42,682.00..43,045.43 rows=3,929 width=517) (actual time=1,928.379..1,950.052 rows=20 loops=1)

  • Group Key: tenants.name, audiences.audience_id, audience_touchpoints.audience_touchpoint_id, audiences.name, audiences.full_description, audiences.any_or_all, audiences.service_status_group, ((audiences.service_groups)::text), audiences.special_conditions, audience_touchpoints.name, audience_touchpoints.full_description, audience_touchpoints.is_cross_sell, ((audience_touchpoints.cross_sell_priorities)::text), audience_touchpoints.wait_time, audience_touchpoints.wait_type, audience_touchpoints.trigger_event, templates.template_name, templates.template_id, templates.is_active, templates.template_type, templates.modification_date, templates.communication_category, templates.alternative_template_id, templates.no_duplication_within_days_limit, templates.days_offset_for_conversion, audiences.updated_at, audience_touchpoints.updated_at
2. 412.703 1,933.006 ↓ 5.1 20,098 1

Sort (cost=42,682.00..42,691.82 rows=3,929 width=516) (actual time=1,927.451..1,933.006 rows=20,098 loops=1)

  • Sort Key: tenants.name, audiences.audience_id, audience_touchpoints.audience_touchpoint_id, audiences.name, audiences.full_description, audiences.any_or_all, audiences.service_status_group, ((audiences.service_groups)::text), audiences.special_conditions, audience_touchpoints.name, audience_touchpoints.full_description, audience_touchpoints.is_cross_sell, ((audience_touchpoints.cross_sell_priorities)::text), audience_touchpoints.wait_time, audience_touchpoints.wait_type, audience_touchpoints.trigger_event, templates.template_name, templates.template_id, templates.is_active, templates.template_type, templates.modification_date, templates.communication_category, templates.alternative_template_id, templates.no_duplication_within_days_limit, templates.days_offset_for_conversion, audiences.updated_at, audience_touchpoints.updated_at
  • Sort Method: external merge Disk: 9768kB
3. 30.441 1,520.303 ↓ 5.1 20,098 1

Nested Loop (cost=2,806.30..42,447.44 rows=3,929 width=516) (actual time=58.275..1,520.303 rows=20,098 loops=1)

4. 0.143 1.466 ↓ 2.0 26 1

Nested Loop Left Join (cost=0.28..377.80 rows=13 width=854) (actual time=0.406..1.466 rows=26 loops=1)

  • Join Filter: (((audience_touchpoints.tenant_key)::text = (audiences.tenant_key)::text) AND ((audience_touchpoints.audience_id)::text = (audiences.audience_id)::text))
  • Rows Removed by Join Filter: 312
5. 0.010 0.371 ↓ 1.1 14 1

Nested Loop (cost=0.00..102.34 rows=13 width=628) (actual time=0.042..0.371 rows=14 loops=1)

6. 0.031 0.031 ↑ 1.0 1 1

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

  • Filter: ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text)
  • Rows Removed by Filter: 79
7. 0.330 0.330 ↓ 1.1 14 1

Seq Scan on audiences (cost=0.00..88.31 rows=13 width=608) (actual time=0.023..0.330 rows=14 loops=1)

  • Filter: ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text)
  • Rows Removed by Filter: 765
8. 0.067 0.952 ↓ 2.0 24 14

Materialize (cost=0.28..272.75 rows=12 width=292) (actual time=0.003..0.068 rows=24 loops=14)

9. 0.022 0.885 ↓ 2.0 24 1

Nested Loop Left Join (cost=0.28..272.69 rows=12 width=292) (actual time=0.033..0.885 rows=24 loops=1)

10. 0.767 0.767 ↓ 2.0 24 1

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

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

Index Scan using pk_templates on templates (cost=0.28..8.30 rows=1 width=148) (actual time=0.004..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))
12. 185.354 1,488.396 ↓ 7.2 773 26

Bitmap Heap Scan on communications (cost=2,806.02..3,232.03 rows=107 width=74) (actual time=51.090..57.246 rows=773 loops=26)

  • Recheck Cond: (((audience_id)::text = (audiences.audience_id)::text) AND ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text))
  • Rows Removed by Index Recheck: 21213
  • Heap Blocks: exact=6513 lossy=31924
13. 154.700 1,303.042 ↓ 0.0 0 26

BitmapAnd (cost=2,806.02..2,806.02 rows=107 width=0) (actual time=50.117..50.117 rows=0 loops=26)

14. 1,052.844 1,052.844 ↓ 7.9 291,606 26

Bitmap Index Scan on ix_communications__audience_id (cost=0.00..806.59 rows=36,800 width=0) (actual time=40.494..40.494 rows=291,606 loops=26)

  • Index Cond: ((audience_id)::text = (audiences.audience_id)::text)
15. 95.498 95.498 ↑ 1.1 32,885 26

Bitmap Index Scan on ix_communications_tenant_key_template_id (cost=0.00..1,990.04 rows=36,464 width=0) (actual time=3.673..3.673 rows=32,885 loops=26)

  • Index Cond: ((tenant_key)::text = 'bc9b6486574055acaa73c836099c812c7130df01dadee779ccb903513dba97f1'::text)
Planning time : 1.325 ms
Execution time : 1,952.063 ms