explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wrpr : add index on iccid; set cpu_tuple_cost=0.01; set work_mem="32MB"

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 419.197 7,905.690 ↑ 6.8 3,290 1

HashAggregate (cost=247,894.20..248,172.83 rows=22,290 width=168) (actual time=7,902.917..7,905.690 rows=3,290 loops=1)

  • Group Key: sims.iccid, traffic_sessions.carrier_country_code, traffic_sessions.carrier_name
2. 594.915 7,486.493 ↑ 1.5 756,642 1

Hash Right Join (cost=380.00..231,389.03 rows=1,100,345 width=124) (actual time=1,145.651..7,486.493 rows=756,642 loops=1)

  • Hash Cond: (traffic_sessions.iccid = (sims.iccid)::text)
3. 6,859.525 6,859.525 ↑ 1.0 2,737,790 1

Seq Scan on traffic_sessions (cost=0.00..223,648.39 rows=2,801,956 width=47) (actual time=650.511..6,859.525 rows=2,737,790 loops=1)

  • Filter: (("end" >= '2019-10-01 06:00:00+00'::timestamp with time zone) AND ("end" < '2019-11-01 07:00:00+00'::timestamp with time zone))
  • Rows Removed by Filter: 3833703
4. 1.047 32.053 ↓ 1.4 3,108 1

Hash (cost=352.14..352.14 rows=2,229 width=97) (actual time=32.053..32.053 rows=3,108 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 420kB
5. 31.006 31.006 ↓ 1.4 3,108 1

Seq Scan on sims (cost=0.00..352.14 rows=2,229 width=97) (actual time=0.617..31.006 rows=3,108 loops=1)

  • Filter: ((NOT archived) AND (("clientSlug")::text = 'FOO'::text) AND (("providerSlug")::text = 'BAR'::text))
  • Rows Removed by Filter: 2568
Planning time : 8.991 ms