explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ztj

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,476,464.127 ↓ 0.0 0 1

Nested Loop (cost=153.08..21,452.58 rows=1 width=16) (actual time=1,476,464.127..1,476,464.127 rows=0 loops=1)

  • Join Filter: (dc.inst_id = pa.department_id)
2. 0.004 1,476,464.122 ↓ 0.0 0 1

Nested Loop (cost=152.80..21,452.03 rows=1 width=32) (actual time=1,476,464.122..1,476,464.122 rows=0 loops=1)

3. 0.003 1,476,464.118 ↓ 0.0 0 1

Nested Loop (cost=152.52..21,451.28 rows=1 width=32) (actual time=1,476,464.118..1,476,464.118 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. 134,557.552 1,476,464.115 ↓ 0.0 0 1

Nested Loop (cost=152.08..21,447.51 rows=1 width=56) (actual time=1,476,464.115..1,476,464.115 rows=0 loops=1)

  • Join Filter: (tc.inst_id = s.assistant1_id)
5. 108,473.177 1,009,806.641 ↓ 7,945.0 30,190,902 1

Nested Loop (cost=151.65..10,651.14 rows=3,800 width=48) (actual time=1.500..1,009,806.641 rows=30,190,902 loops=1)

6. 28.097 94.128 ↓ 2,007.0 4,014 1

Nested Loop (cost=151.21..447.64 rows=2 width=48) (actual time=1.415..94.128 rows=4,014 loops=1)

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

Nested Loop (cost=140.54..246.25 rows=1 width=40) (actual time=1.354..7.279 rows=102 loops=1)

8. 1.614 3.944 ↓ 3.2 105 1

Merge Join (cost=140.25..144.59 rows=33 width=32) (actual time=1.272..3.944 rows=105 loops=1)

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

Sort (cost=70.76..71.05 rows=119 width=16) (actual time=0.673..1.094 rows=119 loops=1)

  • Sort Key: dc.entry_id
  • Sort Method: quicksort Memory: 30kB
10. 0.431 0.431 ↑ 1.0 119 1

Seq Scan on sc_conds dc (cost=0.00..66.66 rows=119 width=16) (actual time=0.040..0.431 rows=119 loops=1)

  • Filter: (class_id = 660)
  • Rows Removed by Filter: 463
11. 0.836 1.236 ↓ 1.2 105 1

Sort (cost=69.50..69.72 rows=88 width=16) (actual time=0.583..1.236 rows=105 loops=1)

  • Sort Key: tc.entry_id
  • Sort Method: quicksort Memory: 29kB
12. 0.400 0.400 ↑ 1.0 88 1

Seq Scan on sc_conds tc (cost=0.00..66.66 rows=88 width=16) (actual time=0.012..0.400 rows=88 loops=1)

  • Filter: (class_id = 957)
  • Rows Removed by Filter: 494
13. 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
14. 54.468 58.752 ↑ 4.0 39 102

Bitmap Heap Scan on prices p (cost=10.67..185.30 rows=157 width=40) (actual time=0.068..0.576 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
15. 4.284 4.284 ↑ 4.0 39 102

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

  • Index Cond: (entry_id = dc.entry_id)
16. 901,239.336 901,239.336 ↓ 4.6 7,521 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.356..224.524 rows=7,521 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,171
17. 332,099.922 332,099.922 ↓ 0.0 0 30,190,902

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,190,902)

  • 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
18. 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)
19. 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)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using cc_palata_pkey on cc_palata pa (cost=0.28..0.44 rows=1 width=16) (never executed)

  • Index Cond: (id = b.palata_id)
Planning time : 78.254 ms
Execution time : 1,476,464.645 ms