explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j9xP

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=135,573.22..138,942.62 rows=168,470 width=226) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=135,573.22..135,994.40 rows=168,470 width=226) (actual rows= loops=)

  • Sort Key: rn.id, rn.client_entity_seq_id, rn.name, rn.status_id, tz.id, (array_to_string(array_agg(DISTINCT ct.name), ', '::text)), (array_to_string(array_agg(DISTINCT cst.name), ', '::text))
3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=108,470.28..110,154.98 rows=168,470 width=226) (actual rows= loops=)

  • Group Key: rn.id, tz.id, (array_to_string(array_agg(DISTINCT ct.name), ', '::text)), (array_to_string(array_agg(DISTINCT cst.name), ', '::text))
4. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=42,778.68..106,785.58 rows=168,470 width=101) (actual rows= loops=)

  • Hash Cond: (wftc.task_id = wft.id)
  • Join Filter: (du.role_group_id = ANY (wftc.task_owners))
5. 0.000 0.000 ↓ 0.0

Seq Scan on work_flow_task_configuration wftc (cost=0.00..57,323.02 rows=776,602 width=21) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash (cost=40,672.80..40,672.80 rows=168,470 width=109) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=7,886.76..40,672.80 rows=168,470 width=109) (actual rows= loops=)

  • Merge Cond: (wft.work_flow_id = wf.id)
8. 0.000 0.000 ↓ 0.0

Index Scan using work_flow_task_wfid_idx on work_flow_task wft (cost=0.42..28,308.16 rows=780,502 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=7,886.33..7,892.16 rows=2,329 width=109) (actual rows= loops=)

  • Sort Key: wf.id
10. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=6,210.29..7,756.08 rows=2,329 width=109) (actual rows= loops=)

  • Merge Cond: (rn.id = du.entity_id)
  • Join Filter: (du.role_group_id = rg.id)
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=5,678.57..5,808.91 rows=2,329 width=109) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,675.96..5,708.68 rows=137 width=105) (actual rows= loops=)

  • Merge Cond: (rn.id = les.entity_id)
13. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1,561.54..1,570.54 rows=137 width=73) (actual rows= loops=)

  • Merge Cond: (rn.id = lef.entity_id)
14. 0.000 0.000 ↓ 0.0

Sort (cost=181.47..181.81 rows=137 width=41) (actual rows= loops=)

  • Sort Key: rn.id
15. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=74.47..176.60 rows=137 width=41) (actual rows= loops=)

  • Hash Cond: (rn.work_flow_id = wf.id)
16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=20.15..120.56 rows=137 width=41) (actual rows= loops=)

  • Hash Cond: (rn.time_zone_id = tz.id)
17. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on relation rn (cost=18.23..116.93 rows=137 width=41) (actual rows= loops=)

  • Recheck Cond: ((client_id = 1020) AND (NOT deleted))
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_relation_alias_client_deleted (cost=0.00..18.20 rows=137 width=0) (actual rows= loops=)

  • Index Cond: (client_id = 1020)
19. 0.000 0.000 ↓ 0.0

Hash (cost=1.41..1.41 rows=41 width=4) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on time_zone tz (cost=0.00..1.41 rows=41 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=53.64..53.64 rows=54 width=4) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using idx_work_flow_entyid_clid_relid on work_flow wf (cost=0.29..53.64 rows=54 width=4) (actual rows= loops=)

  • Index Cond: ((entity_type_id = 1) AND (client_id = 1020))
23. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,380.08..1,385.23 rows=229 width=36) (actual rows= loops=)

  • Group Key: lef.entity_id
24. 0.000 0.000 ↓ 0.0

Sort (cost=1,380.08..1,380.65 rows=229 width=20) (actual rows= loops=)

  • Sort Key: lef.entity_id
25. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.97..1,371.10 rows=229 width=20) (actual rows= loops=)

  • Hash Cond: (lef.function_id = ct.id)
26. 0.000 0.000 ↓ 0.0

Index Scan using idx_link_entity_function_4 on link_entity_function lef (cost=0.42..1,342.11 rows=1,623 width=8) (actual rows= loops=)

  • Index Cond: (entity_type_id = 1)
27. 0.000 0.000 ↓ 0.0

Hash (cost=7.99..7.99 rows=45 width=20) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on contract_type ct (cost=0.00..7.99 rows=45 width=20) (actual rows= loops=)

  • Filter: (client_id = 1020)
29. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4,114.41..4,128.90 rows=644 width=36) (actual rows= loops=)

  • Group Key: les.entity_id
30. 0.000 0.000 ↓ 0.0

Sort (cost=4,114.41..4,116.02 rows=644 width=26) (actual rows= loops=)

  • Sort Key: les.entity_id
31. 0.000 0.000 ↓ 0.0

Hash Join (cost=15.98..4,084.37 rows=644 width=26) (actual rows= loops=)

  • Hash Cond: (les.service_id = cst.id)
32. 0.000 0.000 ↓ 0.0

Index Scan using idx_link_entity_service_5 on link_entity_service les (cost=0.42..4,006.49 rows=4,939 width=8) (actual rows= loops=)

  • Index Cond: (entity_type_id = 1)
33. 0.000 0.000 ↓ 0.0

Hash (cost=12.63..12.63 rows=234 width=26) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Index Scan using idx_contract_sub_type_client_id on contract_sub_type cst (cost=0.28..12.63 rows=234 width=26) (actual rows= loops=)

  • Index Cond: (client_id = 1020)
35. 0.000 0.000 ↓ 0.0

Materialize (cost=2.61..71.16 rows=17 width=4) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on role_group rg (cost=2.61..71.07 rows=17 width=4) (actual rows= loops=)

  • Recheck Cond: (entity_type_id = 1)
  • Filter: (client_id = 1020)
37. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on role_group_entity_type_id_idx (cost=0.00..2.61 rows=164 width=0) (actual rows= loops=)

  • Index Cond: (entity_type_id = 1)
38. 0.000 0.000 ↓ 0.0

Index Scan using idx_domain_user_entity_id_role_group_id on domain_user du (cost=0.43..73,587.50 rows=2,365,455 width=12) (actual rows= loops=)