explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uZnB

Settings
# exclusive inclusive rows x rows loops node
1. 0.080 790.899 ↑ 356.6 16 1

Sort (cost=104,676.30..104,690.56 rows=5,705 width=96) (actual time=790.897..790.899 rows=16 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.019 790.819 ↑ 356.6 16 1

Append (cost=60.61..104,320.36 rows=5,705 width=96) (actual time=3.218..790.819 rows=16 loops=1)

3. 9.874 128.440 ↑ 215.5 13 1

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

4. 4.671 54.524 ↓ 1.0 2,911 1

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

5. 2.393 2.845 ↑ 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.540..2.845 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
6. 0.452 0.452 ↑ 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.452..0.452 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. 64.042 64.042 ↑ 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.022..0.022 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.018 185.413 ↓ 0.0 0 1

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

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

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

11. 39.714 185.245 ↑ 27.7 7 1

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

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

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

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

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

14. 1.940 1.940 ↑ 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.020..1.940 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.091 0.091 ↑ 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.012..0.013 rows=1 loops=7)

  • Index Cond: (id = pfi.id)
  • Heap Fetches: 7
17. 131.454 131.454 ↑ 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.029..131.454 rows=159,237 loops=1)

18. 0.063 0.063 ↑ 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.009 rows=1 loops=7)

  • Index Cond: (id = par_su.share_id)
19. 0.063 0.063 ↓ 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.009..0.009 rows=0 loops=7)

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

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

  • Join Filter: ((par_pf.id <> s_2.object_id) AND (NOT (ARRAY[(lower((par_pf.pinnedobjectid)::text))::character varying] <@ pfi_1.parents)))
  • Rows Removed by Join Filter: 4
21. 0.023 173.704 ↑ 27.7 7 1

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

22. 37.338 173.632 ↑ 27.7 7 1

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

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

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

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

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

25. 1.847 1.847 ↑ 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.016..1.847 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. 123.938 123.938 ↑ 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..123.938 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.105 0.105 ↑ 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.015..0.015 rows=1 loops=7)

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

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

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

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

  • Join Filter: ((par_pf_1.id <> s_3.object_id) AND (NOT (ARRAY[(lower((par_pf_1.pinnedobjectid)::text))::character varying] <@ pf.parents)))
  • Rows Removed by Join Filter: 16
33. 0.022 20.980 ↑ 29.4 19 1

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

34. 0.050 20.806 ↑ 29.4 19 1

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

35. 5.448 20.604 ↑ 29.4 19 1

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

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

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

37. 1.034 3.360 ↑ 1.0 2,938 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 239kB
38. 1.889 2.326 ↑ 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.547..2.326 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
39. 0.437 0.437 ↑ 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.437..0.437 rows=2,938 loops=1)

  • Index Cond: (parent_shareuser_id IS NOT NULL)
40. 0.152 0.152 ↑ 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.008..0.008 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.007..0.008 rows=1 loops=19)

  • Index Cond: (id = par_su_2.share_id)
42. 0.095 0.095 ↑ 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.004..0.005 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.432 ↓ 0.0 0 1

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

45. 0.018 3.430 ↓ 0.0 0 1

Sort (cost=2,995.75..2,996.27 rows=210 width=96) (actual time=3.430..3.430 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.048 3.412 ↓ 0.0 0 1

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

47. 0.022 2.714 ↑ 8.1 26 1

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

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

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

  • Hash Cond: (s_4.object_id = sl.id)
49. 1.403 1.853 ↑ 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.542..1.853 rows=2,938 loops=1)

  • Recheck Cond: (parent_shareuser_id IS NOT NULL)
  • Heap Blocks: exact=416
50. 0.450 0.450 ↑ 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.450..0.450 rows=2,938 loops=1)

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

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

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

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

53. 0.052 0.052 ↑ 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.029..0.052 rows=26 loops=1)

  • Index Cond: (sharedlist_id = s_4.object_id)
  • Heap Fetches: 26
54. 0.650 0.650 ↑ 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.025..0.025 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))
55. 16.102 278.484 ↑ 821.3 3 1

Nested Loop (cost=2,135.60..23,562.75 rows=2,464 width=96) (actual time=184.429..278.484 rows=3 loops=1)

  • Join Filter: (ROW(o_4.type_id, par_o.type_id) <> ALL (ARRAY[ROW(1, 1), ROW(4, 4), ROW(1, 4), ROW(3, 3), ROW(5, 5), ROW(3, 5)]))
  • Rows Removed by Join Filter: 2934
56. 4.127 247.697 ↓ 1.2 2,937 1

Nested Loop (cost=2,135.17..11,772.02 rows=2,540 width=46) (actual time=12.202..247.697 rows=2,937 loops=1)

57. 46.085 228.885 ↓ 1.2 2,937 1

Merge Join (cost=2,134.75..10,544.80 rows=2,540 width=46) (actual time=12.167..228.885 rows=2,937 loops=1)

  • Merge Cond: (s_5.parent_shareuser_id = par_su_3.id)
58. 4.989 48.304 ↓ 1.2 2,937 1

Nested Loop (cost=0.85..27,590.02 rows=2,540 width=38) (actual time=0.049..48.304 rows=2,937 loops=1)

59. 2.183 2.183 ↑ 1.0 2,938 1

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

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

Index Scan using pk_objects on objects o_4 (cost=0.43..8.25 rows=1 width=12) (actual time=0.014..0.014 rows=1 loops=2,938)

  • Index Cond: (id = s_5.object_id)
  • Filter: (type_id = ANY ('{1,4,3,5}'::integer[]))
  • Rows Removed by Filter: 0
61. 134.496 134.496 ↓ 1.0 161,979 1

Index Scan using pk_shareusers on shareusers par_su_3 (cost=0.42..9,482.51 rows=159,238 width=16) (actual time=0.016..134.496 rows=161,979 loops=1)

62. 14.685 14.685 ↑ 1.0 1 2,937

Index Scan using pk_shares on shares par_s_3 (cost=0.42..0.47 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=2,937)

  • Index Cond: (id = par_su_3.share_id)
63. 14.685 14.685 ↑ 1.0 1 2,937

Index Scan using pk_objects on objects par_o (cost=0.43..4.14 rows=1 width=12) (actual time=0.004..0.005 rows=1 loops=2,937)

  • Index Cond: (id = par_s_3.object_id)