explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IMQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 0.134 ↓ 10.0 10 1

Nested Loop Semi Join (cost=20.43..33.36 rows=1 width=1,161) (actual time=0.113..0.134 rows=10 loops=1)

  • Join Filter: (b.id = (max(tb_campaign_history.id)))
  • Rows Removed by Join Filter: 50
2. 0.019 0.101 ↓ 10.0 10 1

Hash Join (cost=9.53..20.51 rows=1 width=1,169) (actual time=0.096..0.101 rows=10 loops=1)

  • Hash Cond: ((b.campaign_id)::text = (a.id)::text)
3. 0.060 0.060 ↑ 5.4 11 1

Seq Scan on tb_campaign_history b (cost=0.00..10.75 rows=59 width=1,091) (actual time=0.055..0.060 rows=11 loops=1)

  • Filter: ((status)::text <> 'deleted'::text)
4. 0.007 0.022 ↓ 5.0 10 1

Hash (cost=9.50..9.50 rows=2 width=156) (actual time=0.022..0.022 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
5. 0.006 0.015 ↓ 5.0 10 1

Bitmap Heap Scan on tb_campaign a (cost=4.16..9.50 rows=2 width=156) (actual time=0.014..0.015 rows=10 loops=1)

  • Recheck Cond: ((user_id)::text = '7HpzKrcKpKaB7v2Wwj2w2V'::text)
  • Heap Blocks: exact=1
6. 0.009 0.009 ↓ 5.0 10 1

Bitmap Index Scan on ix_campaign_user_id (cost=0.00..4.16 rows=2 width=0) (actual time=0.009..0.009 rows=10 loops=1)

  • Index Cond: ((user_id)::text = '7HpzKrcKpKaB7v2Wwj2w2V'::text)
7. 0.016 0.020 ↑ 10.0 6 10

HashAggregate (cost=10.90..11.50 rows=60 width=86) (actual time=0.001..0.002 rows=6 loops=10)

  • Group Key: tb_campaign_history.campaign_id
8. 0.004 0.004 ↑ 5.5 11 1

Seq Scan on tb_campaign_history (cost=0.00..10.60 rows=60 width=86) (actual time=0.002..0.004 rows=11 loops=1)