explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C4O5 : Optimization for: plan #Ntcj

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 55.784 53,068.555 ↑ 1.3 102 1

Gather (cost=1,001.30..2,866,077.20 rows=132 width=4) (actual time=27,474.151..53,068.555 rows=102 loops=1)

  • Output: webchatuse0_.daemon_user_id
  • Workers Planned: 8
  • Workers Launched: 8
  • Buffers: shared hit=957,589 read=1,864,741 dirtied=195
2. 0.098 53,012.771 ↑ 1.5 11 9 / 9

Nested Loop Anti Join (cost=1.30..2,865,064.00 rows=16 width=4) (actual time=27,087.237..53,012.771 rows=11 loops=9)

  • Output: webchatuse0_.daemon_user_id
  • Buffers: shared hit=957,589 read=1,864,741 dirtied=195
  • Worker 0: actual time=27,116.134..53014.468 rows=12 loops=1
  • Buffers: shared hit=106,325 read=204,096 dirtied=21
  • Worker 1: actual time=27,066.528..53010.537 rows=9 loops=1
  • Buffers: shared hit=108,594 read=208,988 dirtied=23
  • Worker 2: actual time=26,913.784..53011.110 rows=12 loops=1
  • Buffers: shared hit=101,678 read=202,819 dirtied=16
  • Worker 3: actual time=27,843.758..53007.805 rows=10 loops=1
  • Buffers: shared hit=105,569 read=206,307 dirtied=16
  • Worker 4: actual time=27,086.030..53015.045 rows=15 loops=1
  • Buffers: shared hit=107,349 read=207,174 dirtied=23
  • Worker 5: actual time=26,922.287..53012.718 rows=9 loops=1
  • Buffers: shared hit=102,975 read=207,324 dirtied=11
  • Worker 6: actual time=26,470.807..53011.830 rows=14 loops=1
  • Buffers: shared hit=102,851 read=206,463 dirtied=35
  • Worker 7: actual time=26,892.651..53012.592 rows=9 loops=1
  • Buffers: shared hit=103,299 read=206,854 dirtied=15
3. 0.147 53,011.647 ↓ 1.1 18 9 / 9

Nested Loop Left Join (cost=0.87..2,865,034.97 rows=17 width=8) (actual time=24,716.961..53,011.647 rows=18 loops=9)

  • Output: webchatuse0_.daemon_user_id, dialogset2_.id
  • Buffers: shared hit=956,943 read=1,864,739 dirtied=195
  • Worker 0: actual time=23,816.127..53011.934 rows=20 loops=1
  • Buffers: shared hit=106,208 read=204,095 dirtied=21
  • Worker 1: actual time=26,932.469..53009.680 rows=23 loops=1
  • Buffers: shared hit=108,508 read=208,988 dirtied=23
  • Worker 2: actual time=26,913.674..53010.394 rows=14 loops=1
  • Buffers: shared hit=101,629 read=202,819 dirtied=16
  • Worker 3: actual time=27,003.940..53007.022 rows=16 loops=1
  • Buffers: shared hit=105,498 read=206,307 dirtied=16
  • Worker 4: actual time=26,999.520..53012.548 rows=22 loops=1
  • Buffers: shared hit=107,271 read=207,173 dirtied=23
  • Worker 5: actual time=10,416.882..53011.880 rows=16 loops=1
  • Buffers: shared hit=102,907 read=207,324 dirtied=11
  • Worker 6: actual time=26,470.676..53011.118 rows=17 loops=1
  • Buffers: shared hit=102,788 read=206,463 dirtied=35
  • Worker 7: actual time=26,892.635..53011.840 rows=15 loops=1
  • Buffers: shared hit=103,249 read=206,854 dirtied=15
4. 0.254 53,008.836 ↓ 1.1 18 9 / 9

Nested Loop Left Join (cost=0.43..2,865,013.31 rows=17 width=17) (actual time=24,716.845..53,008.836 rows=18 loops=9)

  • Output: webchatuse0_.daemon_user_id, client1_.login
  • Inner Unique: true
  • Buffers: shared hit=956,142 read=1,864,736 dirtied=195
  • Worker 0: actual time=23,816.039..53008.346 rows=20 loops=1
  • Buffers: shared hit=106,093 read=204,094 dirtied=21
  • Worker 1: actual time=26,932.374..53008.444 rows=23 loops=1
  • Buffers: shared hit=108,381 read=208,988 dirtied=23
  • Worker 2: actual time=26,913.489..53005.182 rows=14 loops=1
  • Buffers: shared hit=101,556 read=202,819 dirtied=16
  • Worker 3: actual time=27,003.845..53005.662 rows=16 loops=1
  • Buffers: shared hit=105,429 read=206,307 dirtied=16
  • Worker 4: actual time=26,999.415..53007.514 rows=22 loops=1
  • Buffers: shared hit=107,177 read=207,171 dirtied=23
  • Worker 5: actual time=10,416.729..53010.814 rows=16 loops=1
  • Buffers: shared hit=102,824 read=207,324 dirtied=11
  • Worker 6: actual time=26,470.487..53010.150 rows=17 loops=1
  • Buffers: shared hit=102,721 read=206,463 dirtied=35
  • Worker 7: actual time=26,892.544..53010.733 rows=15 loops=1
  • Buffers: shared hit=103,165 read=206,854 dirtied=15
5. 53,007.502 53,007.502 ↓ 1.1 18 9 / 9

Parallel Seq Scan on public.web_chat_user_data webchatuse0_ (cost=0.00..2,864,968.21 rows=17 width=8) (actual time=24,716.744..53,007.502 rows=18 loops=9)

  • Output: webchatuse0_.daemon_user_id, webchatuse0_.estimated_skill_group, webchatuse0_.is_online, webchatuse0_.client_id, webchatuse0_.user_data, webchatuse0_.updated
  • Filter: ((webchatuse0_.is_online = 1) AND (webchatuse0_.estimated_skill_group = 8))
  • Rows Removed by Filter: 2,648,094
  • Buffers: shared hit=955,487 read=1,864,734 dirtied=195
  • Worker 0: actual time=23,815.935..53004.587 rows=20 loops=1
  • Buffers: shared hit=106,014 read=204,092 dirtied=21
  • Worker 1: actual time=26,932.276..53007.409 rows=23 loops=1
  • Buffers: shared hit=108,288 read=208,988 dirtied=23
  • Worker 2: actual time=26,913.360..53004.187 rows=14 loops=1
  • Buffers: shared hit=101,499 read=202,819 dirtied=16
  • Worker 3: actual time=27,003.771..53004.801 rows=16 loops=1
  • Buffers: shared hit=105,364 read=206,307 dirtied=16
  • Worker 4: actual time=26,999.333..53006.445 rows=22 loops=1
  • Buffers: shared hit=107,088 read=207,171 dirtied=23
  • Worker 5: actual time=10,416.606..53009.871 rows=16 loops=1
  • Buffers: shared hit=102,759 read=207,324 dirtied=11
  • Worker 6: actual time=26,470.349..53009.212 rows=17 loops=1
  • Buffers: shared hit=102,651 read=206,463 dirtied=35
  • Worker 7: actual time=26,892.447..53009.796 rows=15 loops=1
  • Buffers: shared hit=103,104 read=206,854 dirtied=15
6. 1.080 1.080 ↑ 1.0 1 162 / 9

Index Scan using msg_clients_id_idx on public.msg_clients client1_ (cost=0.43..2.65 rows=1 width=17) (actual time=0.060..0.060 rows=1 loops=162)

  • Output: client1_.id, client1_.login, client1_.last_client_profile_id
  • Index Cond: (webchatuse0_.client_id = client1_.id)
  • Buffers: shared hit=655 read=2
  • Worker 0: actual time=0.176..0.176 rows=1 loops=20
  • Buffers: shared hit=79 read=2
  • Worker 1: actual time=0.034..0.034 rows=1 loops=23
  • Buffers: shared hit=93
  • Worker 2: actual time=0.053..0.053 rows=1 loops=14
  • Buffers: shared hit=57
  • Worker 3: actual time=0.040..0.040 rows=1 loops=16
  • Buffers: shared hit=65
  • Worker 4: actual time=0.034..0.034 rows=1 loops=22
  • Buffers: shared hit=89
  • Worker 5: actual time=0.043..0.043 rows=1 loops=16
  • Buffers: shared hit=65
  • Worker 6: actual time=0.041..0.041 rows=1 loops=17
  • Buffers: shared hit=70
  • Worker 7: actual time=0.045..0.045 rows=1 loops=15
  • Buffers: shared hit=61
7. 2.664 2.664 ↑ 1.0 1 162 / 9

Index Scan using msg_dialogs_external_id_idx on public.msg_dialogs dialogset2_ (cost=0.43..1.26 rows=1 width=15) (actual time=0.131..0.148 rows=1 loops=162)

  • Output: dialogset2_.external_id, dialogset2_.id
  • Index Cond: ((client1_.login)::text = (dialogset2_.external_id)::text)
  • Buffers: shared hit=801 read=3
  • Worker 0: actual time=0.100..0.170 rows=1 loops=20
  • Buffers: shared hit=115 read=1
  • Worker 1: actual time=0.040..0.047 rows=1 loops=23
  • Buffers: shared hit=127
  • Worker 2: actual time=0.356..0.363 rows=1 loops=14
  • Buffers: shared hit=73
  • Worker 3: actual time=0.074..0.077 rows=1 loops=16
  • Buffers: shared hit=69
  • Worker 4: actual time=0.188..0.222 rows=1 loops=22
  • Buffers: shared hit=94 read=2
  • Worker 5: actual time=0.052..0.058 rows=1 loops=16
  • Buffers: shared hit=83
  • Worker 6: actual time=0.048..0.049 rows=1 loops=17
  • Buffers: shared hit=67
  • Worker 7: actual time=0.054..0.062 rows=1 loops=15
  • Buffers: shared hit=84
8. 1.026 1.026 ↓ 0.0 0 162 / 9

Index Scan using msg_appeals_dialog_id_index on public.msg_appeals appeal3_ (cost=0.43..1.64 rows=1 width=4) (actual time=0.057..0.057 rows=0 loops=162)

  • Output: appeal3_.id, appeal3_.dialog_id, appeal3_.date_start, appeal3_.date_end, appeal3_.is_open, appeal3_.processed, appeal3_.rating, appeal3_.answer, appeal3_.active, appeal3_.group_id, appeal3_.sl, appeal3_.bot_state, appeal3_.greeting, appeal3_.chat_by_code
  • Index Cond: (appeal3_.dialog_id = dialogset2_.id)
  • Filter: (appeal3_.is_open = ANY ('{1,2}'::integer[]))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=646 read=2
  • Worker 0: actual time=0.121..0.121 rows=0 loops=20
  • Buffers: shared hit=117 read=1
  • Worker 1: actual time=0.033..0.033 rows=1 loops=23
  • Buffers: shared hit=86
  • Worker 2: actual time=0.044..0.044 rows=0 loops=14
  • Buffers: shared hit=49
  • Worker 3: actual time=0.043..0.043 rows=0 loops=16
  • Buffers: shared hit=71
  • Worker 4: actual time=0.108..0.108 rows=0 loops=22
  • Buffers: shared hit=78 read=1
  • Worker 5: actual time=0.047..0.047 rows=0 loops=16
  • Buffers: shared hit=68
  • Worker 6: actual time=0.036..0.036 rows=0 loops=17
  • Buffers: shared hit=63
  • Worker 7: actual time=0.044..0.044 rows=0 loops=15
  • Buffers: shared hit=50
Planning time : 2.050 ms
Execution time : 53,068.718 ms