explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Imyb

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 31,263.673 ↓ 2.0 2 1

Limit (cost=13,487.76..13,487.77 rows=1 width=92) (actual time=31,263.671..31,263.673 rows=2 loops=1)

  • Output: srg.id, srg.name, pep.id, (('now'::cstring)::date), pepr.id, srg.responsible_id, srg.department_id
  • Buffers: shared hit=27850 read=4194
  • I/O Timings: read=31083.776
2. 0.066 31,263.670 ↓ 2.0 2 1

Sort (cost=13,487.76..13,487.77 rows=1 width=92) (actual time=31,263.669..31,263.670 rows=2 loops=1)

  • Output: srg.id, srg.name, pep.id, (('now'::cstring)::date), pepr.id, srg.responsible_id, srg.department_id
  • Sort Key: srg.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=27850 read=4194
  • I/O Timings: read=31083.776
3. 0.021 31,263.604 ↓ 2.0 2 1

Nested Loop (cost=1.72..13,487.75 rows=1 width=92) (actual time=10,701.234..31,263.604 rows=2 loops=1)

  • Output: srg.id, srg.name, pep.id, ('now'::cstring)::date, pepr.id, srg.responsible_id, srg.department_id
  • Buffers: shared hit=27847 read=4194
  • I/O Timings: read=31083.776
4. 0.006 31,263.467 ↓ 2.0 2 1

Nested Loop (cost=1.43..13,479.43 rows=1 width=92) (actual time=10,701.123..31,263.467 rows=2 loops=1)

  • Output: srg.id, srg.name, srg.responsible_id, srg.department_id, pepr.id, pepr.employee_position_id
  • Buffers: shared hit=27842 read=4194
  • I/O Timings: read=31083.776
5. 0.008 0.265 ↑ 1.0 1 1

Nested Loop (cost=0.58..16.62 rows=1 width=12) (actual time=0.259..0.265 rows=1 loops=1)

  • Output: sr.id, pepr.id, pepr.employee_position_id
  • Buffers: shared hit=6 read=1
  • I/O Timings: read=0.042
6. 0.050 0.050 ↑ 1.0 1 1

Index Scan using employee_position_id_unique on public.pim_employee_position_resource pepr (cost=0.29..8.31 rows=1 width=8) (actual time=0.048..0.050 rows=1 loops=1)

  • Output: pepr.id, pepr.employee_position_id, pepr.aud_who, pepr.aud_when, pepr.aud_source, pepr.aud_who_create, pepr.aud_when_create, pepr.aud_source_create
  • Index Cond: (pepr.employee_position_id = 76318)
  • Buffers: shared hit=3
7. 0.207 0.207 ↑ 1.0 1 1

Index Only Scan using sr_resource_pk on public.sr_resource sr (cost=0.29..8.31 rows=1 width=4) (actual time=0.204..0.207 rows=1 loops=1)

  • Output: sr.id
  • Index Cond: (sr.id = pepr.id)
  • Heap Fetches: 1
  • Buffers: shared hit=3 read=1
  • I/O Timings: read=0.042
8. 15.929 31,263.196 ↑ 635.5 2 1

Nested Loop (cost=0.85..13,450.10 rows=1,271 width=88) (actual time=10,700.860..31,263.196 rows=2 loops=1)

  • Output: srg.id, srg.name, srg.responsible_id, srg.department_id, srgr.resource_id
  • Buffers: shared hit=27836 read=4193
  • I/O Timings: read=31083.734
9. 31,097.949 31,097.949 ↓ 4.5 5,743 1

Index Scan using sr_res_group_id_is_system_not_true_ix on public.sr_res_group srg (cost=0.29..2,511.61 rows=1,271 width=84) (actual time=0.060..31,097.949 rows=5,743 loops=1)

  • Output: srg.id, srg.bdate, srg.edate, srg.is_system, srg.name, srg.department_id, srg.org_id, srg.responsible_id, srg.is_available_in_electronic_queue, srg.label_id, srg.ignore_regclinic_check, srg.note, srg.blocked, srg.block_comment, srg.template_res_group_id, srg.aud_who, srg.aud_when, srg.aud_source, srg.aud_who_create, srg.aud_when_create, srg.aud_source_create, srg.emergency, srg.ignore_districts, srg.service_template_id
  • Filter: ((('now'::cstring)::date >= COALESCE(srg.bdate, '-infinity'::date)) AND (('now'::cstring)::date <= COALESCE(srg.edate, 'infinity'::date)))
  • Rows Removed by Filter: 3487
  • Buffers: shared hit=4882 read=4164
  • I/O Timings: read=30982.848
10. 149.318 149.318 ↓ 0.0 0 5,743

Index Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship srgr (cost=0.57..8.60 rows=1 width=8) (actual time=0.026..0.026 rows=0 loops=5,743)

  • Output: srgr.id, srgr.bdatetime, srgr.edatetime, srgr.resource_id, srgr.group_id, srgr.role_id, srgr.is_disabled, srgr.aud_who, srgr.aud_when, srgr.aud_source, srgr.aud_who_create, srgr.aud_when_create, srgr.aud_source_create, srgr._is_system
  • Index Cond: ((srgr.resource_id = sr.id) AND (srgr.group_id = srg.id))
  • Filter: ((('now'::cstring)::date >= COALESCE(srgr.bdatetime, '-infinity'::timestamp without time zone)) AND (('now'::cstring)::date <= COALESCE(srgr.edatetime, 'infinity'::timestamp without time zone)))
  • Buffers: shared hit=22954 read=29
  • I/O Timings: read=100.886
11. 0.116 0.116 ↑ 1.0 1 2

Index Only Scan using pim_employee_position_pk on public.pim_employee_position pep (cost=0.29..8.31 rows=1 width=4) (actual time=0.057..0.058 rows=1 loops=2)

  • Output: pep.id
  • Index Cond: (pep.id = 76318)
  • Heap Fetches: 0
  • Buffers: shared hit=5
Planning time : 5.928 ms
Execution time : 31,263.880 ms