explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zAXA

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 25,924.676 ↑ 1.0 30 1

Limit (cost=2,804,121.53..2,804,121.60 rows=30 width=38,911) (actual time=25,924.673..25,924.676 rows=30 loops=1)

2. 3,467.911 25,924.671 ↑ 369,714.7 30 1

Sort (cost=2,804,121.53..2,831,850.13 rows=11,091,442 width=38,911) (actual time=25,924.670..25,924.671 rows=30 loops=1)

  • Sort Key: t2.date_ DESC, t1.id DESC
  • Sort Method: top-N heapsort Memory: 209kB
3. 1,442.608 22,456.760 ↑ 13.0 855,845 1

Hash Left Join (cost=2,057.51..2,476,541.85 rows=11,091,442 width=38,911) (actual time=346.714..22,456.760 rows=855,845 loops=1)

  • Hash Cond: (t2.doc_kind_id = t15.id)
4. 1,056.304 21,014.093 ↑ 3.6 855,845 1

Hash Left Join (cost=2,051.03..2,342,513.78 rows=3,080,956 width=35,897) (actual time=346.638..21,014.093 rows=855,845 loops=1)

  • Hash Cond: (t2.project_id = t21.id)
5. 1,219.462 19,957.783 ↑ 3.6 855,845 1

Hash Left Join (cost=2,038.55..2,303,604.24 rows=3,080,956 width=35,241) (actual time=346.623..19,957.783 rows=855,845 loops=1)

  • Hash Cond: (t2.organization_id = t17.id)
6. 2,585.235 18,738.302 ↑ 3.6 855,845 1

Merge Join (cost=2,037.53..2,292,021.37 rows=3,080,956 width=31,570) (actual time=346.587..18,738.302 rows=855,845 loops=1)

  • Merge Cond: (t3.card_id = t1.id)
7. 758.185 7,691.046 ↑ 1.0 856,363 1

Merge Join (cost=1,002.72..1,284,911.91 rows=856,363 width=13,943) (actual time=184.263..7,691.046 rows=856,363 loops=1)

  • Merge Cond: (t2.card_id = t3.card_id)
8. 799.458 6,056.785 ↑ 1.0 856,363 1

Nested Loop Left Join (cost=1,002.29..1,217,470.04 rows=856,363 width=11,750) (actual time=184.254..6,056.785 rows=856,363 loops=1)

9. 1,188.013 4,400.964 ↑ 1.0 856,363 1

Nested Loop Left Join (cost=1,001.72..637,148.91 rows=856,363 width=8,450) (actual time=184.248..4,400.964 rows=856,363 loops=1)

  • Join Filter: (t14.id = t2.category_id)
  • Rows Removed by Join Filter: 3,425,452
10. 977.967 3,212.951 ↑ 1.0 856,363 1

Nested Loop Left Join (cost=1,001.72..585,766.08 rows=856,363 width=7,568) (actual time=184.225..3,212.951 rows=856,363 loops=1)

  • Join Filter: (t12.id = t2.department_id)
  • Rows Removed by Join Filter: 856,018
11. 658.238 2,234.984 ↑ 1.0 856,363 1

Gather Merge (cost=1,001.43..572,911.32 rows=856,363 width=7,379) (actual time=184.173..2,234.984 rows=856,363 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
12. 304.012 1,576.746 ↑ 1.3 285,454 3 / 3

Nested Loop Left Join (cost=1.41..473,065.76 rows=356,818 width=7,379) (actual time=4.519..1,576.746 rows=285,454 loops=3)

13. 290.103 1,272.734 ↑ 1.3 285,454 3 / 3

Nested Loop Left Join (cost=1.13..366,377.70 rows=356,818 width=6,717) (actual time=4.514..1,272.734 rows=285,454 loops=3)

14. 190.085 982.631 ↑ 1.3 285,454 3 / 3

Nested Loop Left Join (cost=0.99..309,496.65 rows=356,818 width=5,449) (actual time=4.507..982.631 rows=285,454 loops=3)

15. 507.092 507.092 ↑ 1.3 285,454 3 / 3

Parallel Index Scan Backward using df_doc_pkey on df_doc t2 (cost=0.42..89,562.81 rows=356,818 width=1,183) (actual time=4.489..507.092 rows=285,454 loops=3)

  • Filter: ((NOT is_template) AND (version_of_id IS NULL) AND (NOT archived))
16. 285.454 285.454 ↓ 0.0 0 856,363 / 3

Nested Loop (cost=0.56..0.61 rows=1 width=4,266) (actual time=0.001..0.001 rows=0 loops=856,363)

17. 0.000 0.000 ↓ 0.0 0 856,363 / 3

Index Scan using df_correspondent_pkey on df_correspondent t7 (cost=0.29..0.31 rows=1 width=91) (actual time=0.000..0.000 rows=0 loops=856,363)

  • Index Cond: (id = t2.contractor_id)
18. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using df_contractor_pkey on df_contractor t8 (cost=0.28..0.30 rows=1 width=4,175) (never executed)

  • Index Cond: (correspondent_id = t7.id)
19. 0.000 0.000 ↓ 0.0 0 856,363 / 3

Index Scan using df_individual_pkey on df_individual t9 (cost=0.14..0.16 rows=1 width=1,268) (actual time=0.000..0.000 rows=0 loops=856,363)

  • Index Cond: (contractor_id = t7.id)
20. 0.000 0.000 ↓ 0.0 0 856,363 / 3

Index Scan using df_company_pkey on df_company t10 (cost=0.28..0.30 rows=1 width=662) (actual time=0.000..0.000 rows=0 loops=856,363)

  • Index Cond: (contractor_id = t7.id)
21. 0.000 0.000 ↑ 1.0 1 856,363

Materialize (cost=0.29..9.32 rows=1 width=189) (actual time=0.000..0.000 rows=1 loops=856,363)

22. 0.004 0.041 ↑ 1.0 1 1

Nested Loop (cost=0.29..9.32 rows=1 width=189) (actual time=0.041..0.041 rows=1 loops=1)

23. 0.016 0.016 ↑ 1.0 1 1

Seq Scan on df_department t13 (cost=0.00..1.01 rows=1 width=98) (actual time=0.016..0.016 rows=1 loops=1)

24. 0.021 0.021 ↑ 1.0 1 1

Index Scan using df_correspondent_pkey on df_correspondent t12 (cost=0.29..8.30 rows=1 width=91) (actual time=0.021..0.021 rows=1 loops=1)

  • Index Cond: (id = t13.correspondent_id)
25. 0.000 0.000 ↑ 1.0 4 856,363

Materialize (cost=0.00..1.06 rows=4 width=882) (actual time=0.000..0.000 rows=4 loops=856,363)

26. 0.015 0.015 ↑ 1.0 4 1

Seq Scan on df_category t14 (cost=0.00..1.04 rows=4 width=882) (actual time=0.015..0.015 rows=4 loops=1)

27. 856.363 856.363 ↓ 0.0 0 856,363

Nested Loop (cost=0.57..0.67 rows=1 width=3,300) (actual time=0.001..0.001 rows=0 loops=856,363)

28. 0.000 0.000 ↓ 0.0 0 856,363

Index Scan using df_correspondent_pkey on df_correspondent t18 (cost=0.29..0.31 rows=1 width=91) (actual time=0.000..0.000 rows=0 loops=856,363)

  • Index Cond: (id = t2.owner_id)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using df_employee_pkey on df_employee t19 (cost=0.29..0.36 rows=1 width=3,209) (never executed)

  • Index Cond: (correspondent_id = t18.id)
30. 876.076 876.076 ↑ 1.0 856,363 1

Index Scan Backward using df_simple_doc_pkey on df_simple_doc t3 (cost=0.42..54,596.42 rows=856,363 width=2,193) (actual time=0.005..876.076 rows=856,363 loops=1)

31. 1,511.078 8,462.021 ↑ 3.6 855,845 1

Materialize (cost=1,034.81..966,456.25 rows=3,081,100 width=17,627) (actual time=162.313..8,462.021 rows=855,845 loops=1)

32. 2,444.747 6,950.943 ↑ 3.6 855,845 1

Nested Loop Left Join (cost=1,034.81..958,753.50 rows=3,081,100 width=17,627) (actual time=162.307..6,950.943 rows=855,845 loops=1)

  • Join Filter: (t4.id = t1.category_id)
  • Rows Removed by Join Filter: 12,837,675
33. 1,725.011 4,506.196 ↑ 1.0 855,845 1

Gather Merge (cost=1,032.45..496,581.51 rows=855,861 width=13,101) (actual time=162.182..4,506.196 rows=855,845 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
34. 447.836 2,781.185 ↑ 1.3 285,282 3 / 3

Nested Loop Left Join (cost=32.42..396,793.89 rows=356,609 width=13,101) (actual time=0.182..2,781.185 rows=285,282 loops=3)

35. 295.732 2,048.067 ↑ 1.3 285,282 3 / 3

Nested Loop Left Join (cost=32.14..286,131.86 rows=356,609 width=9,358) (actual time=0.176..2,048.067 rows=285,282 loops=3)

36. 404.046 1,467.053 ↑ 1.3 285,282 3 / 3

Nested Loop Left Join (cost=32.00..232,067.36 rows=356,609 width=4,741) (actual time=0.159..1,467.053 rows=285,282 loops=3)

37. 107.987 492.444 ↑ 1.3 285,282 3 / 3

Merge Left Join (cost=31.71..121,405.33 rows=356,609 width=998) (actual time=0.130..492.444 rows=285,282 loops=3)

  • Merge Cond: (t1.id = t0.card_id)
38. 384.359 384.359 ↑ 1.3 285,282 3 / 3

Parallel Index Scan Backward using wf_card_pkey on wf_card t1 (cost=0.42..120,478.85 rows=356,609 width=824) (actual time=0.028..384.359 rows=285,282 loops=3)

  • Filter: ((delete_ts IS NULL) AND (card_type = 110))
  • Rows Removed by Filter: 186
39. 0.020 0.098 ↓ 0.0 0 3 / 3

Sort (cost=31.29..32.29 rows=400 width=174) (actual time=0.098..0.098 rows=0 loops=3)

  • Sort Key: t0.card_id DESC
  • Sort Method: quicksort Memory: 25kB
40. 0.078 0.078 ↓ 0.0 0 3 / 3

Seq Scan on ts_card_additional_info t0 (cost=0.00..14.00 rows=400 width=174) (actual time=0.078..0.078 rows=0 loops=3)

41. 570.563 570.563 ↑ 1.0 1 855,845 / 3

Index Scan using sec_user_pkey on sec_user t11 (cost=0.29..0.31 rows=1 width=3,743) (actual time=0.002..0.002 rows=1 loops=855,845)

  • Index Cond: (id = t1.creator_id)
42. 285.282 285.282 ↑ 1.0 1 855,845 / 3

Index Scan using wf_proc_pkey on wf_proc t20 (cost=0.14..0.15 rows=1 width=4,617) (actual time=0.001..0.001 rows=1 loops=855,845)

  • Index Cond: (id = t1.proc_id)
43. 285.282 285.282 ↑ 1.0 1 855,845 / 3

Index Scan using sec_user_pkey on sec_user t22 (cost=0.29..0.31 rows=1 width=3,743) (actual time=0.001..0.001 rows=1 loops=855,845)

  • Index Cond: (id = t1.substituted_creator_id)
44. 0.000 0.000 ↑ 2.2 16 855,845

Materialize (cost=2.36..7.14 rows=36 width=4,526) (actual time=0.000..0.000 rows=16 loops=855,845)

45. 0.023 0.112 ↑ 2.2 16 1

Hash Right Join (cost=2.36..6.96 rows=36 width=4,526) (actual time=0.088..0.112 rows=16 loops=1)

  • Hash Cond: (t5.category_id = t4.id)
46. 0.021 0.021 ↑ 2.4 15 1

Seq Scan on df_doc_kind t5 (cost=0.00..4.36 rows=36 width=1,323) (actual time=0.010..0.021 rows=15 loops=1)

47. 0.017 0.068 ↓ 1.6 16 1

Hash (cost=2.24..2.24 rows=10 width=3,203) (actual time=0.068..0.068 rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
48. 0.021 0.051 ↓ 1.6 16 1

Hash Left Join (cost=1.02..2.24 rows=10 width=3,203) (actual time=0.044..0.051 rows=16 loops=1)

  • Hash Cond: (t4.id = t6.category_id)
49. 0.014 0.014 ↓ 1.6 16 1

Seq Scan on sys_category t4 (cost=0.00..1.10 rows=10 width=1,671) (actual time=0.013..0.014 rows=16 loops=1)

50. 0.006 0.016 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=1,532) (actual time=0.016..0.016 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
51. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on tm_task_type t6 (cost=0.00..1.01 rows=1 width=1,532) (actual time=0.010..0.010 rows=1 loops=1)

52. 0.009 0.019 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=3,671) (actual time=0.019..0.019 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
53. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on df_organization t17 (cost=0.00..1.01 rows=1 width=3,671) (actual time=0.010..0.010 rows=1 loops=1)

54. 0.001 0.006 ↓ 0.0 0 1

Hash (cost=11.10..11.10 rows=110 width=656) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
55. 0.005 0.005 ↓ 0.0 0 1

Seq Scan on tm_project t21 (cost=0.00..11.10 rows=110 width=656) (actual time=0.005..0.005 rows=0 loops=1)

56. 0.019 0.059 ↑ 2.4 15 1

Hash (cost=6.03..6.03 rows=36 width=2,994) (actual time=0.059..0.059 rows=15 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
57. 0.016 0.040 ↑ 2.4 15 1

Hash Join (cost=1.23..6.03 rows=36 width=2,994) (actual time=0.026..0.040 rows=15 loops=1)

  • Hash Cond: (t16.category_id = t15.id)
58. 0.009 0.009 ↑ 2.4 15 1

Seq Scan on df_doc_kind t16 (cost=0.00..4.36 rows=36 width=1,323) (actual time=0.004..0.009 rows=15 loops=1)

59. 0.009 0.015 ↓ 1.6 16 1

Hash (cost=1.10..1.10 rows=10 width=1,671) (actual time=0.015..0.015 rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
60. 0.006 0.006 ↓ 1.6 16 1

Seq Scan on sys_category t15 (cost=0.00..1.10 rows=10 width=1,671) (actual time=0.005..0.006 rows=16 loops=1)