explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lGfi

Settings
# exclusive inclusive rows x rows loops node
1. 0.098 1,014.917 ↑ 1.0 1,000 1

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

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

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

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

Nested Loop (cost=0.09..426,785.15 rows=513,822 width=28) (actual time=986.771..1,013.556 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.973 1,013.057 ↑ 542.9 1,000 1

Nested Loop (cost=0.09..422,211.06 rows=542,946 width=48) (actual time=986.752..1,013.057 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. 999.503 999.503 ↑ 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=305.279..999.503 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.343 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.147 0.238 ↑ 1.2 63 1

Nested Loop (cost=0.00..9.47 rows=75 width=29) (actual time=0.031..0.238 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.028 0.028 ↑ 1.0 63 1

Seq Scan on permission_firsts pf (cost=0.00..3.30 rows=63 width=25) (actual time=0.013..0.028 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.007..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.007 0.007 ↑ 1.0 2 1

Seq Scan on activity_roles (cost=0.00..1.01 rows=2 width=48) (actual time=0.007..0.007 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")