explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nPHa

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=5,921,842.55..5,921,842.57 rows=6 width=231) (never executed)

  • Sort Key: (max((t1.fecha_hora)::date))
2. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=5,921,842.34..5,921,842.47 rows=6 width=231) (never executed)

  • Group Key: o.oficina, l.localidad
3. 0.000 0.000 ↓ 0.0

Sort (cost=5,921,842.34..5,921,842.35 rows=6 width=235) (never executed)

  • Sort Key: o.oficina, l.localidad
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..5,921,842.26 rows=6 width=235) (never executed)

5. 0.000 0.000 ↓ 0.0

Seq Scan on localidad l (cost=0..1.36 rows=36 width=182) (never executed)

6. 0.000 0.000 ↓ 0.0

Materialize (cost=0.42..5,921,837.68 rows=6 width=61) (never executed)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..5,921,837.65 rows=6 width=61) (never executed)

8. 0.000 0.000 ↓ 0.0

Seq Scan on oficina o (cost=0..6.8 rows=1 width=57) (never executed)

  • Filter: (o.id = 141)
9. 0.000 0.000 ↓ 0.0

Index Scan using idx_e79767628a8639b7 on turno t1 (cost=0.42..5,921,830.79 rows=6 width=12) (never executed)

  • Index Cond: (t1.oficina_id = 141)
  • Filter: ((((SubPlan 1) / (SubPlan 2)) * 1) = 1)
10.          

SubPlan (for Index Scan)

11. 0.000 0.000 ↓ 0.0

Aggregate (cost=2,625.54..2,625.55 rows=1 width=8) (never executed)

12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on turno t2 (cost=32.84..2,625.54 rows=2 width=4) (never executed)

  • Filter: ((t2.persona_id IS NOT NULL) AND ((t2.fecha_hora)::date = (t1.fecha_hora)::date))
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_e79767628a8639b7 (cost=0..32.84 rows=1,655 width=0) (never executed)

  • Index Cond: (t2.oficina_id = t1.oficina_id)
14. 0.000 0.000 ↓ 0.0

Aggregate (cost=2,625.56..2,625.57 rows=1 width=8) (never executed)

15. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on turno t2_1 (cost=32.84..2,625.54 rows=8 width=4) (never executed)

  • Filter: ((t2_1.fecha_hora)::date = (t1.fecha_hora)::date)
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_e79767628a8639b7 (cost=0..32.84 rows=1,655 width=0) (never executed)

  • Index Cond: (t2_1.oficina_id = t1.oficina_id)