explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LsXy : Optimization for: plan #IsvA

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.051 0.502 ↑ 1.7 21 1

Hash Left Join (cost=5.66..13.54 rows=36 width=142) (actual time=0.242..0.502 rows=21 loops=1)

  • Hash Cond: (r.shift_registry_id = ops.shift_id)
2.          

CTE open_pos_shifts

3. 0.022 0.109 ↑ 1.6 5 1

Hash Join (cost=1.27..5.12 rows=8 width=125) (actual time=0.080..0.109 rows=5 loops=1)

  • Hash Cond: (srp.pos_id = dp.pos_id)
4. 0.054 0.054 ↑ 1.6 5 1

Seq Scan on shift_registry_pos srp (cost=0.00..3.83 rows=8 width=12) (actual time=0.029..0.054 rows=5 loops=1)

  • Filter: (status_id <> '3'::numeric)
  • Rows Removed by Filter: 89
5. 0.010 0.033 ↓ 1.1 13 1

Hash (cost=1.12..1.12 rows=12 width=150) (actual time=0.033..0.033 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.023 0.023 ↓ 1.1 13 1

Seq Scan on dic_pos dp (cost=0.00..1.12 rows=12 width=150) (actual time=0.020..0.023 rows=13 loops=1)

7. 0.328 0.328 ↑ 1.7 21 1

Index Scan using shift_registry_status_id_index on shift_registry r (cost=0.29..8.02 rows=36 width=24) (actual time=0.075..0.328 rows=21 loops=1)

  • Index Cond: (status_id = ANY ('{0,1,2}'::numeric[]))
  • Filter: (owner_type_id = '1'::numeric)
  • Rows Removed by Filter: 47
8. 0.009 0.123 ↑ 1.6 5 1

Hash (cost=0.16..0.16 rows=8 width=150) (actual time=0.123..0.123 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.114 0.114 ↑ 1.6 5 1

CTE Scan on open_pos_shifts ops (cost=0.00..0.16 rows=8 width=150) (actual time=0.083..0.114 rows=5 loops=1)