explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YPAR

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 1,394,801.465 ↓ 0.0 0 1

Nested Loop (cost=13.10..21,466.59 rows=1 width=16) (actual time=1,394,801.465..1,394,801.465 rows=0 loops=1)

  • Join Filter: (pa.id = b.palata_id)
2. 0.005 1,394,801.461 ↓ 0.0 0 1

Nested Loop (cost=12.82..21,465.74 rows=1 width=32) (actual time=1,394,801.461..1,394,801.461 rows=0 loops=1)

  • Join Filter: (dc.inst_id = pa.department_id)
3. 0.003 1,394,801.456 ↓ 0.0 0 1

Nested Loop (cost=12.82..21,348.65 rows=1 width=32) (actual time=1,394,801.456..1,394,801.456 rows=0 loops=1)

  • Join Filter: ((p.date_from <= d.date) AND ((p.date_to IS NULL) OR (p.date_to >= d.date)) AND (s.id = d.service_id))
4. 107,931.462 1,394,801.453 ↓ 0.0 0 1

Nested Loop (cost=12.38..21,344.88 rows=1 width=56) (actual time=1,394,801.453..1,394,801.453 rows=0 loops=1)

  • Join Filter: (tc.inst_id = s.assistant1_id)
5. 103,934.773 954,751.149 ↓ 7,945.4 30,192,622 1

Nested Loop (cost=11.94..10,548.48 rows=3,800 width=48) (actual time=0.406..954,751.149 rows=30,192,622 loops=1)

6. 27.378 89.216 ↓ 2,007.0 4,014 1

Nested Loop (cost=11.51..344.99 rows=2 width=48) (actual time=0.196..89.216 rows=4,014 loops=1)

  • Join Filter: (e.id = p.entry_id)
7. 1.132 6.044 ↓ 102.0 102 1

Nested Loop (cost=0.84..143.60 rows=1 width=40) (actual time=0.141..6.044 rows=102 loops=1)

8. 1.614 2.707 ↓ 3.2 105 1

Merge Join (cost=0.55..41.93 rows=33 width=32) (actual time=0.077..2.707 rows=105 loops=1)

  • Merge Cond: (dc.entry_id = tc.entry_id)
9. 0.386 0.386 ↑ 1.0 119 1

Index Only Scan using aaa__sc_conds_idx1 on sc_conds dc (cost=0.28..22.42 rows=119 width=16) (actual time=0.040..0.386 rows=119 loops=1)

  • Index Cond: (class_id = 660)
  • Heap Fetches: 0
10. 0.707 0.707 ↓ 1.2 105 1

Index Only Scan using aaa__sc_conds_idx1 on sc_conds tc (cost=0.28..15.70 rows=88 width=16) (actual time=0.020..0.707 rows=105 loops=1)

  • Index Cond: (class_id = 957)
  • Heap Fetches: 0
11. 2.205 2.205 ↑ 1.0 1 105

Index Scan using sc_entries_pkey on sc_entries e (cost=0.29..3.08 rows=1 width=8) (actual time=0.021..0.021 rows=1 loops=105)

  • Index Cond: (id = dc.entry_id)
  • Filter: (parent_id = 30,305,757)
  • Rows Removed by Filter: 0
12. 51.408 55.794 ↑ 4.0 39 102

Bitmap Heap Scan on prices p (cost=10.67..185.30 rows=157 width=40) (actual time=0.069..0.547 rows=39 loops=102)

  • Recheck Cond: (entry_id = dc.entry_id)
  • Filter: (((blocked IS NULL) OR (NOT blocked)) AND ((removed IS NULL) OR (NOT removed)))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=3,712
13. 4.386 4.386 ↑ 4.0 39 102

Bitmap Index Scan on entry_id_index (cost=0.00..10.63 rows=157 width=0) (actual time=0.043..0.043 rows=39 loops=102)

  • Index Cond: (entry_id = dc.entry_id)
14. 850,727.160 850,727.160 ↓ 4.6 7,522 4,014

Index Scan using fki_bs_payms_5 on bs_payms bs (cost=0.43..4,939.65 rows=1,621 width=16) (actual time=0.337..211.940 rows=7,522 loops=4,014)

  • Index Cond: (pricelist_id = p.pricelist_id)
  • Filter: (((price IS NULL) OR (price = '0'::double precision)) AND (clinic_id = 1))
  • Rows Removed by Filter: 132,173
15. 332,118.842 332,118.842 ↓ 0.0 0 30,192,622

Index Scan using se_services_pkey on se_services s (cost=0.44..2.74 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=30,192,622)

  • Index Cond: (id = bs.service_id)
  • Filter: ((date_from > '2020-09-01 00:00:00'::timestamp without time zone) AND ((type)::text = 'bedhis'::text))
  • Rows Removed by Filter: 1
16. 0.000 0.000 ↓ 0.0 0

Index Scan using se_dests_fk30c9c1e49e8e28d on se_dests d (cost=0.44..3.24 rows=5 width=12) (never executed)

  • Index Cond: (service_id = bs.service_id)
17. 0.000 0.000 ↓ 0.0 0

Seq Scan on cc_palata pa (cost=0.00..64.40 rows=514 width=16) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Index Scan using cc_bed_pkey on cc_bed b (cost=0.28..0.75 rows=1 width=16) (never executed)

  • Index Cond: (id = s.operator_id)
Planning time : 105.126 ms
Execution time : 1,394,801.905 ms