explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U6RY

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.034 301.586 ↑ 39.0 6 1

Finalize GroupAggregate (cost=9,942.75..9,973.75 rows=234 width=24) (actual time=295.109..301.586 rows=6 loops=1)

  • Output: pais_id, departamento_id, count(*)
  • Group Key: e.pais_id, e.departamento_id
2. 18.350 301.552 ↑ 19.5 12 1

Gather Merge (cost=9,942.75..9,969.66 rows=234 width=24) (actual time=295.079..301.552 rows=12 loops=1)

  • Output: pais_id, departamento_id, (PARTIAL count(*))
  • Workers Planned: 1
  • Workers Launched: 1
3. 0.046 283.202 ↑ 39.0 6 2 / 2

Sort (cost=8,942.74..8,943.32 rows=234 width=24) (actual time=283.190..283.202 rows=6 loops=2)

  • Output: pais_id, departamento_id, (PARTIAL count(*))
  • Sort Key: e.pais_id, e.departamento_id
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 0: actual time=272.017..272.029 rows=6 loops=1
4. 142.817 283.156 ↑ 39.0 6 2 / 2

Partial HashAggregate (cost=8,931.19..8,933.53 rows=234 width=24) (actual time=283.145..283.156 rows=6 loops=2)

  • Output: pais_id, departamento_id, PARTIAL count(*)
  • Group Key: e.pais_id, e.departamento_id
  • Worker 0: actual time=271.950..271.961 rows=6 loops=1
5. 140.339 140.339 ↑ 1.1 128,254 2 / 2

Parallel Index Only Scan using idx_empleados_01 on public.empleados e (cost=0.56..7,825.14 rows=147,474 width=16) (actual time=0.060..140.339 rows=128,254 loops=2)

  • Output: pais_id, departamento_id
  • Index Cond: ((e.pais_id = ANY ('{1,15,26}'::bigint[])) AND (e.departamento_id = ANY ('{5,7}'::bigint[])))
  • Heap Fetches: 0
  • Worker 0: actual time=0.101..135.482 rows=123,994 loops=1
Planning time : 0.120 ms
Execution time : 301.630 ms