explain.depesz.com

PostgreSQL's explain analyze made readable

Result: D5IR

Settings
# exclusive inclusive rows x rows loops node
1. 921.690 8,862.410 ↓ 1.4 355,372 1

HashAggregate (cost=670,308.57..672,918.63 rows=261,006 width=51) (actual time=8,515.717..8,862.410 rows=355,372 loops=1)

  • Group Key: br.batida_rel_pk, (NULL::bigint), br.data, br.batida_1, br.batida_2, br.batida_3, br.batida_4, br.funcionario_horario_fk, (NULL::bigint)
2. 540.458 7,940.720 ↓ 1.4 377,238 1

Append (cost=4,955.59..664,435.94 rows=261,006 width=51) (actual time=84.952..7,940.720 rows=377,238 loops=1)

3. 350.449 433.214 ↓ 1.6 307,823 1

Bitmap Heap Scan on t_batida_rel br (cost=4,955.59..272,173.97 rows=192,292 width=52) (actual time=84.946..433.214 rows=307,823 loops=1)

  • Recheck Cond: ((data >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::date) AND (data <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::date))
  • Heap Blocks: exact=5,875
4. 82.765 82.765 ↓ 1.9 367,109 1

Bitmap Index Scan on xak_batida_rel (cost=0.00..4,907.52 rows=192,292 width=0) (actual time=82.765..82.765 rows=367,109 loops=1)

  • Index Cond: ((data >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::date) AND (data <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::date))
5. 1,990.378 3,498.003 ↓ 1.0 34,705 1

Hash Join (cost=103,608.54..194,829.86 rows=34,516 width=48) (actual time=104.253..3,498.003 rows=34,705 loops=1)

  • Hash Cond: (bre.escala_item_fk = ei.escala_item_pk)
6. 1,403.436 1,403.436 ↑ 1.0 2,469,079 1

Seq Scan on t_batida_rel_escala bre (cost=0.00..56,791.84 rows=2,472,584 width=32) (actual time=0.007..1,403.436 rows=2,469,079 loops=1)

7. 23.765 104.189 ↓ 1.0 36,360 1

Hash (cost=103,162.14..103,162.14 rows=35,712 width=24) (actual time=104.189..104.189 rows=36,360 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 1,989kB
8. 22.884 80.424 ↓ 1.0 36,360 1

Bitmap Heap Scan on t_escala_item ei (cost=76,312.21..103,162.14 rows=35,712 width=24) (actual time=57.638..80.424 rows=36,360 loops=1)

  • Recheck Cond: ((entrada >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::timestamp without time zone) AND (entrada <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::timestamp without time zone))
  • Heap Blocks: exact=614
9. 57.540 57.540 ↓ 1.0 36,360 1

Bitmap Index Scan on xak01_escala_item (cost=0.00..76,303.29 rows=35,712 width=0) (actual time=57.540..57.540 rows=36,360 loops=1)

  • Index Cond: ((entrada >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::timestamp without time zone) AND (entrada <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::timestamp without time zone))
10. 1,974.990 3,469.045 ↓ 1.0 34,710 1

Hash Join (cost=103,604.70..194,822.05 rows=34,198 width=48) (actual time=106.955..3,469.045 rows=34,710 loops=1)

  • Hash Cond: (bre_1.escala_item_fk = ei_1.escala_item_pk)
11. 1,387.187 1,387.187 ↑ 1.0 2,469,079 1

Seq Scan on t_batida_rel_escala bre_1 (cost=0.00..56,791.84 rows=2,472,584 width=32) (actual time=0.011..1,387.187 rows=2,469,079 loops=1)

12. 24.231 106.868 ↓ 1.0 36,306 1

Hash (cost=103,162.42..103,162.42 rows=35,383 width=24) (actual time=106.868..106.868 rows=36,306 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 1,986kB
13. 23.537 82.637 ↓ 1.0 36,306 1

Bitmap Heap Scan on t_escala_item ei_1 (cost=76,312.13..103,162.42 rows=35,383 width=24) (actual time=59.201..82.637 rows=36,306 loops=1)

  • Recheck Cond: ((saida >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::timestamp without time zone) AND (saida <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::timestamp without time zone))
  • Heap Blocks: exact=780
14. 59.100 59.100 ↓ 1.0 36,306 1

Bitmap Index Scan on xak01_escala_item (cost=0.00..76,303.29 rows=35,383 width=0) (actual time=59.100..59.100 rows=36,306 loops=1)

  • Index Cond: ((saida >= (date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone))::timestamp without time zone) AND (saida <= (((date_trunc('month'::text, ((('now'::cstring)::date - 10))::timestamp with time zone) + '1 mon'::interval) - '1 day'::interval))::timestamp without time zone))
Planning time : 1.596 ms
Execution time : 9,029.134 ms