explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PAmu

Settings
# exclusive inclusive rows x rows loops node
1. 0.064 2.346 ↑ 1.0 1 1

Subquery Scan on fg (cost=0.29..1,008.13 rows=1 width=128) (actual time=2.298..2.346 rows=1 loops=1)

  • Filter: ((SubPlan 10) IS NOT NULL)
2. 0.000 0.100 ↑ 1.0 1 1

Unique (cost=0.29..8.30 rows=1 width=16) (actual time=0.069..0.100 rows=1 loops=1)

3. 0.207 0.207 ↑ 1.0 1 1

Index Scan using work_match_hash_key_idx on work w (cost=0.29..8.30 rows=1 width=16) (actual time=0.052..0.207 rows=1 loops=1)

  • Index Cond: (match_hash_key = '62da0a36-7a25-474a-9a0a-367a25274a98'::uuid)
  • Filter: (deleted_at IS NULL)
4.          

SubPlan (forSubquery Scan)

5. 0.269 0.931 ↑ 1.0 1 1

Aggregate (cost=82.36..82.38 rows=1 width=32) (actual time=0.917..0.931 rows=1 loops=1)

6. 0.033 0.662 ↑ 1.0 1 1

Limit (cost=0.29..82.34 rows=1 width=685) (actual time=0.629..0.662 rows=1 loops=1)

7. 0.122 0.629 ↑ 1.0 1 1

Index Scan using work_match_hash_key_idx on work w_1 (cost=0.29..82.34 rows=1 width=685) (actual time=0.611..0.629 rows=1 loops=1)

  • Index Cond: (match_hash_key = fg.id)
  • Filter: (deleted_at IS NULL)
8.          

SubPlan (forIndex Scan)

9. 0.004 0.078 ↑ 1.0 1 1

Aggregate (cost=28.63..28.64 rows=1 width=32) (actual time=0.064..0.078 rows=1 loops=1)

10. 0.006 0.074 ↓ 0.0 0 1

Nested Loop (cost=4.72..28.61 rows=2 width=174) (actual time=0.049..0.074 rows=0 loops=1)

11. 0.045 0.068 ↓ 0.0 0 1

Bitmap Heap Scan on work_agent wa (cost=4.43..12.00 rows=2 width=28) (actual time=0.031..0.068 rows=0 loops=1)

  • Recheck Cond: (work_id = w_1.id)
  • Filter: (deleted_at IS NULL)
12. 0.023 0.023 ↓ 0.0 0 1

Bitmap Index Scan on work_agent_link_pkey_new (cost=0.00..4.43 rows=2 width=0) (actual time=0.015..0.023 rows=0 loops=1)

  • Index Cond: (work_id = w_1.id)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using agent_id_pkey on agent a (cost=0.29..8.30 rows=1 width=162) (never executed)

  • Index Cond: (id = wa.agent_id)
  • Filter: (deleted_at IS NULL)
14. 0.063 0.121 ↑ 1.0 1 1

Aggregate (cost=28.63..28.64 rows=1 width=32) (actual time=0.106..0.121 rows=1 loops=1)

15. 0.017 0.058 ↓ 0.0 0 1

Nested Loop (cost=4.72..28.61 rows=2 width=196) (actual time=0.051..0.058 rows=0 loops=1)

16. 0.020 0.041 ↓ 0.0 0 1

Bitmap Heap Scan on work_concept wc (cost=4.43..12.01 rows=2 width=23) (actual time=0.034..0.041 rows=0 loops=1)

  • Recheck Cond: (work_id = w_1.id)
  • Filter: (deleted_at IS NULL)
17. 0.021 0.021 ↓ 0.0 0 1

Bitmap Index Scan on work_concept_link_pkey_new (cost=0.00..4.43 rows=2 width=0) (actual time=0.014..0.021 rows=0 loops=1)

  • Index Cond: (work_id = w_1.id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using concept_id_pkey on concept c (cost=0.29..8.30 rows=1 width=189) (never executed)

  • Index Cond: (id = wc.concept_id)
  • Filter: (deleted_at IS NULL)
19. 0.211 0.308 ↑ 1.0 1 1

Aggregate (cost=16.74..16.75 rows=1 width=32) (actual time=0.293..0.308 rows=1 loops=1)

20. 0.032 0.097 ↑ 1.0 1 1

Nested Loop (cost=0.70..16.74 rows=1 width=1,523) (actual time=0.068..0.097 rows=1 loops=1)

21. 0.038 0.038 ↑ 1.0 1 1

Index Only Scan using instance_work_work_id_instance_id_idx on instance_work iw (cost=0.41..8.43 rows=1 width=16) (actual time=0.023..0.038 rows=1 loops=1)

  • Index Cond: (work_id = w_1.id)
  • Filter: (deleted_at IS NULL)
  • Heap Fetches: 1
22. 0.027 0.027 ↑ 1.0 1 1

Index Scan using instance_id_pkey on instance i (cost=0.29..8.30 rows=1 width=1,523) (actual time=0.020..0.027 rows=1 loops=1)

  • Index Cond: (id = iw.instance_id)
  • Filter: (deleted_at IS NULL)
23. 0.016 0.265 ↓ 0.0 0 1

GroupAggregate (cost=1.11..835.06 rows=1 width=48) (actual time=0.258..0.265 rows=0 loops=1)

  • Group Key: w_2.match_hash_key
24. 0.024 0.249 ↓ 0.0 0 1

Nested Loop (cost=1.11..17.27 rows=1 width=61) (actual time=0.242..0.249 rows=0 loops=1)

25. 0.042 0.201 ↑ 1.0 1 1

Nested Loop (cost=0.70..16.75 rows=1 width=32) (actual time=0.057..0.201 rows=1 loops=1)

26. 0.032 0.032 ↑ 1.0 1 1

Index Scan using work_match_hash_key_idx on work w_2 (cost=0.29..8.30 rows=1 width=32) (actual time=0.017..0.032 rows=1 loops=1)

  • Index Cond: (match_hash_key = fg.id)
  • Filter: (deleted_at IS NULL)
27. 0.127 0.127 ↑ 1.0 1 1

Index Only Scan using instance_work_work_id_instance_id_idx on instance_work iw_1 (cost=0.41..8.43 rows=1 width=32) (actual time=0.015..0.127 rows=1 loops=1)

  • Index Cond: (work_id = w_2.id)
  • Filter: (deleted_at IS NULL)
  • Heap Fetches: 1
28. 0.024 0.024 ↓ 0.0 0 1

Index Scan using instance_customer_link_pkey_new on instance_customer ic (cost=0.41..0.51 rows=1 width=61) (actual time=0.017..0.024 rows=0 loops=1)

  • Index Cond: (instance_id = iw_1.instance_id)
  • Filter: (deleted_at IS NULL)
29.          

SubPlan (forGroupAggregate)

30. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=817.76..817.77 rows=1 width=1) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..817.26 rows=100 width=1) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Function Scan on jsonb_object_keys ice (cost=0.01..1.00 rows=100 width=32) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Index Scan using entitlement_id_pkey on entitlement e (cost=0.42..8.16 rows=1 width=17) (never executed)

  • Index Cond: (id = (ice.ice)::uuid)
  • Filter: (deleted_at IS NULL)
34. 0.284 0.986 ↑ 1.0 1 1

Aggregate (cost=82.36..82.38 rows=1 width=32) (actual time=0.971..0.986 rows=1 loops=1)

35. 0.033 0.702 ↑ 1.0 1 1

Limit (cost=0.29..82.34 rows=1 width=685) (actual time=0.670..0.702 rows=1 loops=1)

36. 0.185 0.669 ↑ 1.0 1 1

Index Scan using work_match_hash_key_idx on work w_3 (cost=0.29..82.34 rows=1 width=685) (actual time=0.653..0.669 rows=1 loops=1)

  • Index Cond: (match_hash_key = fg.id)
  • Filter: (deleted_at IS NULL)
37.          

SubPlan (forIndex Scan)

38. 0.024 0.077 ↑ 1.0 1 1

Aggregate (cost=28.63..28.64 rows=1 width=32) (actual time=0.063..0.077 rows=1 loops=1)

39. 0.016 0.053 ↓ 0.0 0 1

Nested Loop (cost=4.72..28.61 rows=2 width=174) (actual time=0.045..0.053 rows=0 loops=1)

40. 0.016 0.037 ↓ 0.0 0 1

Bitmap Heap Scan on work_agent wa_1 (cost=4.43..12.00 rows=2 width=28) (actual time=0.030..0.037 rows=0 loops=1)

  • Recheck Cond: (work_id = w_3.id)
  • Filter: (deleted_at IS NULL)
41. 0.021 0.021 ↓ 0.0 0 1

Bitmap Index Scan on work_agent_link_pkey_new (cost=0.00..4.43 rows=2 width=0) (actual time=0.014..0.021 rows=0 loops=1)

  • Index Cond: (work_id = w_3.id)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using agent_id_pkey on agent a_1 (cost=0.29..8.30 rows=1 width=162) (never executed)

  • Index Cond: (id = wa_1.agent_id)
  • Filter: (deleted_at IS NULL)
43. 0.025 0.080 ↑ 1.0 1 1

Aggregate (cost=28.63..28.64 rows=1 width=32) (actual time=0.064..0.080 rows=1 loops=1)

44. 0.017 0.055 ↓ 0.0 0 1

Nested Loop (cost=4.72..28.61 rows=2 width=196) (actual time=0.048..0.055 rows=0 loops=1)

45. 0.016 0.038 ↓ 0.0 0 1

Bitmap Heap Scan on work_concept wc_1 (cost=4.43..12.01 rows=2 width=23) (actual time=0.030..0.038 rows=0 loops=1)

  • Recheck Cond: (work_id = w_3.id)
  • Filter: (deleted_at IS NULL)
46. 0.022 0.022 ↓ 0.0 0 1

Bitmap Index Scan on work_concept_link_pkey_new (cost=0.00..4.43 rows=2 width=0) (actual time=0.014..0.022 rows=0 loops=1)

  • Index Cond: (work_id = w_3.id)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using concept_id_pkey on concept c_1 (cost=0.29..8.30 rows=1 width=189) (never executed)

  • Index Cond: (id = wc_1.concept_id)
  • Filter: (deleted_at IS NULL)
48. 0.202 0.327 ↑ 1.0 1 1

Aggregate (cost=16.74..16.75 rows=1 width=32) (actual time=0.310..0.327 rows=1 loops=1)

49. 0.048 0.125 ↑ 1.0 1 1

Nested Loop (cost=0.70..16.74 rows=1 width=1,523) (actual time=0.078..0.125 rows=1 loops=1)

50. 0.047 0.047 ↑ 1.0 1 1

Index Only Scan using instance_work_work_id_instance_id_idx on instance_work iw_2 (cost=0.41..8.43 rows=1 width=16) (actual time=0.031..0.047 rows=1 loops=1)

  • Index Cond: (work_id = w_3.id)
  • Filter: (deleted_at IS NULL)
  • Heap Fetches: 1
51. 0.030 0.030 ↑ 1.0 1 1

Index Scan using instance_id_pkey on instance i_1 (cost=0.29..8.30 rows=1 width=1,523) (actual time=0.023..0.030 rows=1 loops=1)

  • Index Cond: (id = iw_2.instance_id)
  • Filter: (deleted_at IS NULL)
Planning time : 3.485 ms
Execution time : 3.862 ms