explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6E4F

Settings
# exclusive inclusive rows x rows loops node
1. 0.099 1,010.312 ↑ 1.0 1,000 1

Limit (cost=0.11..866.46 rows=1,000 width=8) (actual time=982.512..1,010.312 rows=1,000 loops=1)

2. 0.263 1,010.213 ↑ 513.8 1,000 1

Nested Loop (cost=0.11..445,146.60 rows=513,822 width=8) (actual time=982.511..1,010.213 rows=1,000 loops=1)

  • Join Filter: (((pf.activity_type)::text = (activity_types."Name")::text) OR ((pf.activity_type)::text = 'ALL'::text))
3. 0.500 1,008.950 ↑ 513.8 1,000 1

Nested Loop (cost=0.09..426,785.15 rows=513,822 width=28) (actual time=982.493..1,008.950 rows=1,000 loops=1)

  • Join Filter: ((activities."activity_Role" = activity_roles.id) AND (((pf.activity_role)::text = (activity_roles."Name")::text) OR ((pf.activity_role)::text = 'ALL'::text)))
  • Rows Removed by Join Filter: 1000
4. 8.808 1,008.450 ↑ 542.9 1,000 1

Nested Loop (cost=0.09..422,211.06 rows=542,946 width=48) (actual time=982.474..1,008.450 rows=1,000 loops=1)

  • Join Filter: ((source_applications.id = activities."Source") AND (((pf.level)::text = activities.brand_text) OR ((pf.level)::text = 'ALL'::text)))
  • Rows Removed by Join Filter: 95199
5. 995.061 995.061 ↑ 442.6 1,527 1

Index Scan using cid_activities on activities (cost=0.09..168,763.42 rows=675,835 width=62) (actual time=306.517..995.061 rows=1,527 loops=1)

  • Index Cond: (cid > 1)
  • Filter: ((created_at > '2018-12-05 15:01:37'::timestamp without time zone) AND (status = 't'::text))
  • Rows Removed by Filter: 1496687
6. 4.348 4.581 ↑ 1.2 63 1,527

Materialize (cost=0.00..9.55 rows=75 width=29) (actual time=0.000..0.003 rows=63 loops=1,527)

7. 0.140 0.233 ↑ 1.2 63 1

Nested Loop (cost=0.00..9.47 rows=75 width=29) (actual time=0.033..0.233 rows=63 loops=1)

  • Join Filter: (((pf.source_application)::text = (source_applications."Name")::text) OR ((pf.source_application)::text = 'ALL'::text))
  • Rows Removed by Join Filter: 1134
8. 0.030 0.030 ↑ 1.0 63 1

Seq Scan on permission_firsts pf (cost=0.00..3.30 rows=63 width=25) (actual time=0.014..0.030 rows=63 loops=1)

  • Filter: ((channel)::text = 'Veeva_CRM'::text)
  • Rows Removed by Filter: 26
9. 0.053 0.063 ↓ 1.1 19 63

Materialize (cost=0.00..1.07 rows=18 width=48) (actual time=0.000..0.001 rows=19 loops=63)

10. 0.010 0.010 ↓ 1.1 19 1

Seq Scan on source_applications (cost=0.00..1.05 rows=18 width=48) (actual time=0.008..0.010 rows=19 loops=1)

11. 0.000 0.000 ↑ 1.0 2 1,000

Materialize (cost=0.00..1.01 rows=2 width=48) (actual time=0.000..0.000 rows=2 loops=1,000)

12. 0.006 0.006 ↑ 1.0 2 1

Seq Scan on activity_roles (cost=0.00..1.01 rows=2 width=48) (actual time=0.006..0.006 rows=2 loops=1)

13. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using index_activity_types_on_id on activity_types (cost=0.03..0.03 rows=1 width=48) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = activities."Type")