explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3655

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1,423.012 ↓ 2.0 2 1

Unique (cost=83,124.11..83,124.13 rows=1 width=936) (actual time=1,423.011..1,423.012 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, document_file_version_user_actions.time_created, last_actors.display_name, deleters.display_name, drafters.display_name, (CASE WHEN (deleters.id IS NULL) THEN NULL::timestamp with time zone ELSE document_file_version_user_actions.time_created END), (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage)))
  • Buffers: shared hit=130,345, temp read=3,916 written=3,908
2. 0.034 1,423.011 ↓ 2.0 2 1

Sort (cost=83,124.11..83,124.11 rows=1 width=936) (actual time=1,423.011..1,423.011 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, document_file_version_user_actions.time_created, last_actors.display_name, deleters.display_name, drafters.display_name, (CASE WHEN (deleters.id IS NULL) THEN NULL::timestamp with time zone ELSE document_file_version_user_actions.time_created END), (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage)))
  • Sort Key: document_files.anchor DESC, document_files.name, document_file_versions.filename, document_files.time_deleted DESC, document_files.id, document_file_versions.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=130,345, temp read=3,916 written=3,908
3. 0.003 1,422.977 ↓ 2.0 2 1

Nested Loop Left Join (cost=77,495.42..83,124.10 rows=1 width=936) (actual time=1,422.972..1,422.977 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, document_file_version_user_actions.time_created, last_actors.display_name, deleters.display_name, drafters.display_name, CASE WHEN (deleters.id IS NULL) THEN NULL::timestamp with time zone ELSE document_file_version_user_actions.time_created END, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage)))
  • Inner Unique: true
  • Join Filter: ((document_file_versions.deleted IS TRUE) AND (document_file_version_user_actions.document_file_version_id = document_file_versions.id) AND (document_file_version_user_actions.action = 'delete'::text))
  • Buffers: shared hit=130,345, temp read=3,916 written=3,908
4. 0.005 1,422.966 ↓ 2.0 2 1

Nested Loop Left Join (cost=77,495.28..83,123.92 rows=1 width=932) (actual time=1,422.963..1,422.966 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, drafters.display_name, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.action, last_actors.display_name
  • Inner Unique: true
  • Buffers: shared hit=130,345, temp read=3,916 written=3,908
5. 33.818 1,422.949 ↓ 2.0 2 1

Hash Right Join (cost=77,495.14..83,123.76 rows=1 width=921) (actual time=1,422.946..1,422.949 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, drafters.display_name, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.action
  • Hash Cond: (document_files_1.id = document_files.id)
  • Join Filter: (document_files.anchor IS FALSE)
  • Buffers: shared hit=130,345, temp read=3,916 written=3,908
6. 46.488 1,388.610 ↑ 1.1 272,325 1

Unique (cost=77,443.93..78,944.89 rows=300,193 width=31) (actual time=1,266.600..1,388.610 rows=272,325 loops=1)

  • Output: document_files_1.id, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.action, document_file_version_user_actions.id
  • Buffers: shared hit=130,276, temp read=3,916 written=3,908
7. 322.522 1,342.122 ↑ 1.1 276,622 1

Sort (cost=77,443.93..78,194.41 rows=300,193 width=31) (actual time=1,266.599..1,342.122 rows=276,622 loops=1)

  • Output: document_files_1.id, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.action, document_file_version_user_actions.id
  • Sort Key: document_files_1.id, document_file_version_user_actions.id DESC
  • Sort Method: external merge Disk: 11,376kB
  • Buffers: shared hit=130,276, temp read=3,916 written=3,908
8. 434.261 1,019.600 ↑ 1.1 276,622 1

Hash Left Join (cost=12,677.88..45,924.42 rows=300,193 width=31) (actual time=164.313..1,019.600 rows=276,622 loops=1)

  • Output: document_files_1.id, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.action, document_file_version_user_actions.id
  • Inner Unique: true
  • Hash Cond: (document_file_versions_1.document_file_id = document_files_1.id)
  • Buffers: shared hit=130,276, temp read=2,494 written=2,480
9. 138.696 432.400 ↑ 1.1 276,622 1

Merge Left Join (cost=0.84..27,108.37 rows=300,193 width=31) (actual time=0.024..432.400 rows=276,622 loops=1)

  • Output: document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.time_created, document_file_version_user_actions.created_by, document_file_version_user_actions.action, document_file_version_user_actions.id, document_file_versions_1.document_file_id
  • Inner Unique: true
  • Merge Cond: (document_file_version_user_actions.document_file_version_id = document_file_versions_1.id)
  • Buffers: shared hit=124,298
10. 169.120 169.120 ↑ 1.1 276,622 1

Index Scan using document_file_version_user_actions_document_file_version_id_ind on public.document_file_version_user_actions (cost=0.42..11,646.07 rows=300,193 width=27) (actual time=0.012..169.120 rows=276,622 loops=1)

  • Output: document_file_version_user_actions.id, document_file_version_user_actions.document_file_version_id, document_file_version_user_actions.created_by, document_file_version_user_actions.time_created, document_file_version_user_actions.action, document_file_version_user_actions.value_changes, document_file_version_user_actions.ip_address, document_file_version_user_actions.user_agent
  • Filter: (document_file_version_user_actions.action = ANY ('{create,replace,rename,delete,update}'::text[]))
  • Rows Removed by Filter: 23,978
  • Buffers: shared hit=61,437
11. 124.584 124.584 ↑ 1.0 273,791 1

Index Scan using document_file_versions_pkey on public.document_file_versions document_file_versions_1 (cost=0.42..11,011.99 rows=279,158 width=8) (actual time=0.010..124.584 rows=273,791 loops=1)

  • Output: document_file_versions_1.id, document_file_versions_1.document_file_id
  • Buffers: shared hit=62,861
12. 101.266 152.939 ↓ 1.0 320,691 1

Hash (cost=7,450.35..7,450.35 rows=318,535 width=4) (actual time=152.939..152.939 rows=320,691 loops=1)

  • Output: document_files_1.id
  • Buckets: 131,072 Batches: 8 Memory Usage: 2,440kB
  • Buffers: shared hit=5,978, temp written=817
13. 51.673 51.673 ↓ 1.0 320,691 1

Index Only Scan using document_files_pkey on public.document_files document_files_1 (cost=0.42..7,450.35 rows=318,535 width=4) (actual time=0.017..51.673 rows=320,691 loops=1)

  • Output: document_files_1.id
  • Heap Fetches: 9,882
  • Buffers: shared hit=5,978
14. 0.004 0.521 ↓ 2.0 2 1

Hash (cost=51.19..51.19 rows=1 width=898) (actual time=0.521..0.521 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, drafters.display_name
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=69
15. 0.001 0.517 ↓ 2.0 2 1

Nested Loop Left Join (cost=17.21..51.19 rows=1 width=898) (actual time=0.422..0.517 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name, drafters.display_name
  • Inner Unique: true
  • Buffers: shared hit=69
16. 0.002 0.512 ↓ 2.0 2 1

Nested Loop Left Join (cost=17.06..50.60 rows=1 width=887) (actual time=0.417..0.512 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name, lockers.display_name
  • Inner Unique: true
  • Buffers: shared hit=69
17. 0.000 0.506 ↓ 2.0 2 1

Nested Loop Left Join (cost=16.92..50.44 rows=1 width=876) (actual time=0.412..0.506 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name, uploaders.display_name
  • Inner Unique: true
  • Buffers: shared hit=69
18. 0.004 0.502 ↓ 2.0 2 1

Nested Loop Left Join (cost=16.78..50.28 rows=1 width=865) (actual time=0.408..0.502 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, creators.display_name
  • Inner Unique: true
  • Buffers: shared hit=69
19. 0.009 0.486 ↓ 2.0 2 1

Nested Loop Left Join (cost=16.64..47.88 rows=1 width=854) (actual time=0.396..0.486 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_version_drafts.id, document_file_version_drafts.created_by, document_file_version_drafts.time_created, document_file_version_drafts.time_updated
  • Join Filter: (document_file_version_drafts.document_file_version_id = document_file_versions.id)
  • Rows Removed by Join Filter: 74
  • Buffers: shared hit=65
20. 0.001 0.199 ↓ 2.0 2 1

Nested Loop Left Join (cost=16.64..22.74 rows=1 width=830) (actual time=0.190..0.199 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage))), document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted
  • Buffers: shared hit=27
21. 0.004 0.182 ↓ 2.0 2 1

Nested Loop (cost=16.21..20.09 rows=1 width=54) (actual time=0.178..0.182 rows=2 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name, (bool_or((t1.is_direct_right AND t1.can_view))), (bool_or((t1.is_direct_right AND t1.can_edit))), (bool_or((t1.is_direct_right AND t1.can_manage)))
  • Inner Unique: true
  • Join Filter: (document_files.id = (t1.folder_path_ids[2]))
  • Rows Removed by Join Filter: 10
  • Buffers: shared hit=21
22. 0.005 0.134 ↑ 1.5 2 1

GroupAggregate (cost=15.79..15.86 rows=3 width=7) (actual time=0.132..0.134 rows=2 loops=1)

  • Output: bool_or((t1.is_direct_right AND t1.can_view)), bool_or((t1.is_direct_right AND t1.can_edit)), bool_or((t1.is_direct_right AND t1.can_manage)), (t1.folder_path_ids[2])
  • Group Key: (t1.folder_path_ids[2])
  • Buffers: shared hit=10
23. 0.008 0.129 ↑ 1.5 2 1

Sort (cost=15.79..15.80 rows=3 width=8) (actual time=0.129..0.129 rows=2 loops=1)

  • Output: (t1.folder_path_ids[2]), t1.is_direct_right, t1.can_view, t1.can_edit, t1.can_manage
  • Sort Key: (t1.folder_path_ids[2])
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
24. 0.002 0.121 ↑ 1.5 2 1

Subquery Scan on t1 (cost=15.71..15.77 rows=3 width=8) (actual time=0.120..0.121 rows=2 loops=1)

  • Output: t1.folder_path_ids[2], t1.is_direct_right, t1.can_view, t1.can_edit, t1.can_manage
  • Buffers: shared hit=10
25. 0.009 0.119 ↑ 1.5 2 1

HashAggregate (cost=15.71..15.74 rows=3 width=72) (actual time=0.118..0.119 rows=2 loops=1)

  • Output: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, ((array_length(document_rights.folder_path_ids, 1) = 2))
  • Group Key: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, ((array_length(document_rights.folder_path_ids, 1) = 2))
  • Buffers: shared hit=10
26. 0.000 0.110 ↑ 1.5 2 1

Append (cost=13.14..15.62 rows=3 width=72) (actual time=0.103..0.110 rows=2 loops=1)

  • Buffers: shared hit=10
27. 0.018 0.104 ↑ 1.0 2 1

Unique (cost=13.14..13.20 rows=2 width=72) (actual time=0.102..0.104 rows=2 loops=1)

  • Output: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, ((array_length(document_rights.folder_path_ids, 1) = 2))
  • Buffers: shared hit=9
28. 0.018 0.086 ↑ 1.0 2 1

Sort (cost=13.14..13.14 rows=2 width=72) (actual time=0.086..0.086 rows=2 loops=1)

  • Output: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, ((array_length(document_rights.folder_path_ids, 1) = 2))
  • Sort Key: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, ((array_length(document_rights.folder_path_ids, 1) = 2))
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=9
29. 0.000 0.068 ↑ 1.0 2 1

Append (cost=4.42..13.13 rows=2 width=72) (actual time=0.044..0.068 rows=2 loops=1)

  • Buffers: shared hit=9
30. 0.018 0.053 ↓ 2.0 2 1

Bitmap Heap Scan on public.document_rights (cost=4.42..7.75 rows=1 width=68) (actual time=0.044..0.053 rows=2 loops=1)

  • Output: document_rights.id, document_rights.team_id, document_rights.user_id, document_rights.folder_path_ids, document_rights.can_view, document_rights.can_edit, document_rights.can_manage, document_rights.time_created, document_rights.created_by, document_rights.time_updated, document_rights.updated_by, (array_length(document_rights.folder_path_ids, 1) = 2)
  • Recheck Cond: ('{112198}'::integer[] <@ document_rights.folder_path_ids)
  • Filter: ((document_rights.can_view OR document_rights.can_manage) AND (document_rights.team_id = 31))
  • Rows Removed by Filter: 5
  • Heap Blocks: exact=4
  • Buffers: shared hit=8
31. 0.035 0.035 ↓ 2.7 8 1

Bitmap Index Scan on idx_folder_path_ids_gin (cost=0.00..4.42 rows=3 width=0) (actual time=0.035..0.035 rows=8 loops=1)

  • Index Cond: ('{112198}'::integer[] <@ document_rights.folder_path_ids)
  • Buffers: shared hit=4
32. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=0.54..5.36 rows=1 width=68) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: document_rights_1.id, document_rights_1.team_id, document_rights_1.user_id, document_rights_1.folder_path_ids, document_rights_1.can_view, document_rights_1.can_edit, document_rights_1.can_manage, document_rights_1.time_created, document_rights_1.created_by, document_rights_1.time_updated, document_rights_1.updated_by, (array_length(document_rights_1.folder_path_ids, 1) = 2)
  • Buffers: shared hit=1
33. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=0.15..3.87 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: teams.id, team_users.team_id
  • Inner Unique: true
  • Buffers: shared hit=1
34. 0.015 0.015 ↓ 0.0 0 1

Seq Scan on public.team_users (cost=0.00..1.50 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: team_users.id, team_users.team_id, team_users.user_id, team_users.is_manager, team_users.time_created, team_users.created_by, team_users.time_updated
  • Filter: (team_users.user_id = 5)
  • Rows Removed by Filter: 40
  • Buffers: shared hit=1
35. 0.000 0.000 ↓ 0.0 0

Index Only Scan using teams_pkey on public.teams (cost=0.15..2.37 rows=1 width=4) (never executed)

  • Output: teams.id
  • Index Cond: (teams.id = team_users.team_id)
  • Heap Fetches: 0
36. 0.000 0.000 ↓ 0.0 0

Index Scan using document_rights_team_id_md5_idx on public.document_rights document_rights_1 (cost=0.39..1.47 rows=1 width=67) (never executed)

  • Output: document_rights_1.id, document_rights_1.team_id, document_rights_1.user_id, document_rights_1.folder_path_ids, document_rights_1.can_view, document_rights_1.can_edit, document_rights_1.can_manage, document_rights_1.time_created, document_rights_1.created_by, document_rights_1.time_updated, document_rights_1.updated_by
  • Index Cond: (document_rights_1.team_id = teams.id)
  • Filter: ((document_rights_1.can_view OR document_rights_1.can_manage) AND ('{112198}'::integer[] <@ document_rights_1.folder_path_ids))
37. 0.001 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on public.document_rights document_rights_2 (cost=1.25..2.37 rows=1 width=68) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: document_rights_2.id, document_rights_2.team_id, document_rights_2.user_id, document_rights_2.folder_path_ids, document_rights_2.can_view, document_rights_2.can_edit, document_rights_2.can_manage, document_rights_2.time_created, document_rights_2.created_by, document_rights_2.time_updated, document_rights_2.updated_by, (array_length(document_rights_2.folder_path_ids, 1) = 2)
  • Recheck Cond: (document_rights_2.user_id = 5)
  • Filter: ((document_rights_2.can_view OR document_rights_2.can_manage) AND ('{112198}'::integer[] <@ document_rights_2.folder_path_ids))
  • Buffers: shared hit=1
38. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on document_rights_user_id_md5_idx (cost=0.00..1.25 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (document_rights_2.user_id = 5)
  • Buffers: shared hit=1
39. 0.011 0.044 ↓ 6.0 6 2

Materialize (cost=0.42..4.16 rows=1 width=51) (actual time=0.012..0.022 rows=6 loops=2)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name
  • Buffers: shared hit=11
40. 0.033 0.033 ↓ 7.0 7 1

Index Scan using document_files_parent_id_index on public.document_files (cost=0.42..4.16 rows=1 width=51) (actual time=0.017..0.033 rows=7 loops=1)

  • Output: document_files.id, document_files.anchor, document_files.time_created, document_files.created_by, document_files.time_deleted, document_files.parent_id, document_files.name
  • Index Cond: (document_files.parent_id = 112,198)
  • Filter: (((document_files.time_deleted IS NULL) OR (document_files.time_deleted >= '2020-10-12 09:51:36.212874+00'::timestamp with time zone)) AND (document_files.organization_id = 2))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=11
41. 0.016 0.016 ↓ 0.0 0 2

Index Scan using document_file_versions_document_file_id_index on public.document_file_versions (cost=0.42..2.64 rows=1 width=780) (actual time=0.008..0.008 rows=0 loops=2)

  • Output: document_file_versions.id, document_file_versions.uploaded_by, document_file_versions.file_size_bytes, document_file_versions.version, document_file_versions.locked_by, document_file_versions.message, document_file_versions.filename, document_file_versions.replacement_count, document_file_versions.checkout_append, document_file_versions.deleted, document_file_versions.document_file_id
  • Index Cond: (document_file_versions.document_file_id = document_files.id)
  • Filter: (document_file_versions.latest_version IS TRUE)
  • Buffers: shared hit=6
42. 0.278 0.278 ↑ 1.1 37 2

Seq Scan on public.document_file_version_drafts (cost=0.00..24.65 rows=39 width=28) (actual time=0.008..0.139 rows=37 loops=2)

  • Output: document_file_version_drafts.id, document_file_version_drafts.document_file_version_id, document_file_version_drafts.file_size_bytes, document_file_version_drafts.file_content_type, document_file_version_drafts.created_by, document_file_version_drafts.participant_ids, document_file_version_drafts.time_created, document_file_version_drafts.time_updated, document_file_version_drafts.filename, document_file_version_drafts.deleted, document_file_version_drafts.time_deleted, document_file_version_drafts.uuid
  • Filter: (document_file_version_drafts.deleted IS FALSE)
  • Rows Removed by Filter: 532
  • Buffers: shared hit=38
43. 0.012 0.012 ↑ 1.0 1 2

Index Scan using users_pkey on public.users creators (cost=0.14..2.36 rows=1 width=15) (actual time=0.006..0.006 rows=1 loops=2)

  • Output: creators.display_name, creators.id
  • Index Cond: (creators.id = document_files.created_by)
  • Buffers: shared hit=4
44. 0.004 0.004 ↓ 0.0 0 2

Index Scan using users_pkey on public.users uploaders (cost=0.14..0.16 rows=1 width=15) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: uploaders.display_name, uploaders.id
  • Index Cond: (uploaders.id = document_file_versions.uploaded_by)
45. 0.004 0.004 ↓ 0.0 0 2

Index Scan using users_pkey on public.users lockers (cost=0.14..0.16 rows=1 width=15) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: lockers.display_name, lockers.id
  • Index Cond: (lockers.id = document_file_versions.locked_by)
46. 0.004 0.004 ↓ 0.0 0 2

Index Scan using users_pkey on public.users drafters (cost=0.14..0.58 rows=1 width=15) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: drafters.display_name, drafters.id
  • Index Cond: (drafters.id = document_file_version_drafts.created_by)
47. 0.012 0.012 ↓ 0.0 0 2

Index Scan using users_pkey on public.users last_actors (cost=0.14..0.16 rows=1 width=15) (actual time=0.006..0.006 rows=0 loops=2)

  • Output: last_actors.display_name, last_actors.id
  • Index Cond: (last_actors.id = document_file_version_user_actions.created_by)
48. 0.008 0.008 ↓ 0.0 0 2

Index Scan using users_pkey on public.users deleters (cost=0.14..0.16 rows=1 width=15) (actual time=0.004..0.004 rows=0 loops=2)

  • Output: deleters.display_name, deleters.id
  • Index Cond: (deleters.id = document_file_version_user_actions.created_by)
Planning time : 7.927 ms
Execution time : 1,428.436 ms