explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NDyO : Optimization for: plan #mF9I

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 27.196 2,511.280 ↑ 1.0 500,000 1

Limit (cost=47.25..709,318.70 rows=500,000 width=146) (actual time=0.041..2,511.280 rows=500,000 loops=1)

2. 1,161.284 2,484.084 ↑ 3.3 500,000 1

Merge Join (cost=47.25..2,352,902.07 rows=1,658,642 width=146) (actual time=0.041..2,484.084 rows=500,000 loops=1)

  • Merge Cond: (tkts.tem_registro_consumo_id = bcr.id)
  • Join Filter: (((tkts.last_update > bcr.last_update) AND (tkts.last_update > '2018-01-01 00:00:00'::timestamp without time zone)) OR (((tkts.last_update <= bcr.last_update) OR (tkts.last_update IS NULL)) AND (bcr.last_update > '2018-01-01 00:00:00'::timestamp without time zone)))
3. 252.575 252.575 ↑ 11.9 500,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..252.575 rows=500,000 loops=1)

  • Filter: (COALESCE(id_tem_bill_ivn_central, (-1)) > 0)
4. 1,070.225 1,070.225 ↑ 36.0 500,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..1,070.225 rows=500,000 loops=1)

  • Filter: ((status)::text = 'CHAMADA_TARIFADA'::text)
  • Rows Removed by Filter: 1518796