explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qhaK

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 1.347 ↓ 0.0 0 1

HashAggregate (cost=54,562,541.26..54,562,541.30 rows=4 width=8) (actual time=1.347..1.347 rows=0 loops=1)

  • Group Key: t_escala_item.escala_item_pk
2. 0.004 1.341 ↓ 0.0 0 1

HashAggregate (cost=54,562,541.17..54,562,541.21 rows=4 width=8) (actual time=1.341..1.341 rows=0 loops=1)

  • Group Key: t_escala_item.escala_item_pk
3. 0.004 1.337 ↓ 0.0 0 1

Append (cost=11.30..54,562,541.16 rows=4 width=8) (actual time=1.337..1.337 rows=0 loops=1)

4. 0.016 0.746 ↓ 0.0 0 1

Nested Loop (cost=11.30..27,281,270.56 rows=2 width=8) (actual time=0.746..0.746 rows=0 loops=1)

5. 0.027 0.027 ↑ 2.0 1 1

Index Scan using idx_epontows_tfunciohora_funccontrafk on t_funcionario_horario (cost=0.29..11.24 rows=2 width=8) (actual time=0.024..0.027 rows=1 loops=1)

  • Index Cond: (funcionario_contrato_fk = 274)
6. 0.550 0.703 ↓ 0.0 0 1

Bitmap Heap Scan on t_escala_item (cost=11.01..13,640,629.65 rows=1 width=16) (actual time=0.703..0.703 rows=0 loops=1)

  • Recheck Cond: (funcionario_horario_fk = t_funcionario_horario.funcionario_horario_pk)
  • Filter: (((entrada)::date >= '2020-08-01'::date) AND ((entrada)::date <= '2020-08-30'::date) AND (NOT (SubPlan 2)))
  • Rows Removed by Filter: 676
  • Heap Blocks: exact=100
7. 0.153 0.153 ↓ 2.0 676 1

Bitmap Index Scan on xak01_escala_item (cost=0.00..11.01 rows=344 width=0) (actual time=0.153..0.153 rows=676 loops=1)

  • Index Cond: (funcionario_horario_fk = t_funcionario_horario.funcionario_horario_pk)
8.          

SubPlan (for Bitmap Heap Scan)

9. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..74,358.04 rows=1,976,251 width=8) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_batida_rel_escala t_batida_rel_escala_1 (cost=0.00..56,756.79 rows=1,976,251 width=8) (never executed)

  • Filter: (batida_1 IS NOT NULL)
11. 0.015 0.587 ↓ 0.0 0 1

Nested Loop (cost=11.30..27,281,270.56 rows=2 width=8) (actual time=0.587..0.587 rows=0 loops=1)

12. 0.013 0.013 ↑ 2.0 1 1

Index Scan using idx_epontows_tfunciohora_funccontrafk on t_funcionario_horario t_funcionario_horario_1 (cost=0.29..11.24 rows=2 width=8) (actual time=0.010..0.013 rows=1 loops=1)

  • Index Cond: (funcionario_contrato_fk = 274)
13. 0.436 0.559 ↓ 0.0 0 1

Bitmap Heap Scan on t_escala_item t_escala_item_1 (cost=11.01..13,640,629.65 rows=1 width=16) (actual time=0.559..0.559 rows=0 loops=1)

  • Recheck Cond: (funcionario_horario_fk = t_funcionario_horario_1.funcionario_horario_pk)
  • Filter: (((saida)::date >= '2020-08-01'::date) AND ((saida)::date <= '2020-08-30'::date) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 676
  • Heap Blocks: exact=100
14. 0.123 0.123 ↓ 2.0 676 1

Bitmap Index Scan on xak01_escala_item (cost=0.00..11.01 rows=344 width=0) (actual time=0.123..0.123 rows=676 loops=1)

  • Index Cond: (funcionario_horario_fk = t_funcionario_horario_1.funcionario_horario_pk)
15.          

SubPlan (for Bitmap Heap Scan)

16. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..74,358.04 rows=1,976,251 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_batida_rel_escala (cost=0.00..56,756.79 rows=1,976,251 width=8) (never executed)

  • Filter: (batida_1 IS NOT NULL)
Planning time : 1.490 ms
Execution time : 1.582 ms