explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mbWx

Settings
# exclusive inclusive rows x rows loops node
1. 22.820 431.909 ↓ 1.3 11,508 1

Result (cost=15,784.41..292,018.80 rows=8,676 width=99) (actual time=129.185..431.909 rows=11,508 loops=1)

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

Hash Left Join (cost=15,784.41..291,628.38 rows=8,676 width=252) (actual time=129.124..409.089 rows=11,508 loops=1)

  • Hash Cond: (ev.entity_field_uuid = ef.uuid)
3. 5.998 400.393 ↓ 1.3 11,508 1

Hash Left Join (cost=15,367.52..291,177.66 rows=8,676 width=241) (actual time=128.312..400.393 rows=11,508 loops=1)

  • Hash Cond: (erv.document_uuid = doc.uuid)
4. 11.148 375.352 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=14,758.13..290,545.50 rows=8,676 width=225) (actual time=109.264..375.352 rows=11,508 loops=1)

5. 6.374 295.156 ↓ 1.3 11,508 1

Hash Left Join (cost=14,746.92..176,786.34 rows=8,676 width=214) (actual time=109.259..295.156 rows=11,508 loops=1)

  • Hash Cond: (erv.select_option_uuid = so.uuid)
6. 6.386 287.457 ↓ 1.3 11,508 1

Hash Left Join (cost=13,929.24..175,945.90 rows=8,676 width=216) (actual time=107.928..287.457 rows=11,508 loops=1)

  • Hash Cond: (erv.workflow_status_uuid = ws.uuid)
7. 12.091 280.956 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,877.97..175,871.84 rows=8,676 width=216) (actual time=107.808..280.956 rows=11,508 loops=1)

8. 11.132 188.309 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,877.55..154,857.89 rows=8,676 width=168) (actual time=107.802..188.309 rows=11,508 loops=1)

  • Join Filter: ((ev.entity_uuid = ect.to_entity_uuid) AND (ev.entity_field_uuid = ect.to_entity_field_uuid))
9. 12.008 165.669 ↓ 1.3 11,508 1

Nested Loop Left Join (cost=13,877.55..154,126.54 rows=8,676 width=152) (actual time=95.633..165.669 rows=11,508 loops=1)

  • Join Filter: ((ev.entity_uuid = ecf.from_entity_uuid) AND (ev.entity_field_uuid = ecf.from_entity_field_uuid))
10. 7.404 142.153 ↓ 1.3 11,508 1

Hash Join (cost=13,877.55..153,395.18 rows=8,676 width=136) (actual time=83.178..142.153 rows=11,508 loops=1)

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

Bitmap Heap Scan on entity_value ev (cost=2,951.33..142,438.60 rows=11,568 width=136) (actual time=14.672..66.595 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: 177659
  • Heap Blocks: exact=9519
12. 13.254 13.254 ↓ 1.0 189,339 1

Bitmap Index Scan on ux_entity_reference_value_for_field_in_entity (cost=0.00..2,948.44 rows=187,883 width=0) (actual time=13.253..13.254 rows=189,339 loops=1)

13. 0.221 68.154 ↑ 375.1 551 1

Hash (cost=8,342.83..8,342.83 rows=206,671 width=16) (actual time=68.153..68.154 rows=551 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2074kB
14. 57.869 67.933 ↑ 375.1 551 1

Index Only Scan using ux_entity_uuid on entity e (cost=11.21..8,342.83 rows=206,671 width=16) (actual time=10.341..67.933 rows=551 loops=1)

  • Filter: ((hashed SubPlan 1) OR (hashed SubPlan 2))
  • Rows Removed by Filter: 275051
  • Heap Fetches: 25497
15.          

SubPlan (for Index Only Scan)

16. 10.059 10.060 ↑ 1.8 551 1

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

17. 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)

18. 0.001 0.004 ↓ 0.0 0 1

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

19. 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)

20. 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)

21. 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)

22. 12.450 12.450 ↓ 0.0 0 1

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

  • Filter: ((NOT deleted) AND (company_id = get_company_id(current_setting('gan.company_token'::text, true))))
  • Rows Removed by Filter: 1622
23. 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)

24. 12.166 12.166 ↓ 0.0 0 1

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

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

Index Scan using ux_entity_reference_value_uuid on entity_reference_value erv (cost=0.43..2.42 rows=1 width=80) (actual time=0.007..0.007 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)))
26. 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
27. 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.033..0.109 rows=9 loops=1)

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
28. 0.041 1.325 ↑ 1.0 105 1

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

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

  • Index Cond: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
30. 16.483 69.048 ↓ 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.006..0.006 rows=0 loops=11,508)

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

SubPlan (for Index Scan)

32. 52.564 52.565 ↓ 18.3 18,317 1

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

33. 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)

34. 0.000 0.000 ↓ 0.0 0

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

35. 0.000 0.000 ↓ 0.0 0

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

36. 0.000 0.000 ↓ 0.0 0

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

37. 0.034 19.043 ↑ 1.0 63 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
38. 19.009 19.009 ↑ 1.0 63 1

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

  • Filter: (company_id = get_company_id(current_setting('gan.company_token'::text, true)))
  • Rows Removed by Filter: 1996
39. 0.027 0.806 ↓ 1.2 62 1

Hash (cost=415.99..415.99 rows=52 width=43) (actual time=0.805..0.806 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
40. 0.028 0.779 ↓ 1.2 62 1

Subquery Scan on ef (cost=0.54..415.99 rows=52 width=43) (actual time=0.032..0.779 rows=62 loops=1)

41. 0.751 0.751 ↓ 1.2 62 1

Index Scan using entity_field_uuid_company_id_unique on entity_field (cost=0.54..415.47 rows=52 width=257) (actual time=0.031..0.751 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 : 9.378 ms
Execution time : 434.807 ms