explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CISO : Lookup by cycle, fast (for big table)

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 325.189 2,432.726 ↑ 1.4 3,100 1

HashAggregate (cost=160,589.26..160,645.11 rows=4,468 width=152) (actual time=2,431.179..2,432.726 rows=3,100 loops=1)

  • Group Key: sims.iccid, traffic_sessions.carrier_country_code
2. 128.775 2,107.537 ↓ 2.4 756,237 1

Nested Loop (cost=16,215.56..156,711.01 rows=310,260 width=116) (actual time=364.666..2,107.537 rows=756,237 loops=1)

3. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on cycles (cost=0.00..1.52 rows=1 width=4) (actual time=0.009..0.013 rows=1 loops=1)

  • Filter: (id = 29)
  • Rows Removed by Filter: 32
4. 356.709 1,978.749 ↓ 2.4 756,237 1

Hash Join (cost=16,215.56..153,606.88 rows=310,260 width=120) (actual time=364.654..1,978.749 rows=756,237 loops=1)

  • Hash Cond: (traffic_sessions.iccid = (sims.iccid)::text)
5. 1,260.930 1,598.091 ↑ 1.0 781,834 1

Bitmap Heap Scan on traffic_sessions (cost=15,835.36..151,152.60 rows=789,539 width=43) (actual time=340.320..1,598.091 rows=781,834 loops=1)

  • Recheck Cond: (cycle_id = 29)
  • Heap Blocks: exact=20004
6. 337.161 337.161 ↑ 1.0 781,834 1

Bitmap Index Scan on traffic_sessions_cycle_id_index (cost=0.00..15,637.98 rows=789,539 width=0) (actual time=337.161..337.161 rows=781,834 loops=1)

  • Index Cond: (cycle_id = 29)
7. 1.855 23.949 ↓ 1.4 3,114 1

Hash (cost=352.27..352.27 rows=2,234 width=97) (actual time=23.949..23.949 rows=3,114 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 420kB
8. 22.094 22.094 ↓ 1.4 3,114 1

Seq Scan on sims (cost=0.00..352.27 rows=2,234 width=97) (actual time=0.011..22.094 rows=3,114 loops=1)

  • Filter: ((NOT archived) AND (("clientSlug")::text = 'asdf'::text) AND (("providerSlug")::text = 'bell'::text))
  • Rows Removed by Filter: 2571
Planning time : 8.131 ms