explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e322

Settings
# exclusive inclusive rows x rows loops node
1. 0.081 46,390.292 ↑ 32.6 15 1

WindowAgg (cost=8,293.18..3,768,834.21 rows=489 width=13) (actual time=46,390.286..46,390.292 rows=15 loops=1)

2. 0.149 46,390.211 ↑ 32.6 15 1

Hash Left Join (cost=8,293.18..3,768,828.10 rows=489 width=4) (actual time=297.923..46,390.211 rows=15 loops=1)

  • Hash Cond: (view_ro_list.client_id = client.id)
3. 9.069 46,337.666 ↑ 32.6 15 1

Subquery Scan on view_ro_list (cost=2,780.12..3,763,308.39 rows=489 width=8) (actual time=245.410..46,337.666 rows=15 loops=1)

  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 963
4. 2.657 10.517 ↑ 1.0 978 1

Sort (cost=2,780.12..2,782.57 rows=978 width=6,188) (actual time=9.614..10.517 rows=978 loops=1)

  • Sort Key: ro.deadline_date, (to_char((ro.deadline_time)::interval, 'HH24:MI'::text)), ro.id
  • Sort Method: quicksort Memory: 101kB
5. 1.807 7.860 ↑ 1.0 978 1

Hash Left Join (cost=4.56..131.04 rows=978 width=6,188) (actual time=3.361..7.860 rows=978 loops=1)

  • Hash Cond: (ro.project_manager_id = COALESCE(sru.manager_id, sru.project_manager_id))
6. 0.499 6.005 ↑ 1.0 978 1

Hash Join (cost=3.31..116.56 rows=978 width=32) (actual time=3.003..6.005 rows=978 loops=1)

  • Hash Cond: (ro.currency_id = currency_currency.id)
7. 0.598 5.473 ↑ 1.0 978 1

Hash Join (cost=2.16..111.28 rows=978 width=36) (actual time=2.948..5.473 rows=978 loops=1)

  • Hash Cond: ((ro.type)::text = (rotc.type)::text)
8. 0.632 3.218 ↑ 1.0 978 1

Hash Join (cost=1.11..96.78 rows=978 width=36) (actual time=1.267..3.218 rows=978 loops=1)

  • Hash Cond: ((ro.status)::text = (rosc.status)::text)
9. 1.370 1.370 ↑ 1.0 978 1

Seq Scan on rent_order ro (cost=0.00..82.22 rows=978 width=60) (actual time=0.022..1.370 rows=978 loops=1)

  • Filter: (id > 0)
10. 0.013 1.216 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=516) (actual time=1.216..1.216 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 1.203 1.203 ↑ 1.0 5 1

Seq Scan on rent_order_status_color rosc (cost=0.00..1.05 rows=5 width=516) (actual time=1.200..1.203 rows=5 loops=1)

12. 0.012 1.657 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=516) (actual time=1.657..1.657 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 1.645 1.645 ↑ 1.0 2 1

Seq Scan on rent_order_type_color rotc (cost=0.00..1.02 rows=2 width=516) (actual time=1.644..1.645 rows=2 loops=1)

14. 0.008 0.033 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=4) (actual time=0.033..0.033 rows=7 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.025 0.025 ↑ 1.0 7 1

Seq Scan on currency_currency (cost=0.00..1.07 rows=7 width=4) (actual time=0.023..0.025 rows=7 loops=1)

16. 0.015 0.048 ↑ 1.0 11 1

Hash (cost=1.11..1.11 rows=11 width=12) (actual time=0.048..0.048 rows=11 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.033 0.033 ↑ 1.0 11 1

Seq Scan on subject_region_user sru (cost=0.00..1.11 rows=11 width=12) (actual time=0.027..0.033 rows=11 loops=1)

18.          

SubPlan (for Subquery Scan)

19. 43.756 46,318.080 ↑ 1.7 45 978

Nested Loop (cost=103.89..7,586.13 rows=76 width=4) (actual time=36.157..47.360 rows=45 loops=978)

20. 3,303.003 46,230.060 ↑ 1.7 45 978

Nested Loop (cost=103.62..7,561.84 rows=76 width=4) (actual time=36.145..47.270 rows=45 loops=978)

21. 23,281.178 36,775.734 ↓ 1.0 6,290 978

Hash Join (cost=103.33..5,336.26 rows=6,042 width=8) (actual time=28.578..37.603 rows=6,290 loops=978)

  • Hash Cond: (ratg_rag.rag_id = rent_order_good_rag.rag_id)
22. 13,492.488 13,492.488 ↑ 1.0 181,621 978

Seq Scan on ratg_rag (cost=0.00..3,129.24 rows=181,624 width=8) (actual time=0.002..13.796 rows=181,621 loops=978)

23. 0.951 2.068 ↑ 1.0 3,409 1

Hash (cost=58.70..58.70 rows=3,570 width=8) (actual time=2.068..2.068 rows=3,409 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 166kB
24. 1.117 1.117 ↓ 1.0 3,571 1

Seq Scan on rent_order_good_rag (cost=0.00..58.70 rows=3,570 width=8) (actual time=0.039..1.117 rows=3,571 loops=1)

25. 6,151.323 6,151.323 ↓ 0.0 0 6,151,323

Index Scan using rent_account_task_pkey on rent_account_task (cost=0.29..0.37 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=6,151,323)

  • Index Cond: (id = ratg_rag.task_id)
  • Filter: ((assigned_user_id = 39) AND ((type)::text = (view_ro_list.type)::text))
  • Rows Removed by Filter: 1
26. 44.264 44.264 ↑ 1.0 1 44,264

Index Scan using rent_order_good_pkey on rent_order_good (cost=0.28..0.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=44,264)

  • Index Cond: (id = rent_order_good_rag.rog_id)
27. 2.431 52.396 ↓ 1.0 12,920 1

Hash (cost=5,354.66..5,354.66 rows=12,672 width=4) (actual time=52.395..52.396 rows=12,920 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 583kB
28. 4.363 49.965 ↓ 1.0 12,920 1

Hash Join (cost=4,354.28..5,354.66 rows=12,672 width=4) (actual time=32.125..49.965 rows=12,920 loops=1)

  • Hash Cond: (sa.subject_id = sa_1.subject_id)
29. 3.648 26.695 ↓ 1.0 12,914 1

Hash Left Join (cost=2,436.54..3,245.22 rows=12,776 width=8) (actual time=13.143..26.695 rows=12,914 loops=1)

  • Hash Cond: ((client.credit_score_id = subject_crm_credit_score.crm_credit_score_id) AND (sa.administrator_subject_id = subject_crm_credit_score.subject_id))
30. 4.020 23.011 ↓ 1.0 12,914 1

Hash Join (cost=2,434.19..3,144.68 rows=12,776 width=16) (actual time=13.086..23.011 rows=12,914 loops=1)

  • Hash Cond: ((sa.administrator_subject_id = sccs.subject_id) AND (client.client_status_id = sccs.crm_client_status_id))
31. 4.791 18.884 ↓ 1.0 12,916 1

Hash Join (cost=2,428.87..2,660.20 rows=12,778 width=20) (actual time=12.951..18.884 rows=12,916 loops=1)

  • Hash Cond: (sa.subject_id = client.id)
32. 1.232 1.232 ↓ 1.0 12,916 1

Seq Scan on subject_administrator sa (cost=0.00..197.78 rows=12,778 width=8) (actual time=0.006..1.232 rows=12,916 loops=1)

33. 2.728 12.861 ↓ 1.0 12,914 1

Hash (cost=2,267.83..2,267.83 rows=12,883 width=12) (actual time=12.861..12.861 rows=12,914 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 683kB
34. 10.133 10.133 ↓ 1.0 12,914 1

Seq Scan on subject_subject client (cost=0.00..2,267.83 rows=12,883 width=12) (actual time=0.006..10.133 rows=12,914 loops=1)

35. 0.025 0.107 ↑ 1.0 108 1

Hash (cost=3.70..3.70 rows=108 width=12) (actual time=0.107..0.107 rows=108 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
36. 0.043 0.082 ↑ 1.0 108 1

Hash Join (cost=1.20..3.70 rows=108 width=12) (actual time=0.045..0.082 rows=108 loops=1)

  • Hash Cond: (sccs.crm_client_status_id = ccs.id)
37. 0.025 0.025 ↑ 1.0 108 1

Seq Scan on subject_crm_client_status sccs (cost=0.00..2.08 rows=108 width=8) (actual time=0.018..0.025 rows=108 loops=1)

38. 0.005 0.014 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=4) (actual time=0.014..0.014 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
39. 0.009 0.009 ↑ 1.0 9 1

Seq Scan on crm_client_status ccs (cost=0.00..1.09 rows=9 width=4) (actual time=0.008..0.009 rows=9 loops=1)

40. 0.013 0.036 ↓ 1.0 55 1

Hash (cost=1.54..1.54 rows=54 width=8) (actual time=0.036..0.036 rows=55 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
41. 0.023 0.023 ↓ 1.0 55 1

Seq Scan on subject_crm_credit_score (cost=0.00..1.54 rows=54 width=8) (actual time=0.015..0.023 rows=55 loops=1)

42. 2.349 18.907 ↓ 1.0 12,916 1

Hash (cost=1,758.02..1,758.02 rows=12,778 width=8) (actual time=18.907..18.907 rows=12,916 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 633kB
43. 3.317 16.558 ↓ 1.0 12,916 1

Hash Join (cost=1,493.13..1,758.02 rows=12,778 width=8) (actual time=8.108..16.558 rows=12,916 loops=1)

  • Hash Cond: (sa_1.administrator_subject_id = administrator.id)
44. 3.899 8.811 ↓ 1.0 12,916 1

Hash Join (cost=746.57..977.90 rows=12,778 width=12) (actual time=3.604..8.811 rows=12,916 loops=1)

  • Hash Cond: (sa_1.subject_id = client_1.id)
45. 1.412 1.412 ↓ 1.0 12,916 1

Seq Scan on subject_administrator sa_1 (cost=0.00..197.78 rows=12,778 width=8) (actual time=0.013..1.412 rows=12,916 loops=1)

46. 1.856 3.500 ↓ 1.0 12,914 1

Hash (cost=585.53..585.53 rows=12,883 width=4) (actual time=3.500..3.500 rows=12,914 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 583kB
47. 1.644 1.644 ↓ 1.0 12,914 1

Index Only Scan using subject_subject_pkey on subject_subject client_1 (cost=0.29..585.53 rows=12,883 width=4) (actual time=0.018..1.644 rows=12,914 loops=1)

  • Heap Fetches: 31
48. 2.074 4.430 ↓ 1.0 12,914 1

Hash (cost=585.53..585.53 rows=12,883 width=4) (actual time=4.430..4.430 rows=12,914 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 583kB
49. 2.356 2.356 ↓ 1.0 12,914 1

Index Only Scan using subject_subject_pkey on subject_subject administrator (cost=0.29..585.53 rows=12,883 width=4) (actual time=0.047..2.356 rows=12,914 loops=1)

  • Heap Fetches: 31
Planning time : 16.872 ms
Execution time : 46,390.948 ms