explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Z4ab

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 0.020 ↓ 0.0 0 1

Nested Loop (cost=26,762,753.35..26,800,126.65 rows=8,285 width=679) (actual time=0.020..0.020 rows=0 loops=1)

2.          

CTE t

3. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=13,264,254.73..26,762,752.92 rows=1,656,997 width=8) (never executed)

  • Hash Cond: ((l.group_id = r.id) AND (l.resource_id = e.id))
  • Filter: ((r.responsible_id IS NULL) OR (f_1.bdate < COALESCE(l.bdatetime, '1900-01-01 00:00:00'::timestamp without time zone)) OR (f_1.bdate > COALESCE(l.edatetime, '4000-01-01 00:00:00'::timestamp without time zone)))
4. 0.000 0.000 ↓ 0.0 0

Seq Scan on sr_res_group_relationship l (cost=0.00..6,776,869.44 rows=276,823,744 width=24) (never executed)

5. 0.000 0.000 ↓ 0.0 0

Hash (cost=13,202,666.96..13,202,666.96 rows=2,952,518 width=24) (never executed)

6. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=8,713,885.10..13,202,666.96 rows=2,952,518 width=24) (never executed)

  • Hash Cond: (r.responsible_id = e.employee_position_id)
7. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=8,713,115.26..13,161,675.95 rows=2,952,518 width=20) (never executed)

  • Hash Cond: (f_1.res_group_id = r.id)
8. 0.000 0.000 ↓ 0.0 0

Merge Left Join (cost=3,154,312.94..6,632,962.62 rows=2,952,518 width=16) (never executed)

  • Merge Cond: (t_1.res_group_id = s.id)
9. 0.000 0.000 ↓ 0.0 0

Sort (cost=3,154,312.38..3,161,693.67 rows=2,952,518 width=16) (never executed)

  • Sort Key: t_1.res_group_id
10. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,920,235.18..2,837,012.44 rows=2,952,518 width=16) (never executed)

  • Hash Cond: (f_1.step_id = t_1.id)
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on fin_bill_generate f_1 (cost=0.00..530,836.00 rows=2,965,765 width=16) (never executed)

  • Filter: (NOT is_sifted)
12. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,230,030.08..1,230,030.08 rows=42,069,608 width=8) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on mc_step t_1 (cost=0.00..1,230,030.08 rows=42,069,608 width=8) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_pk on sr_res_group s (cost=0.57..3,136,832.25 rows=119,075,080 width=4) (never executed)

  • Heap Fetches: 0
15. 0.000 0.000 ↓ 0.0 0

Hash (cost=3,605,225.82..3,605,225.82 rows=119,075,080 width=8) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_responsible_id_id_ix on sr_res_group r (cost=0.57..3,605,225.82 rows=119,075,080 width=8) (never executed)

  • Heap Fetches: 0
17. 0.000 0.000 ↓ 0.0 0

Hash (cost=469.37..469.37 rows=24,037 width=8) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Seq Scan on pim_employee_position_resource e (cost=0.00..469.37 rows=24,037 width=8) (never executed)

19. 0.019 0.019 ↓ 0.0 0 1

Index Scan using fin_bill_generate_pk on fin_bill_generate f (cost=0.43..8.45 rows=1 width=671) (actual time=0.019..0.019 rows=0 loops=1)

  • Index Cond: (id = 2016)
20. 0.000 0.000 ↓ 0.0 0

CTE Scan on t (cost=0.00..37,282.43 rows=8,285 width=8) (never executed)

  • Filter: (id = 2016)
Planning time : 3.374 ms
Execution time : 0.284 ms