explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Eg3x : title

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 410.350 10,824.057 ↓ 1.0 7,857,928 1

Append (cost=271,076.20..1,042,970.05 rows=7,797,286 width=158) (actual time=2,186.007..10,824.057 rows=7,857,928 loops=1)

2. 713.261 10,411.049 ↓ 1.0 7,857,663 1

Subquery Scan on *SELECT* 1 (cost=271,076.20..1,042,549.55 rows=7,796,856 width=93) (actual time=2,186.006..10,411.049 rows=7,857,663 loops=1)

3. 1,256.124 9,697.788 ↓ 1.0 7,857,663 1

Hash Join (cost=271,076.20..945,088.85 rows=7,796,856 width=89) (actual time=2,186.006..9,697.788 rows=7,857,663 loops=1)

  • Hash Cond: (c.action = a.alp_action_id)
4. 3,799.509 8,441.654 ↓ 1.0 7,857,663 1

Hash Join (cost=271,075.09..908,522.05 rows=7,796,856 width=49) (actual time=2,185.981..8,441.654 rows=7,857,663 loops=1)

  • Hash Cond: (c.primary_doc_number = (t.primary_doc_number)::bpchar)
5. 2,457.397 2,457.397 ↓ 1.0 7,857,663 1

Seq Scan on alp_coupons c (cost=0.00..342,850.91 rows=7,796,856 width=30) (actual time=0.024..2,457.397 rows=7,857,663 loops=1)

  • Filter: ((points <> 0) AND ((coupon_status)::text = 'USED'::text))
  • Rows Removed by Filter: 2,487,664
6. 1,057.811 2,184.748 ↑ 1.0 5,351,204 1

Hash (cost=162,378.04..162,378.04 rows=5,351,204 width=33) (actual time=2,184.748..2,184.748 rows=5,351,204 loops=1)

  • Buckets: 65,536 Batches: 128 Memory Usage: 3,168kB
7. 1,126.937 1,126.937 ↑ 1.0 5,351,204 1

Seq Scan on alp_tickets t (cost=0.00..162,378.04 rows=5,351,204 width=33) (actual time=0.014..1,126.937 rows=5,351,204 loops=1)

8. 0.003 0.010 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=36) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.007 0.007 ↑ 1.0 5 1

Seq Scan on alp_actions a (cost=0.00..1.05 rows=5 width=36) (actual time=0.006..0.007 rows=5 loops=1)

10. 0.095 2.658 ↑ 1.6 265 1

Nested Loop (cost=12.51..416.20 rows=430 width=111) (actual time=0.133..2.658 rows=265 loops=1)

  • Join Filter: (c_1.user_id = a_1.agent_id)
11. 0.999 2.033 ↑ 1.1 265 1

Hash Join (cost=12.23..303.50 rows=289 width=48) (actual time=0.117..2.033 rows=265 loops=1)

  • Hash Cond: (u.agent_id = c_1.user_id)
12. 0.945 0.945 ↑ 1.0 8,630 1

Seq Scan on users u (cost=0.00..191.30 rows=8,630 width=24) (actual time=0.018..0.945 rows=8,630 loops=1)

13. 0.035 0.089 ↑ 1.0 289 1

Hash (cost=8.61..8.61 rows=289 width=24) (actual time=0.089..0.089 rows=289 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 24kB
14. 0.054 0.054 ↑ 1.0 289 1

Seq Scan on alp_charges c_1 (cost=0.00..8.61 rows=289 width=24) (actual time=0.005..0.054 rows=289 loops=1)

  • Filter: (is_automatic = '0'::bpchar)
15. 0.530 0.530 ↑ 1.0 1 265

Index Scan using agents_pkey on agents a_1 (cost=0.28..0.36 rows=1 width=15) (actual time=0.002..0.002 rows=1 loops=265)

  • Index Cond: (agent_id = u.agent_id)
Planning time : 2.594 ms
Execution time : 11,044.791 ms