explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mZ7F : select emp_name, emp_age, e.emp_id, d.dept_name, m.mgr_name, e.salary as employee_salary, m.salary as mgr_salary, c.contact_no as emp_contact_no, a.start_date as work_start_date, a.end_date as work_end_date, a.descr as work_description from employee e left join dept d on d.dept_id=e.emp_dept_id left join manager m on m.mgr_id=e.emp_mgr_id left join emp_contact c on e.emp_id = c.emp_id left join emp_assignment a on a.emp_id=e.emp_id where e.emp_id in (1,2);

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.158 55.012 ↑ 11.4 71 1

Sort (cost=146.63..148.65 rows=808 width=138) (actual time=55.009..55.012 rows=71 loops=1)

  • Sort Key: n.nspname, p.proname, (pg_get_function_arguments(p.oid))
  • Sort Method: quicksort Memory: 43kB
2. 1.378 54.854 ↑ 11.4 71 1

Hash Join (cost=1.14..107.61 rows=808 width=138) (actual time=42.495..54.854 rows=71 loops=1)

  • Hash Cond: (p.pronamespace = n.oid)
3. 53.465 53.465 ↓ 3.0 2,402 1

Seq Scan on pg_proc p (cost=0.00..89.30 rows=808 width=78) (actual time=0.052..53.465 rows=2,402 loops=1)

  • Filter: pg_function_is_visible(oid)
4. 0.004 0.011 ↑ 1.0 4 1

Hash (cost=1.09..1.09 rows=4 width=68) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
5. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on pg_namespace n (cost=0.00..1.09 rows=4 width=68) (actual time=0.005..0.007 rows=4 loops=1)

  • Filter: ((nspname <> 'pg_catalog'::name) AND (nspname <> 'information_schema'::name))