explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ykoz

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.186 821.728 ↑ 1.0 50 1

Limit (cost=26,886.92..28,630.80 rows=50 width=52) (actual time=820.971..821.728 rows=50 loops=1)

2. 0.176 821.542 ↑ 278.7 50 1

Result (cost=26,886.92..512,939.35 rows=13,936 width=52) (actual time=820.966..821.542 rows=50 loops=1)

3. 0.461 820.966 ↑ 278.7 50 1

Sort (cost=26,886.92..26,921.76 rows=13,936 width=48) (actual time=820.917..820.966 rows=50 loops=1)

  • Sort Key: task1.started DESC
  • Sort Method: top-N heapsort Memory: 28kB
4. 38.318 820.505 ↑ 69.3 201 1

Bitmap Heap Scan on task task1 (cost=21,714.88..26,423.98 rows=13,936 width=48) (actual time=786.529..820.505 rows=201 loops=1)

  • Recheck Cond: (status = ANY ('{1,2}'::integer[]))
  • Filter: ((NOT (hashed SubPlan 10)) AND ((performer = 88,195) OR (hashed SubPlan 5)))
  • Rows Removed by Filter: 55,563
  • Heap Blocks: exact=3,597
5. 12.009 12.009 ↓ 1.0 55,764 1

Bitmap Index Scan on idx_task_status_id_started (cost=0.00..959.50 rows=55,555 width=0) (actual time=12.007..12.009 rows=55,764 loops=1)

  • Index Cond: (status = ANY ('{1,2}'::integer[]))
6.          

SubPlan (for Bitmap Heap Scan)

7. 5.609 770.133 ↓ 61.9 1,115 1

Nested Loop (cost=16.25..20,749.15 rows=18 width=8) (actual time=1.168..770.133 rows=1,115 loops=1)

8. 7.191 757.834 ↓ 557.5 1,115 1

Nested Loop (cost=15.82..20,748.26 rows=2 width=32) (actual time=1.110..757.834 rows=1,115 loops=1)

9. 9.860 732.625 ↓ 111.2 2,002 1

Nested Loop (cost=15.40..20,740.27 rows=18 width=24) (actual time=0.712..732.625 rows=2,002 loops=1)

10. 174.106 225.707 ↓ 64.0 2,239 1

Nested Loop (cost=14.96..19,975.19 rows=35 width=16) (actual time=0.467..225.707 rows=2,239 loops=1)

11. 9.651 38.113 ↓ 62.4 1,124 1

Index Scan using fk_link_linktype1_idx on link link3 (cost=0.42..19,676.52 rows=18 width=16) (actual time=0.132..38.113 rows=1,124 loops=1)

  • Index Cond: (linktype = 3,451,011)
  • Filter: (id = (SubPlan 7))
  • Rows Removed by Filter: 374
12.          

SubPlan (for Index Scan)

13. 11.984 28.462 ↑ 1.0 1 1,498

Aggregate (cost=4.45..4.46 rows=1 width=8) (actual time=0.017..0.019 rows=1 loops=1,498)

14. 16.478 16.478 ↓ 2.0 2 1,498

Index Scan using idx_link_obj1_linktype on link link4 (cost=0.42..4.44 rows=1 width=8) (actual time=0.008..0.011 rows=2 loops=1,498)

  • Index Cond: ((obj1 = link3.obj1) AND (linktype = 3,451,011))
15. 0.000 13.488 ↑ 1.0 2 1,124

Index Only Scan using baseobject_attachedto_task_pkey on baseobject_attachedto_task baseobject_attachedto_task1 (cost=14.54..16.57 rows=2 width=16) (actual time=0.009..0.012 rows=2 loops=1,124)

  • Index Cond: (task = (SubPlan 6))
  • Heap Fetches: 0
16.          

SubPlan (for Index Only Scan)

17. 19.108 161.856 ↑ 1.0 1 1,124

Aggregate (cost=14.11..14.12 rows=1 width=8) (actual time=0.142..0.144 rows=1 loops=1,124)

18. 42.496 142.748 ↓ 1.1 10 1,124

Nested Loop (cost=1.27..14.08 rows=9 width=8) (actual time=0.028..0.127 rows=10 loops=1,124)

  • Join Filter: (task2.id = baseobject_attachedto_task2.task)
19. 26.832 66.316 ↑ 1.0 5 1,124

Nested Loop Semi Join (cost=0.84..11.62 rows=5 width=16) (actual time=0.020..0.059 rows=5 loops=1,124)

20. 16.860 16.860 ↑ 1.0 5 1,124

Index Only Scan using idx_task_workflow_id on task task2 (cost=0.42..2.51 rows=5 width=8) (actual time=0.009..0.015 rows=5 loops=1,124)

  • Index Cond: (workflow = link3.obj2)
  • Heap Fetches: 0
21. 22.624 22.624 ↑ 2.0 1 5,656

Index Only Scan using fk_task_has_baseobject_task1_i on baseobject_attachedto_task baseobject_attachedto_task2_1 (cost=0.42..2.46 rows=2 width=8) (actual time=0.004..0.004 rows=1 loops=5,656)

  • Index Cond: (task = task2.id)
  • Heap Fetches: 0
22. 33.936 33.936 ↑ 1.0 2 5,656

Index Only Scan using fk_task_has_baseobject_task1_i on baseobject_attachedto_task baseobject_attachedto_task2 (cost=0.42..0.47 rows=2 width=8) (actual time=0.003..0.006 rows=2 loops=5,656)

  • Index Cond: (task = baseobject_attachedto_task2_1.task)
  • Heap Fetches: 0
23. 27.498 497.058 ↑ 1.0 1 2,239

Index Scan using securedobject_pkey on securedobject securedobject2 (cost=0.43..21.86 rows=1 width=8) (actual time=0.222..0.222 rows=1 loops=2,239)

  • Index Cond: (id = baseobject_attachedto_task1.baseobject)
  • Filter: ((owner = 88,195) OR (alternatives: SubPlan 8 or hashed SubPlan 9))
  • Rows Removed by Filter: 0
24.          

SubPlan (for Index Scan)

25. 82.624 469.560 ↑ 7.0 1 2,236

Nested Loop (cost=1.13..141.62 rows=7 width=0) (actual time=0.210..0.210 rows=1 loops=2,236)

26. 116.191 279.500 ↑ 4.2 12 2,236

Nested Loop (cost=0.71..110.66 rows=51 width=8) (actual time=0.017..0.125 rows=12 loops=2,236)

27. 82.732 82.732 ↑ 4.2 12 2,236

Index Scan using fk_permission_in_acl_acl1_idx on permission_in_acl a_2 (cost=0.43..33.49 rows=51 width=8) (actual time=0.008..0.037 rows=12 loops=2,236)

  • Index Cond: (securedobject2.acl = acl)
28. 80.577 80.577 ↑ 1.0 1 26,859

Index Scan using permission_pkey on permission p_2 (cost=0.28..1.51 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=26,859)

  • Index Cond: (id = a_2.permission)
29. 107.436 107.436 ↓ 0.0 0 26,859

Index Only Scan using index_ancdesc on grouprelations grl_2 (cost=0.42..0.60 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=26,859)

  • Index Cond: ((ancestor = p_2.identity) AND (descendant = 88,195))
  • Heap Fetches: 0
30. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=94.75..94,157.40 rows=1,095,850 width=8) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=94.32..488.75 rows=408 width=8) (never executed)

  • Hash Cond: (grl_3.ancestor = p_3.identity)
32. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on grouprelations grl_3 (cost=4.32..392.05 rows=262 width=8) (never executed)

  • Recheck Cond: (descendant = 88,195)
33. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_desc (cost=0.00..4.26 rows=262 width=0) (never executed)

  • Index Cond: (descendant = 88,195)
34. 0.000 0.000 ↓ 0.0 0

Hash (cost=51.11..51.11 rows=3,111 width=16) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Seq Scan on permission p_3 (cost=0.00..51.11 rows=3,111 width=16) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Only Scan using permission_in_acl_pkey on permission_in_acl a_3 (cost=0.43..153.78 rows=7,580 width=16) (never executed)

  • Index Cond: (permission = p_3.id)
  • Heap Fetches: 0
37. 18.018 18.018 ↑ 2.0 1 2,002

Index Only Scan using r389193_csordertask_pkey on r389193_csordertask r389193_csordertask1 (cost=0.43..0.46 rows=2 width=8) (actual time=0.009..0.009 rows=1 loops=2,002)

  • Index Cond: ((id = securedobject2.id) AND (pos = '0'::numeric))
  • Heap Fetches: 0
38. 6.690 6.690 ↑ 1.0 1 1,115

Index Only Scan using ntik_order_pkey on ntik_order ntik_order1 (cost=0.42..0.44 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1,115)

  • Index Cond: (id = securedobject2.id)
  • Heap Fetches: 0
39. 0.045 0.045 ↑ 1.0 21 1

Index Only Scan using identity_in_group_pkey on identity_in_group identity_in_group1 (cost=0.29..2.65 rows=21 width=8) (actual time=0.022..0.045 rows=21 loops=1)

  • Index Cond: (identity = 88,195)
  • Heap Fetches: 0
40.          

SubPlan (for Result)

41. 0.100 0.400 ↓ 0.0 0 50

Nested Loop (cost=5.60..34.86 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=50)

42.          

Initplan (for Nested Loop)

43. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=4.45..4.46 rows=1 width=8) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_link_obj1_linktype on link link2 (cost=0.42..4.44 rows=1 width=8) (never executed)

  • Index Cond: ((obj1 = task1.id) AND (linktype = 3,451,011))
45. 0.100 0.300 ↓ 0.0 0 50

Nested Loop (cost=0.86..30.10 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=50)

46. 0.200 0.200 ↓ 0.0 0 50

Index Scan using idx_link_obj1_linktype on link link1 (cost=0.42..4.45 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=50)

  • Index Cond: ((obj1 = task1.id) AND (linktype = 3,451,011))
  • Filter: (id = $2)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using securedobject_pkey on securedobject securedobject1 (cost=0.43..25.65 rows=1 width=8) (never executed)

  • Index Cond: (id = link1.obj2)
  • Filter: ((owner = 88,195) OR (alternatives: SubPlan 2 or hashed SubPlan 3))
48.          

SubPlan (for Index Scan)

49. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.13..141.62 rows=7 width=0) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.71..110.66 rows=51 width=8) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_permission_in_acl_acl1_idx on permission_in_acl a (cost=0.43..33.49 rows=51 width=8) (never executed)

  • Index Cond: (securedobject1.acl = acl)
52. 0.000 0.000 ↓ 0.0 0

Index Scan using permission_pkey on permission p (cost=0.28..1.51 rows=1 width=16) (never executed)

  • Index Cond: (id = a.permission)
53. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_ancdesc on grouprelations grl (cost=0.42..0.60 rows=1 width=8) (never executed)

  • Index Cond: ((ancestor = p.identity) AND (descendant = 88,195))
  • Heap Fetches: 0
54. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=94.75..94,157.40 rows=1,095,850 width=8) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=94.32..488.75 rows=408 width=8) (never executed)

  • Hash Cond: (grl_1.ancestor = p_1.identity)
56. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on grouprelations grl_1 (cost=4.32..392.05 rows=262 width=8) (never executed)

  • Recheck Cond: (descendant = 88,195)
57. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_desc (cost=0.00..4.26 rows=262 width=0) (never executed)

  • Index Cond: (descendant = 88,195)
58. 0.000 0.000 ↓ 0.0 0

Hash (cost=51.11..51.11 rows=3,111 width=16) (never executed)

59. 0.000 0.000 ↓ 0.0 0

Seq Scan on permission p_1 (cost=0.00..51.11 rows=3,111 width=16) (never executed)

60. 0.000 0.000 ↓ 0.0 0

Index Only Scan using permission_in_acl_pkey on permission_in_acl a_1 (cost=0.43..153.78 rows=7,580 width=16) (never executed)

  • Index Cond: (permission = p_1.id)
  • Heap Fetches: 0
61. 0.000 0.000 ↓ 0.0 0

Index Scan using workflow_pkey on workflow workflow1 (cost=0.29..0.31 rows=1 width=12) (never executed)

  • Index Cond: (id = securedobject1.id)
Planning time : 17.476 ms
Execution time : 823.060 ms