explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Do7A

Settings
# exclusive inclusive rows x rows loops node
1. 31.409 577.886 ↓ 1.5 11,508 1

Result (cost=16,067.69..429,684.65 rows=7,823 width=99) (actual time=109.852..577.886 rows=11,508 loops=1)

  • One-Time Filter: (get_company_id(current_setting('gan.company_token'::text, true)) = 389)
2. 10.080 546.477 ↓ 1.5 11,508 1

Hash Left Join (cost=16,067.69..429,332.61 rows=7,823 width=409) (actual time=109.803..546.477 rows=11,508 loops=1)

  • Hash Cond: (ev.entity_field_uuid = ef.uuid)
3. 16.934 535.529 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=15,650.46..428,884.89 rows=7,823 width=398) (actual time=108.926..535.529 rows=11,508 loops=1)

4. 7.727 518.595 ↓ 1.5 11,508 1

Hash Left Join (cost=15,650.18..424,467.57 rows=7,823 width=382) (actual time=108.921..518.595 rows=11,508 loops=1)

  • Hash Cond: (referenced_reference_value.workflow_status_uuid = referenced_workflow_status.uuid)
5. 15.618 510.784 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=15,598.91..424,395.76 rows=7,823 width=382) (actual time=108.830..510.784 rows=11,508 loops=1)

6. 7.822 495.166 ↓ 1.5 11,508 1

Hash Left Join (cost=15,598.63..419,978.44 rows=7,823 width=366) (actual time=108.824..495.166 rows=11,508 loops=1)

  • Hash Cond: (referenced_reference_value.select_option_uuid = referenced_select_option.uuid)
7. 16.832 486.369 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=14,780.96..419,140.23 rows=7,823 width=368) (actual time=107.842..486.369 rows=11,508 loops=1)

8. 15.679 469.537 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=14,769.74..316,564.14 rows=7,823 width=357) (actual time=107.838..469.537 rows=11,508 loops=1)

9. 16.482 453.858 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=14,769.31..294,020.46 rows=7,823 width=309) (actual time=107.833..453.858 rows=11,508 loops=1)

10. 16.890 437.376 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=14,768.89..277,417.02 rows=7,823 width=257) (actual time=107.827..437.376 rows=11,508 loops=1)

11. 8.208 339.930 ↓ 1.5 11,508 1

Hash Left Join (cost=14,757.68..174,840.93 rows=7,823 width=246) (actual time=107.821..339.930 rows=11,508 loops=1)

  • Hash Cond: (erv.select_option_uuid = so.uuid)
12. 8.001 330.358 ↓ 1.5 11,508 1

Hash Left Join (cost=13,940.00..174,002.73 rows=7,823 width=248) (actual time=106.450..330.358 rows=11,508 loops=1)

  • Hash Cond: (erv.workflow_status_uuid = ws.uuid)
13. 17.281 322.238 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=13,888.73..173,930.92 rows=7,823 width=248) (actual time=106.322..322.238 rows=11,508 loops=1)

14. 13.702 201.385 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=13,888.31..154,711.92 rows=7,823 width=168) (actual time=106.314..201.385 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. 13.888 176.175 ↓ 1.5 11,508 1

Nested Loop Left Join (cost=13,888.31..153,995.49 rows=7,823 width=152) (actual time=93.386..176.175 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. 8.629 150.779 ↓ 1.5 11,508 1

Hash Join (cost=13,888.31..153,279.07 rows=7,823 width=136) (actual time=81.240..150.779 rows=11,508 loops=1)

  • Hash Cond: (ev.entity_uuid = e.uuid)
17. 74.655 74.655 ↓ 1.1 11,508 1

Bitmap Heap Scan on entity_value ev (cost=2,957.54..142,320.92 rows=10,430 width=136) (actual time=13.442..74.655 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: 178106
  • Heap Blocks: exact=9527
  • -> Bitmap Index Scan on ux_entity_reference_value_for_field_in_entity (cost=0.00..2954.93 rows=187642 width=0) (actual time=12.017..12.017 rows=189794 loops (...)
18. 0.265 67.495 ↑ 375.2 551 1

Hash (cost=8,346.63..8,346.63 rows=206,731 width=16) (actual time=67.494..67.495 rows=551 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2074kB
19. 58.252 67.230 ↑ 375.2 551 1

Index Only Scan using ux_entity_uuid on entity e (cost=11.21..8,346.63 rows=206,731 width=16) (actual time=9.248..67.230 rows=551 loops=1)

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

SubPlan (for Index Only Scan)

21. 8.973 8.974 ↑ 1.8 551 1

ProjectSet (cost=0.00..5.27 rows=1,000 width=16) (actual time=8.844..8.974 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.000 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.003 0.004 ↓ 0.0 0 1

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual time=0.004..0.004 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.000..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.141 12.141 ↓ 0.0 0 1

Seq Scan on entity_connection ecf (cost=0.00..579.52 rows=1 width=48) (actual time=12.141..12.141 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.923 12.923 ↓ 0.0 0 1

Seq Scan on entity_connection ect (cost=0.00..579.52 rows=1 width=48) (actual time=12.922..12.923 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. 103.572 103.572 ↓ 0.0 0 11,508

Index Scan using ux_entity_reference_value_uuid on entity_reference_value erv (cost=0.43..2.46 rows=1 width=112) (actual time=0.009..0.009 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.007 0.119 ↑ 1.0 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.112 0.112 ↑ 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.033..0.112 rows=9 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
34. 1.319 1.319 ↑ 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.078..1.319 rows=105 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
35. 20.193 80.556 ↓ 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.007..0.007 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. 60.362 60.363 ↓ 18.3 18,317 1

ProjectSet (cost=0.00..5.27 rows=1,000 width=16) (actual time=52.550..60.363 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.000..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.000 0.000 ↓ 0.0 0 11,508

Index Scan using ux_entity_reference_value_for_field_in_entity on entity_value referenced_value (cost=0.42..2.11 rows=1 width=116) (actual time=0.000..0.000 rows=0 loops=11,508)

  • Index Cond: ((entity_field_uuid = erv.referenced_entity_field_uuid) AND (entity_uuid = erv.referenced_entity_uuid))
  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
43. 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.88 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)))
44. 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))
45.          

SubPlan (for Index Scan)

46. 0.000 0.000 ↓ 0.0 0

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

47. 0.000 0.000 ↓ 0.0 0

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

48. 0.000 0.000 ↓ 0.0 0

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

49. 0.000 0.000 ↓ 0.0 0

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

50. 0.000 0.000 ↓ 0.0 0

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

51. 0.044 0.975 ↑ 1.0 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
52. 0.931 0.931 ↑ 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.065..0.931 rows=105 loops=1)

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

Index Scan using document_uuid_unique on document referenced_document (cost=0.28..0.56 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=11,508)

  • Index Cond: (uuid = referenced_reference_value.document_uuid)
  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
54. 0.006 0.084 ↑ 1.0 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
55. 0.078 0.078 ↑ 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.034..0.078 rows=9 loops=1)

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

Index Scan using document_uuid_unique on document doc (cost=0.28..0.56 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=11,508)

  • Index Cond: (erv.document_uuid = uuid)
  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
57. 0.030 0.868 ↓ 1.2 62 1

Hash (cost=416.32..416.32 rows=52 width=43) (actual time=0.868..0.868 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
58. 0.031 0.838 ↓ 1.2 62 1

Subquery Scan on ef (cost=0.54..416.32 rows=52 width=43) (actual time=0.038..0.838 rows=62 loops=1)

59. 0.807 0.807 ↓ 1.2 62 1

Index Scan using entity_field_uuid_company_id_unique on entity_field (cost=0.54..415.80 rows=52 width=257) (actual time=0.037..0.807 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.365 ms
Execution time : 581.584 ms