explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kRys

Settings
# exclusive inclusive rows x rows loops node
1. 0.040 0.263 ↑ 1.1 13 1

Hash Join (cost=5.46..7.15 rows=14 width=109) (actual time=0.247..0.263 rows=13 loops=1)

  • Hash Cond: ((a.id)::text = (b.campaign_id)::text)
2.          

CTE temp

3. 0.005 0.112 ↑ 1.0 14 1

Limit (cost=3.10..3.14 rows=14 width=8) (actual time=0.108..0.112 rows=14 loops=1)

4. 0.069 0.107 ↑ 1.0 34 1

Sort (cost=3.05..3.14 rows=34 width=8) (actual time=0.103..0.107 rows=34 loops=1)

  • Sort Key: x.z DESC
  • Sort Method: quicksort Memory: 26kB
5. 0.003 0.038 ↑ 1.0 34 1

Subquery Scan on x (cost=1.51..2.19 rows=34 width=8) (actual time=0.032..0.038 rows=34 loops=1)

6. 0.027 0.035 ↑ 1.0 34 1

HashAggregate (cost=1.51..1.85 rows=34 width=31) (actual time=0.032..0.035 rows=34 loops=1)

  • Group Key: tb_campaign_history.campaign_id
7. 0.008 0.008 ↑ 1.0 34 1

Seq Scan on tb_campaign_history (cost=0.00..1.34 rows=34 width=31) (actual time=0.003..0.008 rows=34 loops=1)

8. 0.025 0.025 ↑ 1.0 33 1

Seq Scan on tb_campaign a (cost=0.00..1.43 rows=33 width=46) (actual time=0.019..0.025 rows=33 loops=1)

  • Filter: ((user_id)::text = 'nM96knagmioNERVXoUrR9n'::text)
  • Rows Removed by Filter: 1
9. 0.016 0.198 ↑ 1.0 14 1

Hash (cost=2.15..2.15 rows=14 width=86) (actual time=0.198..0.198 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.032 0.182 ↑ 1.0 14 1

Hash Join (cost=0.46..2.15 rows=14 width=86) (actual time=0.157..0.182 rows=14 loops=1)

  • Hash Cond: (b.id = temp.z)
11. 0.027 0.027 ↑ 1.0 34 1

Seq Scan on tb_campaign_history b (cost=0.00..1.43 rows=34 width=94) (actual time=0.011..0.027 rows=34 loops=1)

  • Filter: ((status)::text <> 'deleted'::text)
12. 0.006 0.123 ↑ 1.0 14 1

Hash (cost=0.28..0.28 rows=14 width=8) (actual time=0.123..0.123 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.117 0.117 ↑ 1.0 14 1

CTE Scan on temp (cost=0.00..0.28 rows=14 width=8) (actual time=0.109..0.117 rows=14 loops=1)