explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wgoN

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,924,346.21..13,924,346.22 rows=1 width=4) (actual rows= loops=)

  • Group Key: s.country_id, cu.country_id
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.01..13,924,346.20 rows=1 width=4) (actual rows= loops=)

  • Join Filter: (s.country_id = c.country_id)
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.01..13,924,339.44 rows=1 width=4) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..13,916,042.91 rows=5,180 width=10) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Seq Scan on logins l (cost=0.00..13,849,302.24 rows=60,538 width=24) (actual rows= loops=)

  • Filter: (success AND (created_at > (now() - '00:05:00'::interval)))
6. 0.000 0.000 ↓ 0.0

Index Scan using customers_pkey on customers cu (cost=0.43..1.09 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (customer_id = l.customer_id)
  • Filter: (country_id = 432)
7. 0.000 0.000 ↓ 0.0

Index Scan using sessions_pkey on sessions s (cost=0.57..1.59 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (session_id = l.session_id)
  • Filter: (created_at > (now() - '00:05:00'::interval))
8. 0.000 0.000 ↓ 0.0

Seq Scan on countries c (cost=0.00..3.56 rows=256 width=2) (actual rows= loops=)