explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I8Px

Settings
# exclusive inclusive rows x rows loops node
1. 26.037 66,237.663 ↓ 1.3 11,508 1

Result (cost=2,140,760.87..2,565,283.50 rows=8,874 width=99) (actual time=65,866.613..66,237.663 rows=11,508 loops=1)

  • One-Time Filter: (get_company_id(current_setting('gan.company_token'::text, true)) = 389)
2. 8.732 66,211.626 ↓ 1.3 11,508 1

Hash Left Join (cost=2,140,760.87..2,564,884.17 rows=8,874 width=409) (actual time=65,866.562..66,211.626 rows=11,508 loops=1)

  • Hash Cond: (ev.entity_field_uuid = ef.uuid)
3. 6.585 66,202.030 ↓ 1.3 11,508 1

Hash Left Join (cost=2,140,343.87..2,564,432.56 rows=8,874 width=398) (actual time=65,865.690..66,202.030 rows=11,508 loops=1)

  • Hash Cond: (referenced_reference_value.workflow_status_uuid = referenced_workflow_status.uuid)
4. 6.405 66,195.332 ↓ 1.3 11,508 1

Hash Left Join (cost=2,140,292.60..2,564,357.99 rows=8,874 width=398) (actual time=65,865.570..66,195.332 rows=11,508 loops=1)

  • Hash Cond: (referenced_reference_value.document_uuid = referenced_document.uuid)
5. 6.396 66,169.643 ↓ 1.3 11,508 1

Hash Left Join (cost=2,139,683.22..2,563,725.30 rows=8,874 width=382) (actual time=65,846.279..66,169.643 rows=11,508 loops=1)

  • Hash Cond: (referenced_reference_value.select_option_uuid = referenced_select_option.uuid)
6. 13.635 66,161.924 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=2,138,865.54..2,562,884.34 rows=8,874 width=384) (actual time=65,844.946..66,161.924 rows=11,508 loops=1)

7. 13.552 66,148.289 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=2,138,854.33..2,446,527.41 rows=8,874 width=373) (actual time=65,844.938..66,148.289 rows=11,508 loops=1)

8. 6.782 66,134.737 ↓ 1.3 11,508 1

Hash Left Join (cost=2,138,853.90..2,425,916.68 rows=8,874 width=325) (actual time=65,844.928..66,134.737 rows=11,508 loops=1)

  • Hash Cond: ((erv.referenced_entity_uuid = referenced_value.entity_uuid) AND (erv.referenced_entity_field_uuid = referenced_value.entity_field_uuid))
9. 6.337 417.546 ↓ 1.3 11,508 1

Hash Left Join (cost=15,373.65..293,939.56 rows=8,874 width=273) (actual time=134.482..417.546 rows=11,508 loops=1)

  • Hash Cond: (erv.document_uuid = doc.uuid)
10. 16.807 390.148 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=14,764.26..293,306.88 rows=8,874 width=257) (actual time=113.413..390.148 rows=11,508 loops=1)

11. 6.793 315.801 ↓ 1.3 11,508 1

Hash Left Join (cost=14,753.04..176,949.95 rows=8,874 width=246) (actual time=113.407..315.801 rows=11,508 loops=1)

  • Hash Cond: (erv.select_option_uuid = so.uuid)
12. 6.724 307.006 ↓ 1.3 11,508 1

Hash Left Join (cost=13,935.37..176,108.99 rows=8,874 width=248) (actual time=111.398..307.006 rows=11,508 loops=1)

  • Hash Cond: (erv.workflow_status_uuid = ws.uuid)
13. 11.132 300.167 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,884.10..176,034.41 rows=8,874 width=248) (actual time=111.274..300.167 rows=11,508 loops=1)

14. 11.269 196.971 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,883.68..154,609.61 rows=8,874 width=168) (actual time=111.267..196.971 rows=11,508 loops=1)

  • Join Filter: ((ev.entity_uuid = ect.to_entity_uuid) AND (ev.entity_field_uuid = ect.to_entity_field_uuid))
15. 12.544 174.194 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,883.68..153,874.79 rows=8,874 width=152) (actual time=99.015..174.194 rows=11,508 loops=1)

  • Join Filter: ((ev.entity_uuid = ecf.from_entity_uuid) AND (ev.entity_field_uuid = ecf.from_entity_field_uuid))
16. 7.855 150.142 ↓ 1.3 11,508 1

Hash Join (cost=13,883.68..153,139.98 rows=8,874 width=136) (actual time=86.166..150.142 rows=11,508 loops=1)

  • Hash Cond: (ev.entity_uuid = e.uuid)
17. 69.627 69.627 ↑ 1.0 11,508 1

Bitmap Heap Scan on entity_value ev (cost=2,953.24..142,178.48 rows=11,832 width=136) (actual time=13.054..69.627 rows=11,508 loops=1)

  • Recheck Cond: (NOT deleted)
  • Filter: ((company_id = 389) AND (entity_config_uuid = '5bbba791-1638-4557-acdd-a812d38bded9'::uuid))
  • Rows Removed by Filter: 178076
  • Heap Blocks: exact=9527
  • -> Bitmap Index Scan on ux_entity_reference_value_for_field_in_entity (cost=0.00..2950.28 rows=187372 width=0) (actual time=11.646..11.647 rows=189754 loops (...)
18. 0.248 72.660 ↑ 375.2 551 1

Hash (cost=8,346.41..8,346.41 rows=206,722 width=16) (actual time=72.660..72.660 rows=551 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2074kB
19. 63.647 72.412 ↑ 375.2 551 1

Index Only Scan using ux_entity_uuid on entity e (cost=11.21..8,346.41 rows=206,722 width=16) (actual time=9.044..72.412 rows=551 loops=1)

  • Filter: ((hashed SubPlan 1) OR (hashed SubPlan 2))
  • Rows Removed by Filter: 275089
  • Heap Fetches: 25632
20.          

SubPlan (for Index Only Scan)

21. 8.760 8.761 ↑ 1.8 551 1

ProjectSet (cost=0.00..5.27 rows=1,000 width=16) (actual time=8.632..8.761 rows=551 loops=1)

22. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1)

23. 0.001 0.004 ↓ 0.0 0 1

Result (cost=0.00..2.77 rows=100 width=16) (actual time=0.004..0.004 rows=0 loops=1)

24. 0.002 0.003 ↓ 0.0 0 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.003..0.003 rows=0 loops=1)

25. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

26. 0.000 11.508 ↓ 0.0 0 11,508

Materialize (cost=0.00..579.52 rows=1 width=48) (actual time=0.001..0.001 rows=0 loops=11,508)

27. 12.845 12.845 ↓ 0.0 0 1

Seq Scan on entity_connection ecf (cost=0.00..579.52 rows=1 width=48) (actual time=12.845..12.845 rows=0 loops=1)

  • Filter: ((NOT deleted) AND (company_id = get_company_id(current_setting('gan.company_token'::text, true))))
  • Rows Removed by Filter: 1629
28. 0.000 11.508 ↓ 0.0 0 11,508

Materialize (cost=0.00..579.52 rows=1 width=48) (actual time=0.001..0.001 rows=0 loops=11,508)

29. 12.248 12.248 ↓ 0.0 0 1

Seq Scan on entity_connection ect (cost=0.00..579.52 rows=1 width=48) (actual time=12.248..12.248 rows=0 loops=1)

  • Filter: ((NOT deleted) AND (company_id = get_company_id(current_setting('gan.company_token'::text, true))))
  • Rows Removed by Filter: 1629
30. 92.064 92.064 ↓ 0.0 0 11,508

Index Scan using ux_entity_reference_value_uuid on entity_reference_value erv (cost=0.43..2.41 rows=1 width=112) (actual time=0.008..0.008 rows=0 loops=11,508)

  • Index Cond: (ev.entity_reference_value_uuid = uuid)
  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
31. 0.006 0.115 ↑ 1.0 9 1

Hash (cost=51.16..51.16 rows=9 width=32) (actual time=0.115..0.115 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.109 0.109 ↑ 1.0 9 1

Index Scan using workflow_status_uuid_company_id_unique on workflow_status ws (cost=0.53..51.16 rows=9 width=32) (actual time=0.032..0.109 rows=9 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
33. 0.045 2.002 ↑ 1.0 105 1

Hash (cost=816.36..816.36 rows=105 width=30) (actual time=2.002..2.002 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
34. 1.957 1.957 ↑ 1.0 105 1

Index Scan using c_select_option_position_unique on select_option so (cost=0.67..816.36 rows=105 width=30) (actual time=0.105..1.957 rows=105 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
35. 11.384 57.540 ↓ 0.0 0 11,508

Index Scan using employee_uuid_unique on employee em (cost=11.22..13.11 rows=1 width=43) (actual time=0.005..0.005 rows=0 loops=11,508)

  • Index Cond: (erv.employee_uuid = uuid)
  • Filter: ((hashed SubPlan 3) OR (hashed SubPlan 4))
36.          

SubPlan (for Index Scan)

37. 46.155 46.156 ↓ 18.3 18,317 1

ProjectSet (cost=0.00..5.27 rows=1,000 width=16) (actual time=41.911..46.156 rows=18,317 loops=1)

38. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

39. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.77 rows=100 width=16) (never executed)

40. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..0.52 rows=100 width=32) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=0) (never executed)

42. 0.049 21.061 ↑ 1.0 63 1

Hash (cost=608.60..608.60 rows=63 width=48) (actual time=21.061..21.061 rows=63 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
43. 21.012 21.012 ↑ 1.0 63 1

Seq Scan on document doc (cost=0.00..608.60 rows=63 width=48) (actual time=0.628..21.012 rows=63 loops=1)

  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
  • Rows Removed by Filter: 2002
44. 8.757 65,710.409 ↑ 1.1 14,200 1

Hash (cost=2,123,252.04..2,123,252.04 rows=15,214 width=116) (actual time=65,710.409..65,710.409 rows=14,200 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1260kB
45. 65,701.652 65,701.652 ↑ 1.1 14,200 1

Seq Scan on entity_value referenced_value (cost=0.00..2,123,252.04 rows=15,214 width=116) (actual time=16.017..65,701.652 rows=14,200 loops=1)

  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
  • Rows Removed by Filter: 7128599
46. 0.000 0.000 ↓ 0.0 0 11,508

Index Scan using ux_entity_reference_value_uuid on entity_reference_value referenced_reference_value (cost=0.43..2.32 rows=1 width=80) (actual time=0.000..0.000 rows=0 loops=11,508)

  • Index Cond: (uuid = referenced_value.entity_reference_value_uuid)
  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
47. 0.000 0.000 ↓ 0.0 0 11,508

Index Scan using employee_uuid_unique on employee referenced_employee (cost=11.22..13.11 rows=1 width=43) (actual time=0.000..0.000 rows=0 loops=11,508)

  • Index Cond: (uuid = referenced_reference_value.employee_uuid)
  • Filter: ((hashed SubPlan 5) OR (hashed SubPlan 6))
48.          

SubPlan (for Index Scan)

49. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..5.27 rows=1,000 width=16) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=0) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.77 rows=100 width=16) (never executed)

52. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.00..0.52 rows=100 width=32) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=0) (never executed)

54. 0.045 1.323 ↑ 1.0 105 1

Hash (cost=816.36..816.36 rows=105 width=30) (actual time=1.322..1.323 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
55. 1.278 1.278 ↑ 1.0 105 1

Index Scan using c_select_option_position_unique on select_option referenced_select_option (cost=0.67..816.36 rows=105 width=30) (actual time=0.082..1.278 rows=105 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
56. 0.034 19.284 ↑ 1.0 63 1

Hash (cost=608.60..608.60 rows=63 width=48) (actual time=19.284..19.284 rows=63 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
57. 19.250 19.250 ↑ 1.0 63 1

Seq Scan on document referenced_document (cost=0.00..608.60 rows=63 width=48) (actual time=0.640..19.250 rows=63 loops=1)

  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
  • Rows Removed by Filter: 2002
58. 0.006 0.113 ↑ 1.0 9 1

Hash (cost=51.16..51.16 rows=9 width=32) (actual time=0.113..0.113 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
59. 0.107 0.107 ↑ 1.0 9 1

Index Scan using workflow_status_uuid_company_id_unique on workflow_status referenced_workflow_status (cost=0.53..51.16 rows=9 width=32) (actual time=0.029..0.107 rows=9 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
60. 0.030 0.864 ↓ 1.2 62 1

Hash (cost=416.09..416.09 rows=52 width=43) (actual time=0.864..0.864 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
61. 0.030 0.834 ↓ 1.2 62 1

Subquery Scan on ef (cost=0.54..416.09 rows=52 width=43) (actual time=0.042..0.834 rows=62 loops=1)

62. 0.804 0.804 ↓ 1.2 62 1

Index Scan using entity_field_uuid_company_id_unique on entity_field (cost=0.54..415.57 rows=52 width=257) (actual time=0.041..0.804 rows=62 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
  • Filter: (reportable AND (NOT deleted))
  • Rows Removed by Filter: 1
Planning time : 12.105 ms
Execution time : 66,240.815 ms