explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HyKh

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 48,178.915 ↓ 1.1 41 1

Sort (cost=1,575,555,184,068.74..1,575,555,184,068.83 rows=39 width=20) (actual time=48,178.913..48,178.915 rows=41 loops=1)

  • Sort Key: orders.campaign_id
  • Sort Method: quicksort Memory: 26kB
2. 1,560.612 48,178.898 ↓ 1.1 41 1

HashAggregate (cost=1,575,555,184,067.12..1,575,555,184,067.71 rows=39 width=20) (actual time=48,178.878..48,178.898 rows=41 loops=1)

  • Group Key: orders.campaign_id
3. 1,162.915 46,618.286 ↑ 97,987,749.2 1,283,309 1

Nested Loop (cost=1,252.27..3,698,177,798.12 rows=125,748,560,501,520 width=20) (actual time=0.634..46,618.286 rows=1,283,309 loops=1)

4. 619.449 3,508.292 ↑ 1.1 1,446,451 1

Hash Join (cost=1,251.70..324,589.87 rows=1,624,788 width=25) (actual time=0.609..3,508.292 rows=1,446,451 loops=1)

  • Hash Cond: (orders.campaign_id = campaigns.id)
5. 2,888.254 2,888.254 ↑ 1.0 1,605,476 1

Seq Scan on orders (cost=0.00..302,271.68 rows=1,624,788 width=25) (actual time=0.010..2,888.254 rows=1,605,476 loops=1)

  • Filter: ((action_id IS NOT NULL) AND (campaign_id > 0) AND ((action_id)::text <> '-1'::text) AND ((action_id)::text <> ''::text) AND ((action_id)::text <> 'NONE'::text))
  • Rows Removed by Filter: 1999491
6. 0.051 0.589 ↑ 1.0 188 1

Hash (cost=1,249.35..1,249.35 rows=188 width=4) (actual time=0.589..0.589 rows=188 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
7. 0.538 0.538 ↑ 1.0 188 1

Index Scan using campaigns_pkey on campaigns (cost=0.27..1,249.35 rows=188 width=4) (actual time=0.004..0.538 rows=188 loops=1)

  • Filter: (status = 1)
  • Rows Removed by Filter: 16
8. 41,947.079 41,947.079 ↑ 82,627.0 1 1,446,451

Index Scan using order_actions_action_id_idx on order_actions (cost=0.57..1,449.63 rows=82,627 width=13) (actual time=0.029..0.029 rows=1 loops=1,446,451)

  • Index Cond: ((action_id)::text = (orders.action_id)::text)
Planning time : 1.374 ms
Execution time : 48,179.008 ms