explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oJVG

Settings
# exclusive inclusive rows x rows loops node
1. 12,352.081 21,557.710 ↑ 466,719.0 224 1

Nested Loop (cost=15,676.96..3,214,820.59 rows=104,545,056 width=181) (actual time=93.077..21,557.710 rows=224 loops=1)

  • Join Filter: CASE WHEN (x3.id IS NOT NULL) THEN (x3.id = x4.target_ad_group_id) ELSE NULL::boolean END
  • Rows Removed by Join Filter: 210,249,312
2. 555.088 758.103 ↓ 1.0 938,614 1

Hash Right Join (cost=15,676.96..78,464.11 rows=933,438 width=173) (actual time=89.392..758.103 rows=938,614 loops=1)

  • Hash Cond: (x3.campaign_id = x2.id)
3. 114.142 114.142 ↓ 1.0 933,449 1

Seq Scan on ad_groups x3 (cost=0.00..23,877.38 rows=933,438 width=72) (actual time=0.012..114.142 rows=933,449 loops=1)

4. 64.602 88.873 ↓ 1.0 268,587 1

Hash (cost=8,122.76..8,122.76 rows=268,576 width=101) (actual time=88.872..88.873 rows=268,587 loops=1)

  • Buckets: 65,536 Batches: 8 Memory Usage: 5,117kB
5. 24.271 24.271 ↓ 1.0 268,587 1

Seq Scan on campaigns x2 (cost=0.00..8,122.76 rows=268,576 width=101) (actual time=0.006..24.271 rows=268,587 loops=1)

6. 8,447.501 8,447.526 ↑ 1.0 224 938,614

Materialize (cost=0.00..5.36 rows=224 width=8) (actual time=0.000..0.009 rows=224 loops=938,614)

7. 0.025 0.025 ↑ 1.0 224 1

Seq Scan on ad_group_links x4 (cost=0.00..4.24 rows=224 width=8) (actual time=0.006..0.025 rows=224 loops=1)

Planning time : 1.075 ms
Execution time : 21,557.859 ms