explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QYtw

Settings
# exclusive inclusive rows x rows loops node
1. 0.052 496.713 ↑ 249.3 13 1

Sort (cost=80,919.59..80,927.69 rows=3,241 width=96) (actual time=496.711..496.713 rows=13 loops=1)

  • Sort Key: s.owner_id, s.id, (lib.__dictionary_getname('share_type'::character varying, (s.sharetype_id)::integer))
  • Sort Method: quicksort Memory: 26kB
2. 0.015 496.661 ↑ 249.3 13 1

Append (cost=60.61..80,730.61 rows=3,241 width=96) (actual time=3.653..496.661 rows=13 loops=1)

3. 8.303 119.993 ↑ 215.5 13 1

Nested Loop Anti Join (cost=60.61..49,483.64 rows=2,801 width=96) (actual time=3.652..119.993 rows=13 loops=1)

4. 3.857 53.470 ↓ 1.0 2,911 1

Nested Loop (cost=60.18..26,111.26 rows=2,819 width=38) (actual time=0.591..53.470 rows=2,911 loops=1)

5. 2.142 2.605 ↑ 1.0 2,938 1

Bitmap Heap Scan on shares s (cost=59.74..1,263.84 rows=3,010 width=34) (actual time=0.554..2.605 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
6. 0.463 0.463 ↑ 1.0 2,938 1

Bitmap Index Scan on ix_shares_parent_shareuser (cost=0.00..58.99 rows=3,010 width=0) (actual time=0.463..0.463 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
7. 47.008 47.008 ↑ 1.0 1 2,938

Index Scan using pk_objects on objects o (cost=0.43..8.24 rows=1 width=12) (actual time=0.015..0.016 rows=1 loops=2,938)

  • Index Cond: (id = s.object_id)
  • Filter: (type_id <> ALL ('{3,5,16}'::integer[]))
  • Rows Removed by Filter: 0
8. 58.220 58.220 ↑ 1.0 1 2,911

Index Scan using ux_objectpermissions on objectpermissions op (cost=0.43..7.78 rows=1 width=24) (actual time=0.020..0.020 rows=1 loops=2,911)

  • Index Cond: ((object_id = s.object_id) AND (shareuser_id = s.parent_shareuser_id))
  • Filter: ((user_id = s.owner_id) AND lib.__permissionbitmask_has_permission(permissionbitmask, 'SHARE'::character varying))
9. 0.063 185.975 ↓ 0.0 0 1

Nested Loop (cost=2,136.02..11,246.46 rows=193 width=96) (actual time=185.975..185.975 rows=0 loops=1)

  • Join Filter: (NOT (ARRAY[(lower((par_pfi.pinnedobjectid)::text))::character varying] <@ pfi.parents))
  • Rows Removed by Join Filter: 3
10. 0.024 185.877 ↑ 27.7 7 1

Nested Loop (cost=2,135.59..10,662.27 rows=194 width=440) (actual time=180.209..185.877 rows=7 loops=1)

11. 40.273 185.797 ↑ 27.7 7 1

Merge Join (cost=2,135.17..10,568.54 rows=194 width=440) (actual time=180.185..185.797 rows=7 loops=1)

  • Merge Cond: (s_1.parent_shareuser_id = par_su.id)
12. 0.044 13.696 ↑ 27.7 7 1

Nested Loop (cost=1.28..26,640.80 rows=194 width=432) (actual time=13.288..13.696 rows=7 loops=1)

  • Join Filter: (s_1.object_id = o_1.id)
13. 2.797 13.582 ↑ 430.0 7 1

Nested Loop (cost=0.84..23,356.87 rows=3,010 width=440) (actual time=13.250..13.582 rows=7 loops=1)

14. 1.971 1.971 ↑ 1.0 2,938 1

Index Scan using ix_shares_parent_shareuser on shares s_1 (cost=0.42..2,738.85 rows=3,010 width=34) (actual time=0.019..1.971 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
15. 8.814 8.814 ↓ 0.0 0 2,938

Index Scan using pk_pinnedfiles on pinnedfiles pfi (cost=0.42..6.84 rows=1 width=406) (actual time=0.003..0.003 rows=0 loops=2,938)

  • Index Cond: (id = s_1.object_id)
16. 0.070 0.070 ↑ 1.0 1 7

Index Only Scan using pk_objects on objects o_1 (cost=0.43..1.08 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=7)

  • Index Cond: (id = pfi.id)
  • Heap Fetches: 7
17. 131.828 131.828 ↑ 1.0 159,237 1

Index Scan using pk_shareusers on shareusers par_su (cost=0.42..9,482.51 rows=159,238 width=16) (actual time=0.043..131.828 rows=159,237 loops=1)

18. 0.056 0.056 ↑ 1.0 1 7

Index Scan using pk_shares on shares par_s (cost=0.42..0.47 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=7)

  • Index Cond: (id = par_su.share_id)
19. 0.035 0.035 ↓ 0.0 0 7

Index Scan using pk_pinnedfiles on pinnedfiles par_pfi (cost=0.42..2.75 rows=1 width=112) (actual time=0.005..0.005 rows=0 loops=7)

  • Index Cond: (id = par_s.object_id)
20. 0.079 164.971 ↓ 0.0 0 1

Nested Loop (cost=2,135.88..10,742.45 rows=36 width=96) (actual time=164.971..164.971 rows=0 loops=1)

  • Join Filter: (NOT (ARRAY[(lower((par_pf.pinnedobjectid)::text))::character varying] <@ pfi_1.parents))
  • Rows Removed by Join Filter: 4
21. 0.021 164.808 ↑ 27.7 7 1

Nested Loop (cost=2,135.59..10,662.27 rows=194 width=440) (actual time=159.716..164.808 rows=7 loops=1)

22. 36.905 164.738 ↑ 27.7 7 1

Merge Join (cost=2,135.17..10,568.54 rows=194 width=440) (actual time=159.693..164.738 rows=7 loops=1)

  • Merge Cond: (s_2.parent_shareuser_id = par_su_1.id)
23. 0.036 12.237 ↑ 27.7 7 1

Nested Loop (cost=1.28..26,640.80 rows=194 width=432) (actual time=11.947..12.237 rows=7 loops=1)

  • Join Filter: (s_2.object_id = o_2.id)
24. 1.460 12.138 ↑ 430.0 7 1

Nested Loop (cost=0.84..23,356.87 rows=3,010 width=440) (actual time=11.906..12.138 rows=7 loops=1)

25. 1.864 1.864 ↑ 1.0 2,938 1

Index Scan using ix_shares_parent_shareuser on shares s_2 (cost=0.42..2,738.85 rows=3,010 width=34) (actual time=0.017..1.864 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
26. 8.814 8.814 ↓ 0.0 0 2,938

Index Scan using pk_pinnedfiles on pinnedfiles pfi_1 (cost=0.42..6.84 rows=1 width=406) (actual time=0.003..0.003 rows=0 loops=2,938)

  • Index Cond: (id = s_2.object_id)
27. 0.063 0.063 ↑ 1.0 1 7

Index Only Scan using pk_objects on objects o_2 (cost=0.43..1.08 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=7)

  • Index Cond: (id = pfi_1.id)
  • Heap Fetches: 7
28. 115.596 115.596 ↑ 1.0 159,237 1

Index Scan using pk_shareusers on shareusers par_su_1 (cost=0.42..9,482.51 rows=159,238 width=16) (actual time=0.015..115.596 rows=159,237 loops=1)

29. 0.049 0.049 ↑ 1.0 1 7

Index Scan using pk_shares on shares par_s_1 (cost=0.42..0.47 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=7)

  • Index Cond: (id = par_su_1.share_id)
30. 0.084 0.084 ↑ 1.0 1 7

Index Scan using pk_pinnedfolders on pinnedfolders par_pf (cost=0.29..0.35 rows=1 width=81) (actual time=0.011..0.012 rows=1 loops=7)

  • Index Cond: (id = par_s_1.object_id)
31. 0.001 22.183 ↓ 0.0 0 1

Nested Loop (cost=1,303.03..6,226.75 rows=1 width=96) (actual time=22.183..22.183 rows=0 loops=1)

  • Join Filter: (s_3.object_id = o_3.id)
32. 0.129 22.182 ↓ 0.0 0 1

Nested Loop (cost=1,302.59..5,487.42 rows=103 width=42) (actual time=22.182..22.182 rows=0 loops=1)

  • Join Filter: (NOT (ARRAY[(lower((par_pf_1.pinnedobjectid)::text))::character varying] <@ pf.parents))
  • Rows Removed by Join Filter: 16
33. 0.036 21.939 ↑ 29.4 19 1

Nested Loop (cost=1,302.31..5,282.56 rows=559 width=320) (actual time=17.028..21.939 rows=19 loops=1)

34. 0.052 21.751 ↑ 29.4 19 1

Nested Loop (cost=1,301.89..5,012.48 rows=559 width=320) (actual time=16.996..21.751 rows=19 loops=1)

35. 5.711 21.566 ↑ 29.4 19 1

Hash Join (cost=1,301.47..3,183.75 rows=559 width=312) (actual time=16.966..21.566 rows=19 loops=1)

  • Hash Cond: (pf.id = s_3.object_id)
36. 12.395 12.395 ↑ 1.0 21,853 1

Seq Scan on pinnedfolders pf (cost=0.00..1,603.53 rows=21,853 width=278) (actual time=0.014..12.395 rows=21,853 loops=1)

37. 1.176 3.460 ↑ 1.0 2,938 1

Hash (cost=1,263.84..1,263.84 rows=3,010 width=34) (actual time=3.460..3.460 rows=2,938 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 239kB
38. 1.821 2.284 ↑ 1.0 2,938 1

Bitmap Heap Scan on shares s_3 (cost=59.74..1,263.84 rows=3,010 width=34) (actual time=0.555..2.284 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
39. 0.463 0.463 ↑ 1.0 2,938 1

Bitmap Index Scan on ix_shares_parent_shareuser (cost=0.00..58.99 rows=3,010 width=0) (actual time=0.463..0.463 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
40. 0.133 0.133 ↑ 1.0 1 19

Index Scan using pk_shareusers on shareusers par_su_2 (cost=0.42..3.26 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=19)

  • Index Cond: (id = s_3.parent_shareuser_id)
41. 0.152 0.152 ↑ 1.0 1 19

Index Scan using pk_shares on shares par_s_2 (cost=0.42..0.47 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=19)

  • Index Cond: (id = par_su_2.share_id)
42. 0.114 0.114 ↑ 1.0 1 19

Index Scan using pk_pinnedfolders on pinnedfolders par_pf_1 (cost=0.29..0.35 rows=1 width=81) (actual time=0.005..0.006 rows=1 loops=19)

  • Index Cond: (id = par_s_2.object_id)
43. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pk_objects on objects o_3 (cost=0.43..7.16 rows=1 width=8) (never executed)

  • Index Cond: (id = pf.id)
  • Heap Fetches: 0
44. 0.002 3.524 ↓ 0.0 0 1

Unique (cost=2,995.75..2,998.90 rows=210 width=96) (actual time=3.524..3.524 rows=0 loops=1)

45. 0.030 3.522 ↓ 0.0 0 1

Sort (cost=2,995.75..2,996.27 rows=210 width=96) (actual time=3.522..3.522 rows=0 loops=1)

  • Sort Key: s_4.owner_id, s_4.id, (lib.__dictionary_getname('share_type'::character varying, (s_4.sharetype_id)::integer)), s_4.object_id, s_4.parent_shareuser_id
  • Sort Method: quicksort Memory: 25kB
46. 0.032 3.492 ↓ 0.0 0 1

Nested Loop Anti Join (cost=67.05..2,987.65 rows=210 width=96) (actual time=3.492..3.492 rows=0 loops=1)

47. 0.027 2.862 ↑ 8.1 26 1

Nested Loop (cost=66.62..1,290.57 rows=211 width=42) (actual time=1.031..2.862 rows=26 loops=1)

  • Join Filter: (sl.id = sli.sharedlist_id)
48. 0.724 2.782 ↑ 5.0 1 1

Hash Join (cost=66.33..1,281.77 rows=5 width=42) (actual time=0.987..2.782 rows=1 loops=1)

  • Hash Cond: (s_4.object_id = sl.id)
49. 1.394 1.893 ↑ 1.0 2,938 1

Bitmap Heap Scan on shares s_4 (cost=59.74..1,263.84 rows=3,010 width=34) (actual time=0.597..1.893 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
50. 0.499 0.499 ↑ 1.0 2,938 1

Bitmap Index Scan on ix_shares_parent_shareuser (cost=0.00..58.99 rows=3,010 width=0) (actual time=0.499..0.499 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
51. 0.086 0.165 ↑ 1.0 204 1

Hash (cost=4.04..4.04 rows=204 width=8) (actual time=0.165..0.165 rows=204 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
52. 0.079 0.079 ↑ 1.0 204 1

Seq Scan on sharedlists sl (cost=0.00..4.04 rows=204 width=8) (actual time=0.015..0.079 rows=204 loops=1)

53. 0.053 0.053 ↑ 1.7 26 1

Index Only Scan using ux_sharedlistitems_sharedlist_item on sharedlistitems sli (cost=0.29..1.21 rows=44 width=16) (actual time=0.030..0.053 rows=26 loops=1)

  • Index Cond: (sharedlist_id = s_4.object_id)
  • Heap Fetches: 26
54. 0.598 0.598 ↑ 1.0 1 26

Index Scan using ux_objectpermissions on objectpermissions op_1 (cost=0.43..7.78 rows=1 width=24) (actual time=0.023..0.023 rows=1 loops=26)

  • Index Cond: ((object_id = sli.item_id) AND (shareuser_id = s_4.parent_shareuser_id))
  • Filter: ((user_id = s_4.owner_id) AND lib.__permissionbitmask_has_permission(permissionbitmask, 'SHARE'::character varying))