explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GHHW

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 8.326 ↓ 2.2 926 1

Limit (cost=1,041.65..1,042.71 rows=425 width=2,026) (actual time=8.256..8.326 rows=926 loops=1)

2. 1.436 8.290 ↓ 2.2 926 1

Sort (cost=1,041.65..1,042.71 rows=425 width=2,026) (actual time=8.255..8.290 rows=926 loops=1)

  • Sort Key: rd.received_payment DESC, (COALESCE((count(bg_messages.id)), '0'::bigint)) DESC, (COALESCE((count(bg_messages_1.id)), '0'::bigint)) DESC
  • Sort Method: quicksort Memory: 745kB
3. 0.356 6.854 ↓ 2.2 926 1

Hash Left Join (cost=889.93..1,023.09 rows=425 width=2,026) (actual time=3.897..6.854 rows=926 loops=1)

  • Hash Cond: (rd.bank_signer = signers.id)
4. 0.186 6.493 ↓ 2.2 926 1

Hash Left Join (cost=888.84..1,019.65 rows=425 width=1,612) (actual time=3.882..6.493 rows=926 loops=1)

  • Hash Cond: (mr.giving_id = givings.id)
5. 0.215 6.223 ↓ 2.2 926 1

Hash Left Join (cost=866.08..995.78 rows=425 width=1,608) (actual time=3.792..6.223 rows=926 loops=1)

  • Hash Cond: (mr.verify_id = verifys.id)
6. 0.199 5.919 ↓ 2.2 926 1

Hash Left Join (cost=843.33..971.91 rows=425 width=1,604) (actual time=3.695..5.919 rows=926 loops=1)

  • Hash Cond: (mr.underwriter_id = underwriters.id)
7. 0.209 5.629 ↓ 2.2 926 1

Hash Left Join (cost=820.57..948.04 rows=425 width=1,600) (actual time=3.596..5.629 rows=926 loops=1)

  • Hash Cond: (rd.my_request_id = bg_messages_1.my_request_id)
8. 0.206 5.392 ↓ 2.2 926 1

Hash Left Join (cost=814.18..940.53 rows=425 width=1,596) (actual time=3.561..5.392 rows=926 loops=1)

  • Hash Cond: (rd.my_request_id = bg_messages.my_request_id)
9. 0.285 5.160 ↓ 2.2 926 1

Hash Left Join (cost=807.70..932.94 rows=425 width=1,588) (actual time=3.526..5.160 rows=926 loops=1)

  • Hash Cond: (((e.entity_inn)::text = (e2.entity_inn)::text) AND ((COALESCE(mr.guarantor_bank_slug, 'expobank'::character varying))::text = ((COALESCE(mr2.guarantor_bank_slug, 'expobank'::character varying)))::text))
10. 0.273 4.047 ↓ 2.2 926 1

Hash Join (cost=441.35..564.36 rows=425 width=1,556) (actual time=2.685..4.047 rows=926 loops=1)

  • Hash Cond: (mr.user_id = user_table.id)
11. 0.254 3.664 ↓ 2.2 926 1

Hash Join (cost=418.60..540.47 rows=425 width=1,546) (actual time=2.564..3.664 rows=926 loops=1)

  • Hash Cond: (mr.entity_id = e.id)
12. 0.245 3.203 ↓ 2.2 926 1

Hash Left Join (cost=207.15..327.90 rows=425 width=1,497) (actual time=2.347..3.203 rows=926 loops=1)

  • Hash Cond: (mr.user_id = a.user_id)
13. 0.525 2.836 ↓ 2.2 926 1

Hash Join (cost=186.19..302.19 rows=425 width=1,489) (actual time=2.202..2.836 rows=926 loops=1)

  • Hash Cond: (c.my_request_id = mr.id)
14. 0.122 0.122 ↓ 1.0 930 1

Seq Scan on customers c (cost=0.00..108.27 rows=927 width=259) (actual time=0.003..0.122 rows=930 loops=1)

15. 0.530 2.189 ↓ 2.1 929 1

Hash (cost=180.72..180.72 rows=438 width=1,234) (actual time=2.189..2.189 rows=929 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 174kB
16. 1.170 1.659 ↓ 2.1 929 1

Hash Join (cost=79.96..180.72 rows=438 width=1,234) (actual time=0.339..1.659 rows=929 loops=1)

  • Hash Cond: (rd.my_request_id = mr.id)
  • Join Filter: (((rd.bidding_law)::text = 'block'::text) OR ((rd.bidding_law)::text = '44-ФЗ'::text) OR ((rd.bidding_law)::text = '223-ФЗ'::text) OR ((rd.bidding_law)::text = '185-ФЗ'::text) OR (mr.contract_type = '1'::smallint) OR (mr.contract_type = '2'::smallint) OR (mr.contract_type = '3'::smallint) OR (mr.contract_type = '4'::smallint))
  • Rows Removed by Join Filter: 4
17. 0.162 0.162 ↓ 1.0 933 1

Seq Scan on request_datas rd (cost=0.00..98.29 rows=929 width=44) (actual time=0.002..0.162 rows=933 loops=1)

18. 0.127 0.327 ↓ 1.7 958 1

Hash (cost=73.11..73.11 rows=548 width=1,190) (actual time=0.327..0.327 rows=958 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 142kB
19. 0.200 0.200 ↓ 1.7 958 1

Seq Scan on my_requests mr (cost=0.00..73.11 rows=548 width=1,190) (actual time=0.004..0.200 rows=958 loops=1)

  • Filter: (((guarantor_bank_slug IS NULL) OR ((guarantor_bank_slug)::text = 'expobank'::text) OR ((guarantor_bank_slug)::text = 'pervouralsk'::text) OR ((guarantor_bank_slug)::text = 'kubanCredit'::text) OR ((guarantor_bank_slug)::text = 'rejectedBids'::text) OR ((guarantor_bank_slug)::text = 'kurskPromBank'::text) OR ((guarantor_bank_slug)::text = 'marerBank'::text) OR ((guarantor_bank_slug)::text = 'promSvyazBank'::text) OR ((guarantor_bank_slug)::text = 'sdmBank'::text)) AND (status = ANY ('{1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24}'::integer[])))
20. 0.008 0.122 ↑ 1.0 26 1

Hash (cost=20.63..20.63 rows=26 width=12) (actual time=0.122..0.122 rows=26 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
21. 0.043 0.114 ↑ 1.0 26 1

Hash Right Join (cost=2.58..20.63 rows=26 width=12) (actual time=0.033..0.114 rows=26 loops=1)

  • Hash Cond: (u.id = a.user_id)
22. 0.055 0.055 ↓ 1.0 482 1

Seq Scan on users u (cost=0.00..16.78 rows=478 width=8) (actual time=0.005..0.055 rows=482 loops=1)

23. 0.007 0.016 ↑ 1.0 26 1

Hash (cost=2.26..2.26 rows=26 width=8) (actual time=0.016..0.016 rows=26 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
24. 0.009 0.009 ↑ 1.0 26 1

Seq Scan on agents a (cost=0.00..2.26 rows=26 width=8) (actual time=0.007..0.009 rows=26 loops=1)

25. 0.063 0.207 ↓ 1.0 423 1

Hash (cost=206.20..206.20 rows=420 width=53) (actual time=0.207..0.207 rows=423 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
26. 0.144 0.144 ↓ 1.0 423 1

Seq Scan on entities e (cost=0.00..206.20 rows=420 width=53) (actual time=0.002..0.144 rows=423 loops=1)

27. 0.055 0.110 ↓ 1.0 482 1

Hash (cost=16.78..16.78 rows=478 width=14) (actual time=0.110..0.110 rows=482 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 31kB
28. 0.055 0.055 ↓ 1.0 482 1

Seq Scan on users user_table (cost=0.00..16.78 rows=478 width=14) (actual time=0.008..0.055 rows=482 loops=1)

29. 0.017 0.828 ↑ 1.5 76 1

Hash (cost=364.64..364.64 rows=114 width=75) (actual time=0.828..0.828 rows=76 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
30. 0.080 0.811 ↑ 1.5 76 1

HashAggregate (cost=362.08..363.50 rows=114 width=75) (actual time=0.795..0.811 rows=76 loops=1)

  • Group Key: e2.entity_inn, COALESCE(mr2.guarantor_bank_slug, 'expobank'::character varying)
31. 0.030 0.731 ↓ 1.0 117 1

Hash Join (cost=250.21..361.22 rows=114 width=50) (actual time=0.525..0.731 rows=117 loops=1)

  • Hash Cond: (mr2.entity_id = e2.id)
32. 0.112 0.384 ↓ 1.0 117 1

Hash Join (cost=38.76..149.47 rows=114 width=20) (actual time=0.196..0.384 rows=117 loops=1)

  • Hash Cond: (c2.my_request_id = mr2.id)
33. 0.104 0.104 ↓ 1.0 930 1

Seq Scan on customers c2 (cost=0.00..108.27 rows=927 width=11) (actual time=0.004..0.104 rows=930 loops=1)

34. 0.019 0.168 ↑ 1.0 117 1

Hash (cost=37.29..37.29 rows=117 width=17) (actual time=0.168..0.168 rows=117 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
35. 0.149 0.149 ↑ 1.0 117 1

Seq Scan on my_requests mr2 (cost=0.00..37.29 rows=117 width=17) (actual time=0.011..0.149 rows=117 loops=1)

  • Filter: (status = ANY ('{4,5,6,7,8,9,18,21,23}'::integer[]))
  • Rows Removed by Filter: 841
36. 0.062 0.317 ↓ 1.0 423 1

Hash (cost=206.20..206.20 rows=420 width=15) (actual time=0.317..0.317 rows=423 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
37. 0.255 0.255 ↓ 1.0 423 1

Seq Scan on entities e2 (cost=0.00..206.20 rows=420 width=15) (actual time=0.004..0.255 rows=423 loops=1)

38. 0.003 0.026 ↑ 1.5 4 1

Hash (cost=6.40..6.40 rows=6 width=12) (actual time=0.026..0.026 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
39. 0.003 0.023 ↑ 1.5 4 1

HashAggregate (cost=6.28..6.34 rows=6 width=12) (actual time=0.023..0.023 rows=4 loops=1)

  • Group Key: bg_messages.my_request_id
40. 0.020 0.020 ↑ 1.5 4 1

Seq Scan on bg_messages (cost=0.00..6.25 rows=6 width=8) (actual time=0.008..0.020 rows=4 loops=1)

  • Filter: ((NOT viewed_by_bank) AND display_for_bank AND (type = 0))
  • Rows Removed by Filter: 176
41. 0.002 0.028 ↑ 1.5 2 1

Hash (cost=6.36..6.36 rows=3 width=12) (actual time=0.028..0.028 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
42. 0.002 0.026 ↑ 1.5 2 1

GroupAggregate (cost=6.27..6.33 rows=3 width=12) (actual time=0.025..0.026 rows=2 loops=1)

  • Group Key: bg_messages_1.my_request_id
43. 0.009 0.024 ↑ 1.5 2 1

Sort (cost=6.27..6.28 rows=3 width=8) (actual time=0.024..0.024 rows=2 loops=1)

  • Sort Key: bg_messages_1.my_request_id
  • Sort Method: quicksort Memory: 25kB
44. 0.015 0.015 ↑ 1.5 2 1

Seq Scan on bg_messages bg_messages_1 (cost=0.00..6.25 rows=3 width=8) (actual time=0.003..0.015 rows=2 loops=1)

  • Filter: ((NOT viewed_by_bank) AND display_for_bank AND (type = 1))
  • Rows Removed by Filter: 178
45. 0.045 0.091 ↓ 1.0 482 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.091..0.091 rows=482 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
46. 0.046 0.046 ↓ 1.0 482 1

Seq Scan on users underwriters (cost=0.00..16.78 rows=478 width=8) (actual time=0.003..0.046 rows=482 loops=1)

47. 0.049 0.089 ↓ 1.0 482 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.089..0.089 rows=482 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
48. 0.040 0.040 ↓ 1.0 482 1

Seq Scan on users verifys (cost=0.00..16.78 rows=478 width=8) (actual time=0.002..0.040 rows=482 loops=1)

49. 0.045 0.084 ↓ 1.0 482 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.084..0.084 rows=482 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
50. 0.039 0.039 ↓ 1.0 482 1

Seq Scan on users givings (cost=0.00..16.78 rows=478 width=8) (actual time=0.001..0.039 rows=482 loops=1)

51. 0.002 0.005 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=404) (actual time=0.005..0.005 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
52. 0.003 0.003 ↑ 1.0 4 1

Seq Scan on bank_signers signers (cost=0.00..1.04 rows=4 width=404) (actual time=0.002..0.003 rows=4 loops=1)

Planning time : 9.292 ms
Execution time : 8.696 ms