explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zWgl : Optimization for: plan #kZcq

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 62.184 22,541.911 ↓ 1.1 1,100,000 1

Limit (cost=47.25..2,323,876.83 rows=995,225 width=146) (actual time=0.038..22,541.911 rows=1,100,000 loops=1)

2. 3,100.347 22,479.727 ↓ 1.1 1,100,000 1

Merge Join (cost=47.25..2,323,876.83 rows=995,225 width=146) (actual time=0.038..22,479.727 rows=1,100,000 loops=1)

  • Merge Cond: (tkts.tem_registro_consumo_id = bcr.id)
  • Join Filter: (to_char(CASE WHEN (tkts.last_update > bcr.last_update) THEN tkts.last_update ELSE bcr.last_update END, 'yyyymmdd'::text) >= '20180301'::text)
3. 1,260.000 1,260.000 ↑ 5.4 1,100,000 1

Index Scan using idx_bill_ticket_call_rec on bill_tickets tkts (cost=0.44..616,495.91 rows=5,961,415 width=48) (actual time=0.009..1,260.000 rows=1,100,000 loops=1)

  • Filter: (COALESCE(id_tem_bill_ivn_central, (-1)) > 0)
4. 18,119.380 18,119.380 ↑ 16.4 1,100,000 1

Index Scan using pk_bill_call_records on tem_registro_consumo bcr (cost=0.56..1,563,202.45 rows=18,012,607 width=102) (actual time=0.009..18,119.380 rows=1,100,000 loops=1)

  • Filter: ((status)::text = 'CHAMADA_TARIFADA'::text)
  • Rows Removed by Filter: 3,311,349"Total runtime: 22,573.206 ms