explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eoFe

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 21,033.847 ↑ 1.0 25 1

Limit (cost=15,963,602.58..15,963,602.64 rows=25 width=419) (actual time=21,033.845..21,033.847 rows=25 loops=1)

  • Planning time: 7.133 ms
  • Execution time: 21034.705 ms
2. 5.081 21,033.844 ↑ 224.2 25 1

Sort (cost=15,963,602.58..15,963,616.59 rows=5,605 width=419) (actual time=21,033.844..21,033.844 rows=25 loops=1)

  • Sort Key: (date_part('year'::text, timezone('UTC'::text, t.date))) DESC, (("substring"(t.number, '[0-9]+'::text))::bigint) DESC
  • Sort Method: top-N heapsort Memory: 53kB
3. 10.797 21,028.763 ↑ 1.0 5,439 1

Result (cost=0.00..15,963,444.41 rows=5,605 width=419) (actual time=20.255..21,028.763 rows=5,439 loops=1)

4. 0.666 21,017.966 ↑ 1.0 5,439 1

Append (cost=0.00..15,963,318.30 rows=5,605 width=402) (actual time=20.229..21,017.966 rows=5,439 loops=1)

5. 2.893 5,050.443 ↑ 1.1 1,286 1

Seq Scan on model_requestcontractor t (cost=0.00..3,867,646.79 rows=1,358 width=443) (actual time=20.228..5,050.443 rows=1,286 loops=1)

  • Filter: ((NOT is_deleted) OR (is_deleted IS NULL))
  • Rows Removed by Filter: 4
6.          

SubPlan (forSeq Scan)

7. 0.000 3.858 ↑ 1.0 1 1,286

Aggregate (cost=2.51..2.52 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,286)

8. 3.858 3.858 ↑ 1.0 1 1,286

Index Scan using document_file_doc_guid on document_file (cost=0.29..2.51 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,286)

  • Index Cond: (doc_guid = t.guid)
9. 0.000 5,043.692 ↑ 1.0 1 1,286

Limit (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.922..3.922 rows=1 loops=1,286)

10. 1.286 5,043.692 ↑ 1.0 1 1,286

Subquery Scan on vc (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.922..3.922 rows=1 loops=1,286)

11. 3.858 5,042.406 ↑ 1.0 1 1,286

Sort (cost=2,845.45..2,845.46 rows=1 width=100) (actual time=3.921..3.921 rows=1 loops=1,286)

  • Sort Key: (comments."array"[3]) DESC
  • Sort Method: quicksort Memory: 25kB
12. 2.572 5,038.548 ↓ 3.0 3 1,286

Subquery Scan on comments (cost=3.15..2,845.44 rows=1 width=100) (actual time=1.679..3.918 rows=3 loops=1,286)

  • Filter: ((comments.type)::text = 'RequestContractor'::text)
  • Rows Removed by Filter: 28
13. 5.144 5,035.976 ↓ 3.1 31 1,286

Append (cost=3.15..2,845.32 rows=10 width=68) (actual time=0.021..3.916 rows=31 loops=1,286)

14. 11.006 21.862 ↑ 1.0 2 1,286

Hash Right Join (cost=3.15..6.62 rows=2 width=44) (actual time=0.010..0.017 rows=2 loops=1,286)

  • Hash Cond: (pr.user_id = mc.author_id)
15. 5.712 5.712 ↑ 1.0 93 952

Seq Scan on tbl_profiles pr (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.006 rows=93 loops=952)

16. 5.144 5.144 ↑ 1.0 2 1,286

Hash (cost=3.13..3.13 rows=2 width=126) (actual time=0.004..0.004 rows=2 loops=1,286)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • -> Index Scan using model_comment_commentable_id_commentable_type_idx on model_comment mc (cost=0.29..3.13 rows=2 width=126) (actual time=0
  • Index Cond: (commentable_id = t.id)
17. 2.572 5,008.970 ↓ 3.5 28 1,286

Subquery Scan on *SELECT* 2 (cost=0.42..2,838.68 rows=8 width=68) (actual time=0.028..3.895 rows=28 loops=1,286)

18. 4,970.071 5,006.398 ↓ 3.5 28 1,286

Nested Loop Left Join (cost=0.42..2,838.60 rows=8 width=43) (actual time=0.028..3.893 rows=28 loops=1,286)

  • Join Filter: (pr_1.user_id = mc_1.user_id)
  • Rows Removed by Join Filter: 1028
  • -> Index Scan using model_document_status_log_model_class_model_id_idx on model_document_status_log mc_1 (cost=0.42..2824.08 rows=8 width=8
  • Index Cond: (model_id = t.id)
19. 36.274 36.327 ↑ 2.5 37 36,327

Materialize (cost=0.00..3.40 rows=93 width=53) (actual time=0.000..0.001 rows=37 loops=36,327)

20. 0.053 0.053 ↑ 1.0 93 1

Seq Scan on tbl_profiles pr_1 (cost=0.00..2.93 rows=93 width=53) (actual time=0.008..0.053 rows=93 loops=1)

21. 0.912 2,615.252 ↓ 1.0 670 1

Seq Scan on model_requestsupervisory t_1 (cost=0.00..1,902,499.41 rows=668 width=423) (actual time=3.921..2,615.252 rows=670 loops=1)

  • Filter: ((NOT is_deleted) OR (is_deleted IS NULL))
  • Rows Removed by Filter: 2
22.          

SubPlan (forSeq Scan)

23. 0.670 2.680 ↑ 1.0 1 670

Aggregate (cost=2.51..2.52 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=670)

24. 2.010 2.010 ↑ 1.0 1 670

Index Scan using document_file_doc_guid on document_file document_file_1 (cost=0.29..2.51 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=670)

  • Index Cond: (doc_guid = t_1.guid)
25. 0.670 2,611.660 ↑ 1.0 1 670

Limit (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.898..3.898 rows=1 loops=670)

26. 0.000 2,610.990 ↑ 1.0 1 670

Subquery Scan on vc_1 (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.897..3.897 rows=1 loops=670)

27. 2.010 2,610.990 ↑ 1.0 1 670

Sort (cost=2,845.45..2,845.46 rows=1 width=100) (actual time=3.897..3.897 rows=1 loops=670)

  • Sort Key: (comments_1."array"[3]) DESC
  • Sort Method: quicksort Memory: 25kB
28. 2.010 2,608.980 ↓ 3.0 3 670

Subquery Scan on comments_1 (cost=3.15..2,845.44 rows=1 width=100) (actual time=1.973..3.894 rows=3 loops=670)

  • Filter: ((comments_1.type)::text = 'RequestSupervisory'::text)
  • Rows Removed by Filter: 34
29. 2.010 2,606.970 ↓ 3.7 37 670

Append (cost=3.15..2,845.32 rows=10 width=68) (actual time=0.016..3.891 rows=37 loops=670)

30. 6.780 12.730 ↓ 1.5 3 670

Hash Right Join (cost=3.15..6.62 rows=2 width=44) (actual time=0.010..0.019 rows=3 loops=670)

  • Hash Cond: (pr_2.user_id = mc_2.author_id)
31. 3.270 3.270 ↑ 1.0 93 545

Seq Scan on tbl_profiles pr_2 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.006 rows=93 loops=545)

32. 2.680 2.680 ↓ 1.5 3 670

Hash (cost=3.13..3.13 rows=2 width=126) (actual time=0.004..0.004 rows=3 loops=670)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • -> Index Scan using model_comment_commentable_id_commentable_type_idx on model_comment mc_2 (cost=0.29..3.13 rows=2 width=126) (actual time
  • Index Cond: (commentable_id = t_1.id)
33. 2.010 2,592.230 ↓ 4.1 33 670

Subquery Scan on *SELECT* 2_1 (cost=0.42..2,838.68 rows=8 width=68) (actual time=0.017..3.869 rows=33 loops=670)

34. 2,567.779 2,590.220 ↓ 4.1 33 670

Nested Loop Left Join (cost=0.42..2,838.60 rows=8 width=43) (actual time=0.017..3.866 rows=33 loops=670)

  • Join Filter: (pr_3.user_id = mc_3.user_id)
  • Rows Removed by Join Filter: 1168
  • -> Index Scan using model_document_status_log_model_class_model_id_idx on model_document_status_log mc_3 (cost=0.42..2824.08 rows=8 width=8
  • Index Cond: (model_id = t_1.id)
35. 22.431 22.441 ↑ 2.6 36 22,441

Materialize (cost=0.00..3.40 rows=93 width=53) (actual time=0.000..0.001 rows=36 loops=22,441)

36. 0.010 0.010 ↑ 1.0 93 1

Seq Scan on tbl_profiles pr_3 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.010 rows=93 loops=1)

37. 7.941 13,335.990 ↓ 1.0 3,479 1

Seq Scan on model_requestperson t_2 (cost=0.00..9,820,072.93 rows=3,448 width=383) (actual time=3.952..13,335.990 rows=3,479 loops=1)

  • Filter: ((NOT is_deleted) OR (is_deleted IS NULL))
  • Rows Removed by Filter: 5
38.          

SubPlan (forSeq Scan)

39. 0.000 10.437 ↑ 1.0 1 3,479

Aggregate (cost=2.51..2.52 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=3,479)

40. 10.437 10.437 ↑ 1.0 1 3,479

Index Scan using document_file_doc_guid on document_file document_file_2 (cost=0.29..2.51 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=3,479)

  • Index Cond: (doc_guid = t_2.guid)
41. 0.000 13,317.612 ↑ 1.0 1 3,479

Limit (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.828..3.828 rows=1 loops=3,479)

42. 3.479 13,317.612 ↑ 1.0 1 3,479

Subquery Scan on vc_2 (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.828..3.828 rows=1 loops=3,479)

43. 10.437 13,314.133 ↑ 1.0 1 3,479

Sort (cost=2,845.45..2,845.46 rows=1 width=100) (actual time=3.827..3.827 rows=1 loops=3,479)

  • Sort Key: (comments_2."array"[3]) DESC
  • Sort Method: quicksort Memory: 25kB
44. 6.958 13,303.696 ↓ 3.0 3 3,479

Subquery Scan on comments_2 (cost=3.15..2,845.44 rows=1 width=100) (actual time=1.735..3.824 rows=3 loops=3,479)

  • Filter: ((comments_2.type)::text = 'RequestPerson'::text)
  • Rows Removed by Filter: 16
45. 6.958 13,296.738 ↓ 1.9 19 3,479

Append (cost=3.15..2,845.32 rows=10 width=68) (actual time=0.117..3.822 rows=19 loops=3,479)

46. 21.255 41.748 ↑ 2.0 1 3,479

Hash Right Join (cost=3.15..6.62 rows=2 width=44) (actual time=0.008..0.012 rows=1 loops=3,479)

  • Hash Cond: (pr_4.user_id = mc_4.author_id)
47. 10.056 10.056 ↑ 1.0 93 1,676

Seq Scan on tbl_profiles pr_4 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.006 rows=93 loops=1,676)

48. 10.437 10.437 ↑ 2.0 1 3,479

Hash (cost=3.13..3.13 rows=2 width=126) (actual time=0.003..0.003 rows=1 loops=3,479)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • -> Index Scan using model_comment_commentable_id_commentable_type_idx on model_comment mc_4 (cost=0.29..3.13 rows=2 width=126) (actual time
  • Index Cond: (commentable_id = t_2.id)
49. 6.958 13,248.032 ↓ 2.2 18 3,479

Subquery Scan on *SELECT* 2_2 (cost=0.42..2,838.68 rows=8 width=68) (actual time=0.163..3.808 rows=18 loops=3,479)

50. 13,178.770 13,241.074 ↓ 2.2 18 3,479

Nested Loop Left Join (cost=0.42..2,838.60 rows=8 width=43) (actual time=0.163..3.806 rows=18 loops=3,479)

  • Join Filter: (pr_5.user_id = mc_5.user_id)
  • Rows Removed by Join Filter: 680
  • -> Index Scan using model_document_status_log_model_class_model_id_idx on model_document_status_log mc_5 (cost=0.42..2824.08 rows=8 width=8
  • Index Cond: (model_id = t_2.id)
51. 62.292 62.304 ↑ 2.4 39 62,304

Materialize (cost=0.00..3.40 rows=93 width=53) (actual time=0.000..0.001 rows=39 loops=62,304)

52. 0.012 0.012 ↑ 1.0 93 1

Seq Scan on tbl_profiles pr_5 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.012 rows=93 loops=1)

53. 0.019 15.615 ↑ 32.8 4 1

Seq Scan on model_requestcommercialoffer t_3 (cost=0.00..373,099.17 rows=131 width=382) (actual time=3.945..15.615 rows=4 loops=1)

  • Filter: ((NOT is_deleted) OR (is_deleted IS NULL))
54.          

SubPlan (forSeq Scan)

55. 0.000 0.016 ↑ 1.0 1 4

Aggregate (cost=2.51..2.52 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=4)

56. 0.016 0.016 ↓ 0.0 0 4

Index Scan using document_file_doc_guid on document_file document_file_3 (cost=0.29..2.51 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=4)

  • Index Cond: (doc_guid = t_3.guid)
57. 0.000 15.580 ↑ 1.0 1 4

Limit (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.895..3.895 rows=1 loops=4)

58. 0.004 15.580 ↑ 1.0 1 4

Subquery Scan on vc_3 (cost=2,845.45..2,845.47 rows=1 width=32) (actual time=3.895..3.895 rows=1 loops=4)

59. 0.016 15.576 ↑ 1.0 1 4

Sort (cost=2,845.45..2,845.46 rows=1 width=100) (actual time=3.894..3.894 rows=1 loops=4)

  • Sort Key: (comments_3."array"[3]) DESC
  • Sort Method: quicksort Memory: 25kB
60. 0.012 15.560 ↓ 2.0 2 4

Subquery Scan on comments_3 (cost=3.15..2,845.44 rows=1 width=100) (actual time=1.664..3.890 rows=2 loops=4)

  • Filter: ((comments_3.type)::text = 'RequestCommercialOffer'::text)
  • Rows Removed by Filter: 36
61. 0.016 15.548 ↓ 3.8 38 4

Append (cost=3.15..2,845.32 rows=10 width=68) (actual time=0.014..3.887 rows=38 loops=4)

62. 0.048 0.092 ↑ 1.0 2 4

Hash Right Join (cost=3.15..6.62 rows=2 width=44) (actual time=0.013..0.023 rows=2 loops=4)

  • Hash Cond: (pr_6.user_id = mc_6.author_id)
63. 0.024 0.024 ↑ 1.0 93 4

Seq Scan on tbl_profiles pr_6 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.006 rows=93 loops=4)

64. 0.020 0.020 ↑ 1.0 2 4

Hash (cost=3.13..3.13 rows=2 width=126) (actual time=0.005..0.005 rows=2 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • -> Index Scan using model_comment_commentable_id_commentable_type_idx on model_comment mc_6 (cost=0.29..3.13 rows=2 width=126) (actual time
  • Index Cond: (commentable_id = t_3.id)
65. 0.012 15.440 ↓ 4.5 36 4

Subquery Scan on *SELECT* 2_3 (cost=0.42..2,838.68 rows=8 width=68) (actual time=0.042..3.860 rows=36 loops=4)

66. 15.285 15.428 ↓ 4.5 36 4

Nested Loop Left Join (cost=0.42..2,838.60 rows=8 width=43) (actual time=0.042..3.857 rows=36 loops=4)

  • Join Filter: (pr_7.user_id = mc_7.user_id)
  • Rows Removed by Join Filter: 1190
  • -> Index Scan using model_document_status_log_model_class_model_id_idx on model_document_status_log mc_7 (cost=0.42..2824.08 rows=8 width=8
  • Index Cond: (model_id = t_3.id)
67. 0.133 0.143 ↑ 2.7 34 143

Materialize (cost=0.00..3.40 rows=93 width=53) (actual time=0.000..0.001 rows=34 loops=143)

68. 0.010 0.010 ↑ 1.0 93 1

Seq Scan on tbl_profiles pr_7 (cost=0.00..2.93 rows=93 width=53) (actual time=0.002..0.010 rows=93 loops=1)