explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JP5

Settings
# exclusive inclusive rows x rows loops node
1. 11,163.652 11,163.652 ↑ 2.4 38,405 1

CTE Scan on base_lana (cost=42,872.75..44,717.49 rows=92,237 width=532) (actual time=103.726..11,163.652 rows=38,405 loops=1)

2.          

CTE analytics_base

3. 2.060 2.060 ↓ 1,162.0 1,162 1

Index Scan using "goals_ga:eventCategory_idx" on goals (cost=0.42..8.34 rows=1 width=198) (actual time=0.074..2.060 rows=1,162 loops=1)

  • Index Cond: ("ga:eventCategory" = 'simulador-completo:passo3'::text)
4.          

CTE base_lana

5. 8,314.312 11,113.212 ↑ 2.4 38,405 1

Hash Left Join (cost=12,838.47..42,864.41 rows=92,237 width=310) (actual time=103.723..11,113.212 rows=38,405 loops=1)

  • Hash Cond: ((leads.raw_data ->> 'guid_c'::text) = dm_goals.guid)
6. 1,240.783 2,795.834 ↑ 2.4 38,403 1

Merge Left Join (cost=12,838.44..35,254.79 rows=92,237 width=2,940) (actual time=100.349..2,795.834 rows=38,403 loops=1)

  • Merge Cond: ((leads.raw_data ->> 'opportunity_id'::text) = ((opportunities.id)::text))
7. 1,401.165 1,401.165 ↓ 2.0 38,403 1

Index Scan using leads_expr_idx1 on leads (cost=0.29..20,390.72 rows=19,332 width=1,587) (actual time=0.076..1,401.165 rows=38,403 loops=1)

  • Filter: (((raw_data ->> 'deleted'::text))::boolean IS FALSE)
8. 2.628 153.886 ↓ 1.0 14,486 1

Materialize (cost=12,838.15..12,910.53 rows=14,476 width=1,353) (actual time=100.230..153.886 rows=14,486 loops=1)

9. 139.341 151.258 ↓ 1.0 14,486 1

Sort (cost=12,838.15..12,874.34 rows=14,476 width=1,353) (actual time=100.227..151.258 rows=14,486 loops=1)

  • Sort Key: ((opportunities.id)::text)
  • Sort Method: external merge Disk: 19824kB
10. 11.917 11.917 ↓ 1.0 14,486 1

Seq Scan on opportunities (cost=0.00..3,276.76 rows=14,476 width=1,353) (actual time=0.014..11.917 rows=14,486 loops=1)

11. 0.258 3.066 ↓ 1,162.0 1,162 1

Hash (cost=0.02..0.02 rows=1 width=100) (actual time=3.066..3.066 rows=1,162 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 129kB
12. 2.808 2.808 ↓ 1,162.0 1,162 1

CTE Scan on analytics_base dm_goals (cost=0.00..0.02 rows=1 width=100) (actual time=0.078..2.808 rows=1,162 loops=1)