explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GrC

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 239.957 ↓ 2.2 923 1

Limit (cost=799.10..800.16 rows=425 width=2,026) (actual time=239.890..239.957 rows=923 loops=1)

2. 2.183 239.923 ↓ 2.2 923 1

Sort (cost=799.10..800.16 rows=425 width=2,026) (actual time=239.890..239.923 rows=923 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: 741kB
3. 0.695 237.740 ↓ 2.2 923 1

Hash Left Join (cost=527.51..780.55 rows=425 width=2,026) (actual time=3.103..237.740 rows=923 loops=1)

  • Hash Cond: (rd.bank_signer = signers.id)
4. 0.327 237.028 ↓ 2.2 923 1

Hash Left Join (cost=526.42..777.10 rows=425 width=1,612) (actual time=3.049..237.028 rows=923 loops=1)

  • Hash Cond: (mr.giving_id = givings.id)
5. 0.349 236.518 ↓ 2.2 923 1

Hash Left Join (cost=503.67..753.23 rows=425 width=1,608) (actual time=2.841..236.518 rows=923 loops=1)

  • Hash Cond: (mr.verify_id = verifys.id)
6. 0.345 236.008 ↓ 2.2 923 1

Hash Left Join (cost=480.91..729.36 rows=425 width=1,604) (actual time=2.668..236.008 rows=923 loops=1)

  • Hash Cond: (mr.underwriter_id = underwriters.id)
7. 0.384 235.400 ↓ 2.2 923 1

Hash Left Join (cost=458.16..705.49 rows=425 width=1,600) (actual time=2.396..235.400 rows=923 loops=1)

  • Hash Cond: (rd.my_request_id = bg_messages_1.my_request_id)
8. 0.423 234.989 ↓ 2.2 923 1

Hash Left Join (cost=451.76..697.98 rows=425 width=1,596) (actual time=2.362..234.989 rows=923 loops=1)

  • Hash Cond: (rd.my_request_id = bg_messages.my_request_id)
9. 0.488 234.505 ↓ 2.2 923 1

Hash Join (cost=445.29..690.39 rows=425 width=1,588) (actual time=2.292..234.505 rows=923 loops=1)

  • Hash Cond: (mr.user_id = user_table.id)
10. 0.590 233.912 ↓ 2.2 923 1

Nested Loop (cost=422.53..666.51 rows=425 width=1,578) (actual time=2.179..233.912 rows=923 loops=1)

11. 0.415 3.495 ↓ 2.2 923 1

Hash Left Join (cost=207.06..327.79 rows=425 width=1,497) (actual time=1.976..3.495 rows=923 loops=1)

  • Hash Cond: (mr.user_id = a.user_id)
12. 0.973 2.973 ↓ 2.2 923 1

Hash Join (cost=186.11..302.08 rows=425 width=1,489) (actual time=1.858..2.973 rows=923 loops=1)

  • Hash Cond: (c.my_request_id = mr.id)
13. 0.153 0.153 ↓ 1.0 927 1

Seq Scan on customers c (cost=0.00..108.26 rows=926 width=259) (actual time=0.002..0.153 rows=927 loops=1)

14. 0.400 1.847 ↓ 2.1 926 1

Hash (cost=180.64..180.64 rows=437 width=1,234) (actual time=1.847..1.847 rows=926 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 173kB
15. 0.914 1.447 ↓ 2.1 926 1

Hash Join (cost=79.89..180.64 rows=437 width=1,234) (actual time=0.435..1.447 rows=926 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
16. 0.112 0.112 ↓ 1.0 930 1

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

17. 0.166 0.421 ↓ 1.7 955 1

Hash (cost=73.05..73.05 rows=547 width=1,190) (actual time=0.421..0.421 rows=955 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 142kB
18. 0.255 0.255 ↓ 1.7 955 1

Seq Scan on my_requests mr (cost=0.00..73.05 rows=547 width=1,190) (actual time=0.004..0.255 rows=955 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[])))
19. 0.005 0.107 ↑ 1.0 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 0.038 0.102 ↑ 1.0 26 1

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

  • Hash Cond: (u.id = a.user_id)
21. 0.051 0.051 ↓ 1.0 479 1

Seq Scan on users u (cost=0.00..16.78 rows=478 width=8) (actual time=0.002..0.051 rows=479 loops=1)

22. 0.007 0.013 ↑ 1.0 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
23. 0.006 0.006 ↑ 1.0 26 1

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

24. 4.615 229.827 ↑ 1.0 1 923

Hash Right Join (cost=215.47..215.75 rows=1 width=85) (actual time=0.243..0.249 rows=1 loops=923)

  • Hash Cond: ((e2.entity_inn)::text = (e.entity_inn)::text)
25. 9.230 223.366 ↓ 2.4 19 923

GroupAggregate (cost=213.63..213.79 rows=8 width=43) (actual time=0.232..0.242 rows=19 loops=923)

  • Group Key: e2.entity_inn
26. 13.845 214.136 ↓ 3.9 31 923

Sort (cost=213.63..213.65 rows=8 width=18) (actual time=0.231..0.232 rows=31 loops=923)

  • Sort Key: e2.entity_inn
  • Sort Method: quicksort Memory: 32kB
27. 0.000 200.291 ↓ 3.9 31 923

Nested Loop (cost=42.42..213.51 rows=8 width=18) (actual time=0.140..0.217 rows=31 loops=923)

28. 18.560 172.601 ↓ 3.9 31 923

Hash Join (cost=42.14..155.16 rows=8 width=11) (actual time=0.139..0.187 rows=31 loops=923)

  • Hash Cond: (c2.my_request_id = mr2.id)
29. 27.590 27.590 ↑ 1.0 923 310

Seq Scan on customers c2 (cost=0.00..110.58 rows=925 width=11) (actual time=0.000..0.089 rows=923 loops=310)

  • Filter: (my_request_id <> mr.id)
  • Rows Removed by Filter: 1
30. 3.692 126.451 ↓ 3.9 31 923

Hash (cost=42.04..42.04 rows=8 width=8) (actual time=0.137..0.137 rows=31 loops=923)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
31. 122.759 122.759 ↓ 3.9 31 923

Seq Scan on my_requests mr2 (cost=0.00..42.04 rows=8 width=8) (actual time=0.081..0.133 rows=31 loops=923)

  • Filter: (((((mr.guarantor_bank_slug)::text = 'expobank'::text) AND (guarantor_bank_slug IS NULL)) OR ((guarantor_bank_slug)::text = (mr.guarantor_bank_slug)::text)) AND (status = ANY ('{4,5,6,7,8,9,18,21,23}'::integer[])))
  • Rows Removed by Filter: 924
32. 28.842 28.842 ↑ 1.0 1 28,842

Index Scan using entities_pkey on entities e2 (cost=0.27..7.29 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=28,842)

  • Index Cond: (id = mr2.entity_id)
33. 0.000 1.846 ↑ 1.0 1 923

Hash (cost=1.83..1.83 rows=1 width=53) (actual time=0.002..0.002 rows=1 loops=923)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 1.846 1.846 ↑ 1.0 1 923

Index Scan using entities_pkey on entities e (cost=0.27..1.83 rows=1 width=53) (actual time=0.002..0.002 rows=1 loops=923)

  • Index Cond: (id = mr.entity_id)
35. 0.051 0.105 ↓ 1.0 479 1

Hash (cost=16.78..16.78 rows=478 width=14) (actual time=0.105..0.105 rows=479 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
36. 0.054 0.054 ↓ 1.0 479 1

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

37. 0.002 0.061 ↑ 1.5 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.005 0.059 ↑ 1.5 4 1

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

  • Group Key: bg_messages.my_request_id
39. 0.054 0.054 ↑ 1.5 4 1

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
41. 0.002 0.025 ↑ 1.5 2 1

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

  • Group Key: bg_messages_1.my_request_id
42. 0.008 0.023 ↑ 1.5 2 1

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

  • Sort Key: bg_messages_1.my_request_id
  • Sort Method: quicksort Memory: 25kB
43. 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
44. 0.096 0.263 ↓ 1.0 479 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.263..0.263 rows=479 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
45. 0.167 0.167 ↓ 1.0 479 1

Seq Scan on users underwriters (cost=0.00..16.78 rows=478 width=8) (actual time=0.007..0.167 rows=479 loops=1)

46. 0.088 0.161 ↓ 1.0 479 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.161..0.161 rows=479 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
47. 0.073 0.073 ↓ 1.0 479 1

Seq Scan on users verifys (cost=0.00..16.78 rows=478 width=8) (actual time=0.008..0.073 rows=479 loops=1)

48. 0.081 0.183 ↓ 1.0 479 1

Hash (cost=16.78..16.78 rows=478 width=8) (actual time=0.183..0.183 rows=479 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
49. 0.102 0.102 ↓ 1.0 479 1

Seq Scan on users givings (cost=0.00..16.78 rows=478 width=8) (actual time=0.010..0.102 rows=479 loops=1)

50. 0.007 0.017 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
51. 0.010 0.010 ↑ 1.0 4 1

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

Planning time : 10.202 ms
Execution time : 240.295 ms