explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EBos

Settings
# exclusive inclusive rows x rows loops node
1. 5.262 62.877 ↑ 1.4 5 1

HashAggregate (cost=17,626.15..17,626.22 rows=7 width=15) (actual time=62.874..62.877 rows=5 loops=1)

  • Group Key: o.media_subtype
2. 0.409 57.615 ↓ 2.7 9,113 1

Nested Loop (cost=1,213.82..17,458.60 rows=3,351 width=11) (actual time=0.990..57.615 rows=9,113 loops=1)

3. 0.026 0.026 ↑ 1.0 1 1

Index Only Scan using projects_pkey on projects p (cost=2.85..4.89 rows=1 width=4) (actual time=0.023..0.026 rows=1 loops=1)

  • Index Cond: (id = 7311)
  • Heap Fetches: 1
4. 10.271 57.180 ↓ 2.7 9,113 1

Gather (cost=1,210.97..17,420.20 rows=3,351 width=15) (actual time=0.964..57.180 rows=9,113 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 4.241 46.909 ↓ 2.3 4,556 2

Hash Left Join (cost=210.97..16,085.10 rows=1,971 width=15) (actual time=0.196..46.909 rows=4,556 loops=2)

  • Hash Cond: (a.outlet_id = ot.outlet_id)
  • Filter: ((ot.id IS NULL) OR (ot.tier_type = ANY ('{1,2}'::integer[])))
6. 25.979 42.619 ↓ 2.3 4,556 2

Nested Loop (cost=4.22..15,826.61 rows=1,971 width=19) (actual time=0.102..42.619 rows=4,556 loops=2)

7. 3.642 16.636 ↓ 2.3 4,556 2

Append (cost=0.00..3,787.04 rows=1,976 width=12) (actual time=0.045..16.636 rows=4,556 loops=2)

8. 0.001 0.001 ↓ 0.0 0 2

Parallel Seq Scan on articles a (cost=0.00..0.00 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=2)

  • Filter: (active AND (published_at >= '2019-05-06 00:00:00'::timestamp without time zone) AND (published_at <= '2019-06-06 23:59:59.999'::timestamp without time zone) AND (project_id = 7311) AND (sentiment = ANY ('{-1,-2,0,1,2}'::double precision[])))
9. 12.747 12.747 ↓ 2.6 4,474 2

Parallel Index Scan using articles_2019_05_project_id_idx on articles_2019_05 a_1 (cost=4.38..3,364.53 rows=1,754 width=12) (actual time=0.043..12.747 rows=4,474 loops=2)

  • Index Cond: (project_id = 7311)
  • Filter: (active AND (published_at >= '2019-05-06 00:00:00'::timestamp without time zone) AND (published_at <= '2019-06-06 23:59:59.999'::timestamp without time zone) AND (sentiment = ANY ('{-1,-2,0,1,2}'::double precision[])))
  • Rows Removed by Filter: 2879
10. 0.246 0.246 ↑ 2.7 83 2

Parallel Index Scan using articles_2019_06_project_id_idx on articles_2019_06 a_2 (cost=4.30..422.50 rows=221 width=12) (actual time=0.033..0.246 rows=83 loops=2)

  • Index Cond: (project_id = 7311)
  • Filter: (active AND (published_at >= '2019-05-06 00:00:00'::timestamp without time zone) AND (published_at <= '2019-06-06 23:59:59.999'::timestamp without time zone) AND (sentiment = ANY ('{-1,-2,0,1,2}'::double precision[])))
11. 0.004 0.004 ↑ 1.0 1 9,113

Index Scan using outlets_pkey on outlets o (cost=4.22..6.09 rows=1 width=11) (actual time=0.004..0.004 rows=1 loops=9,113)

  • Index Cond: (id = a.outlet_id)
  • Filter: (active AND ((media_subtype)::text = ANY ('{tv,radio,newspaper,magazine,website,blogs}'::text[])))
12. 0.004 0.049 ↑ 444.0 1 2

Hash (cost=191.21..191.21 rows=444 width=12) (actual time=0.048..0.049 rows=1 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.045 0.045 ↑ 444.0 1 2

Index Scan using index_outlet_tiers_on_project_id on outlet_tiers ot (cost=4.22..191.21 rows=444 width=12) (actual time=0.044..0.045 rows=1 loops=2)

  • Index Cond: (project_id = 7311)
  • Filter: active
  • Rows Removed by Filter: 2
Planning time : 10.217 ms