explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cQOx

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 5.318 ↓ 0.0 0 1

HashAggregate (cost=54,608,697.46..54,608,697.50 rows=4 width=8) (actual time=5.318..5.318 rows=0 loops=1)

  • Group Key: t_escala_item.escala_item_pk
2. 0.003 5.314 ↓ 0.0 0 1

HashAggregate (cost=54,608,697.37..54,608,697.41 rows=4 width=8) (actual time=5.314..5.314 rows=0 loops=1)

  • Group Key: t_escala_item.escala_item_pk
3. 0.006 5.311 ↓ 0.0 0 1

Append (cost=11.30..54,608,697.36 rows=4 width=8) (actual time=5.311..5.311 rows=0 loops=1)

4. 0.011 4.647 ↓ 0.0 0 1

Nested Loop (cost=11.30..27,304,348.66 rows=2 width=8) (actual time=4.647..4.647 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.023..0.027 rows=1 loops=1)

  • Index Cond: (funcionario_contrato_fk = 274)
6. 1.557 4.609 ↓ 0.0 0 1

Bitmap Heap Scan on t_escala_item (cost=11.01..13,652,168.70 rows=1 width=16) (actual time=4.609..4.609 rows=0 loops=1)

  • Recheck Cond: (funcionario_horario_fk = t_funcionario_horario.funcionario_horario_pk)
  • Filter: (((entrada)::date >= '2017-03-23'::date) AND ((entrada)::date <= '2017-03-24'::date) AND (NOT (SubPlan 2)))
  • Rows Removed by Filter: 676
  • Heap Blocks: exact=100
7. 0.137 0.137 ↓ 2.0 676 1

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

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

SubPlan (for Bitmap Heap Scan)

9. 1.758 2.915 ↑ 2,994.0 661 1

Materialize (cost=0.00..74,418.12 rows=1,979,056 width=8) (actual time=0.023..2.915 rows=661 loops=1)

10. 1.157 1.157 ↑ 2,994.0 661 1

Seq Scan on t_batida_rel_escala t_batida_rel_escala_1 (cost=0.00..56,791.84 rows=1,979,056 width=8) (actual time=0.012..1.157 rows=661 loops=1)

  • Filter: (batida_1 IS NOT NULL)
  • Rows Removed by Filter: 20
11. 0.013 0.658 ↓ 0.0 0 1

Nested Loop (cost=11.30..27,304,348.66 rows=2 width=8) (actual time=0.658..0.658 rows=0 loops=1)

12. 0.014 0.014 ↑ 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.011..0.014 rows=1 loops=1)

  • Index Cond: (funcionario_contrato_fk = 274)
13. 0.507 0.631 ↓ 0.0 0 1

Bitmap Heap Scan on t_escala_item t_escala_item_1 (cost=11.01..13,652,168.70 rows=1 width=16) (actual time=0.631..0.631 rows=0 loops=1)

  • Recheck Cond: (funcionario_horario_fk = t_funcionario_horario_1.funcionario_horario_pk)
  • Filter: (((saida)::date >= '2017-03-23'::date) AND ((saida)::date <= '2017-03-24'::date) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 676
  • Heap Blocks: exact=100
14. 0.124 0.124 ↓ 2.0 676 1

Bitmap Index Scan on xak01_escala_item (cost=0.00..11.01 rows=344 width=0) (actual time=0.124..0.124 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,418.12 rows=1,979,056 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_batida_rel_escala (cost=0.00..56,791.84 rows=1,979,056 width=8) (never executed)

  • Filter: (batida_1 IS NOT NULL)
Planning time : 1.526 ms
Execution time : 5.507 ms