explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wYF7

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,252.703 ↓ 10.0 10 1

Unique (cost=83,107.80..83,107.82 rows=1 width=936) (actual time=1,252.697..1,252.703 rows=10 loops=1)

2. 0.116 1,252.698 ↓ 10.0 10 1

Sort (cost=83,107.80..83,107.81 rows=1 width=936) (actual time=1,252.697..1,252.698 rows=10 loops=1)

  • 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: 26kB
3. 0.016 1,252.582 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,476.37..83,107.79 rows=1 width=936) (actual time=1,248.830..1,252.582 rows=10 loops=1)

  • 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))
  • Rows Removed by Join Filter: 4
4. 0.011 1,252.556 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,476.22..83,107.62 rows=1 width=929) (actual time=1,248.819..1,252.556 rows=10 loops=1)

5. 0.008 1,252.525 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,476.08..83,107.46 rows=1 width=918) (actual time=1,248.799..1,252.525 rows=10 loops=1)

6. 0.022 1,252.507 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,475.94..83,106.86 rows=1 width=907) (actual time=1,248.790..1,252.507 rows=10 loops=1)

7. 0.008 1,252.475 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,475.80..83,106.70 rows=1 width=896) (actual time=1,248.779..1,252.475 rows=10 loops=1)

8. 0.007 1,252.447 ↓ 10.0 10 1

Nested Loop Left Join (cost=77,475.65..83,106.54 rows=1 width=885) (actual time=1,248.767..1,252.447 rows=10 loops=1)

9. 24.399 1,252.340 ↓ 10.0 10 1

Hash Right Join (cost=77,475.51..83,104.14 rows=1 width=874) (actual time=1,248.695..1,252.340 rows=10 loops=1)

  • Hash Cond: (document_files_1.id = document_files.id)
  • Join Filter: (document_files.anchor IS FALSE)
10. 35.647 1,227.478 ↑ 1.1 272,323 1

Unique (cost=77,443.93..78,944.89 rows=300,193 width=31) (actual time=1,134.172..1,227.478 rows=272,323 loops=1)

11. 294.344 1,191.831 ↑ 1.1 276,611 1

Sort (cost=77,443.93..78,194.41 rows=300,193 width=31) (actual time=1,134.171..1,191.831 rows=276,611 loops=1)

  • Sort Key: document_files_1.id, document_file_version_user_actions.id DESC
  • Sort Method: external merge Disk: 11,376kB
12. 471.198 897.487 ↑ 1.1 276,611 1

Hash Left Join (cost=12,677.88..45,924.42 rows=300,193 width=31) (actual time=190.669..897.487 rows=276,611 loops=1)

  • Hash Cond: (document_file_versions_1.document_file_id = document_files_1.id)
13. 76.326 250.040 ↑ 1.1 276,611 1

Merge Left Join (cost=0.84..27,108.37 rows=300,193 width=31) (actual time=0.023..250.040 rows=276,611 loops=1)

  • Merge Cond: (document_file_version_user_actions.document_file_version_id = document_file_versions_1.id)
14. 95.483 95.483 ↑ 1.1 276,611 1

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

  • Filter: (action = ANY ('{create,replace,rename,delete,update}'::text[]))
  • Rows Removed by Filter: 23,971
15. 78.231 78.231 ↑ 1.0 273,782 1

Index Scan using document_file_versions_pkey on document_file_versions document_file_versions_1 (cost=0.42..11,011.99 rows=279,158 width=8) (actual time=0.009..78.231 rows=273,782 loops=1)

16. 116.141 176.249 ↓ 1.0 320,689 1

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

  • Buckets: 131,072 Batches: 8 Memory Usage: 2,440kB
17. 60.108 60.108 ↓ 1.0 320,689 1

Index Only Scan using document_files_pkey on document_files document_files_1 (cost=0.42..7,450.35 rows=318,535 width=4) (actual time=0.143..60.108 rows=320,689 loops=1)

  • Heap Fetches: 9,880
18. 0.012 0.463 ↓ 10.0 10 1

Hash (cost=31.57..31.57 rows=1 width=851) (actual time=0.463..0.463 rows=10 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.032 0.451 ↓ 10.0 10 1

Nested Loop Left Join (cost=3.08..31.57 rows=1 width=851) (actual time=0.169..0.451 rows=10 loops=1)

20. 0.029 0.029 ↓ 10.0 10 1

Index Scan using document_files_parent_id_index on document_files (cost=0.42..4.16 rows=1 width=51) (actual time=0.011..0.029 rows=10 loops=1)

  • Index Cond: (parent_id = 112,198)
  • Filter: (((time_deleted IS NULL) OR (time_deleted >= '2020-10-12 08:58:54.358423+00'::timestamp with time zone)) AND (organization_id = 2))
  • Rows Removed by Filter: 2
21. 0.038 0.390 ↓ 0.0 0 10

Hash Right Join (cost=2.65..27.40 rows=1 width=804) (actual time=0.038..0.039 rows=0 loops=10)

  • Hash Cond: (document_file_version_drafts.document_file_version_id = document_file_versions.id)
22. 0.292 0.292 ↑ 1.1 37 4

Seq Scan on document_file_version_drafts (cost=0.00..24.65 rows=39 width=28) (actual time=0.004..0.073 rows=37 loops=4)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 529
23. 0.020 0.060 ↓ 0.0 0 10

Hash (cost=2.64..2.64 rows=1 width=780) (actual time=0.006..0.006 rows=0 loops=10)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
24. 0.040 0.040 ↓ 0.0 0 10

Index Scan using document_file_versions_document_file_id_index on document_file_versions (cost=0.42..2.64 rows=1 width=780) (actual time=0.003..0.004 rows=0 loops=10)

  • Index Cond: (document_file_id = document_files.id)
  • Filter: (latest_version IS TRUE)
  • Rows Removed by Filter: 1
25. 0.100 0.100 ↑ 1.0 1 10

Index Scan using users_pkey on users creators (cost=0.14..2.36 rows=1 width=15) (actual time=0.009..0.010 rows=1 loops=10)

  • Index Cond: (id = document_files.created_by)
26. 0.020 0.020 ↓ 0.0 0 10

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

  • Index Cond: (id = document_file_versions.uploaded_by)
27. 0.010 0.010 ↓ 0.0 0 10

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

  • Index Cond: (id = document_file_versions.locked_by)
28. 0.010 0.010 ↓ 0.0 0 10

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

  • Index Cond: (id = document_file_version_drafts.created_by)
29. 0.020 0.020 ↓ 0.0 0 10

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

  • Index Cond: (id = document_file_version_user_actions.created_by)
30. 0.010 0.010 ↓ 0.0 0 10

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

  • Index Cond: (id = document_file_version_user_actions.created_by)