explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TVOr

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 0.586 ↑ 1.0 20 1

Limit (cost=19.14..551.84 rows=20 width=8,537) (actual time=0.176..0.586 rows=20 loops=1)

2. 0.062 0.578 ↑ 163.2 20 1

Nested Loop Left Join (cost=19.14..86,955.96 rows=3,264 width=8,537) (actual time=0.175..0.578 rows=20 loops=1)

  • Join Filter: (current_user_versions.public_id = files.public_id)
3. 0.017 0.476 ↑ 163.2 20 1

Nested Loop (cost=2.96..32,528.88 rows=3,264 width=1,471) (actual time=0.123..0.476 rows=20 loops=1)

  • Join Filter: (files.public_id = file_public_attributes.file_public_id)
4. 0.032 0.379 ↑ 163.2 20 1

Nested Loop Left Join (cost=2.54..30,467.68 rows=3,264 width=508) (actual time=0.107..0.379 rows=20 loops=1)

5. 0.003 0.307 ↑ 163.2 20 1

Nested Loop Left Join (cost=2.11..28,858.47 rows=3,264 width=460) (actual time=0.093..0.307 rows=20 loops=1)

6. 0.008 0.284 ↑ 163.2 20 1

Nested Loop (cost=1.83..27,903.56 rows=3,264 width=449) (actual time=0.082..0.284 rows=20 loops=1)

7. 0.008 0.236 ↑ 163.2 20 1

Nested Loop (cost=1.56..26,948.71 rows=3,264 width=438) (actual time=0.061..0.236 rows=20 loops=1)

8. 0.008 0.188 ↑ 163.2 20 1

Nested Loop (cost=1.28..25,993.87 rows=3,264 width=423) (actual time=0.048..0.188 rows=20 loops=1)

9. 0.018 0.100 ↑ 167.7 20 1

Nested Loop (cost=0.85..24,193.42 rows=3,353 width=213) (actual time=0.030..0.100 rows=20 loops=1)

10. 0.022 0.022 ↑ 168.9 20 1

Index Scan using file_buckets_join_bucket_id_index on file_buckets_join (cost=0.43..371.97 rows=3,379 width=4) (actual time=0.017..0.022 rows=20 loops=1)

  • Index Cond: (bucket_id = 1)
11. 0.060 0.060 ↑ 1.0 1 20

Index Scan using file_curations_file_public_id_index on file_curations (cost=0.43..7.04 rows=1 width=209) (actual time=0.003..0.003 rows=1 loops=20)

  • Index Cond: (file_public_id = file_buckets_join.file_public_id)
12. 0.080 0.080 ↑ 1.0 1 20

Index Scan using files_public_id_index on files (cost=0.43..0.53 rows=1 width=210) (actual time=0.003..0.004 rows=1 loops=20)

  • Index Cond: (public_id = file_curations.file_public_id)
  • Filter: ((version_id IS NULL) AND (deleted_at IS NULL))
13. 0.040 0.040 ↑ 1.0 1 20

Index Scan using users_pkey on users users_created_by (cost=0.28..0.29 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: (id = files.created_by)
14. 0.040 0.040 ↑ 1.0 1 20

Index Scan using users_pkey on users users_updated_by (cost=0.28..0.29 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: (id = files.updated_by)
15. 0.020 0.020 ↓ 0.0 0 20

Index Scan using users_pkey on users users_deleted_by (cost=0.28..0.29 rows=1 width=19) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: (id = files.deleted_by)
16. 0.040 0.040 ↑ 1.0 1 20

Index Scan using files_external_data_file_public_id_unique on files_external_data (cost=0.43..0.49 rows=1 width=52) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: (file_public_id = files.public_id)
17. 0.080 0.080 ↑ 1.0 1 20

Index Scan using file_public_attributes_file_public_id_index on file_public_attributes (cost=0.43..0.62 rows=1 width=975) (actual time=0.003..0.004 rows=1 loops=20)

  • Index Cond: (file_public_id = file_curations.file_public_id)
18. 0.002 0.020 ↓ 0.0 0 20

Materialize (cost=16.17..16.20 rows=1 width=2,280) (actual time=0.001..0.001 rows=0 loops=20)

19. 0.001 0.018 ↓ 0.0 0 1

Subquery Scan on current_user_versions (cost=16.17..16.19 rows=1 width=2,280) (actual time=0.018..0.018 rows=0 loops=1)

20. 0.000 0.017 ↓ 0.0 0 1

Unique (cost=16.17..16.18 rows=1 width=2,830) (actual time=0.017..0.017 rows=0 loops=1)

21. 0.007 0.017 ↓ 0.0 0 1

Sort (cost=16.17..16.18 rows=1 width=2,830) (actual time=0.017..0.017 rows=0 loops=1)

  • Sort Key: f.public_id
  • Sort Method: quicksort Memory: 25kB
22. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.40..16.16 rows=1 width=2,830) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: (fv_title.file_version_id = fv.id)
23. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.40..14.85 rows=1 width=1,768) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: (fv_subtext.file_version_id = fv.id)
24. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.40..13.54 rows=1 width=1,252) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: (fv_alternative_text.file_version_id = fv.id)
25. 0.001 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.40..12.23 rows=1 width=736) (actual time=0.009..0.010 rows=0 loops=1)

  • Join Filter: (fv.id = fv_caption.file_version_id)
26. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=1.40..10.91 rows=1 width=220) (actual time=0.009..0.009 rows=0 loops=1)

27. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=1.13..10.62 rows=1 width=209) (actual time=0.009..0.009 rows=0 loops=1)

28. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.85..10.33 rows=1 width=198) (actual time=0.009..0.009 rows=0 loops=1)

29. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.43..9.70 rows=1 width=198) (actual time=0.009..0.009 rows=0 loops=1)

30. 0.009 0.009 ↓ 0.0 0 1

Seq Scan on file_versions fv (cost=0.00..1.25 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=1)

  • Filter: ((version_id IS NULL) AND (entity_type = '-1'::integer) AND (entity_id = '-1'::integer))
  • Rows Removed by Filter: 17
31. 0.000 0.000 ↓ 0.0 0

Index Scan using files_pkey on files f (cost=0.43..8.45 rows=1 width=194) (never executed)

  • Index Cond: (id = fv.file_id)
32. 0.000 0.000 ↓ 0.0 0

Index Only Scan using file_public_attributes_file_public_id_index on file_public_attributes fpa (cost=0.43..0.62 rows=1 width=4) (never executed)

  • Index Cond: (file_public_id = f.public_id)
  • Heap Fetches: 0
33. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users users_created_by_1 (cost=0.28..0.29 rows=1 width=19) (never executed)

  • Index Cond: (id = f.created_by)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users users_updated_by_1 (cost=0.28..0.29 rows=1 width=19) (never executed)

  • Index Cond: (id = f.updated_by)
35. 0.000 0.000 ↓ 0.0 0

Seq Scan on file_version_values fv_caption (cost=0.00..1.30 rows=1 width=520) (never executed)

  • Filter: (type = 200)
36. 0.000 0.000 ↓ 0.0 0

Seq Scan on file_version_values fv_alternative_text (cost=0.00..1.30 rows=1 width=520) (never executed)

  • Filter: (type = 300)
37. 0.000 0.000 ↓ 0.0 0

Seq Scan on file_version_values fv_subtext (cost=0.00..1.30 rows=1 width=520) (never executed)

  • Filter: (type = 400)
38. 0.000 0.000 ↓ 0.0 0

Seq Scan on file_version_values fv_title (cost=0.00..1.30 rows=1 width=520) (never executed)

  • Filter: (type = 500)
39.          

SubPlan (for Nested Loop Left Join)

40. 0.000 0.000 ↓ 0.0 0 20

Index Scan using users_pkey on users (cost=0.28..8.29 rows=1 width=15) (actual time=0.000..0.000 rows=0 loops=20)

  • Index Cond: (id = file_public_attributes.curated_by)
41. 0.020 0.020 ↓ 0.0 0 20

Index Scan using users_pkey on users users_1 (cost=0.28..8.29 rows=1 width=15) (actual time=0.001..0.001 rows=0 loops=20)

  • Index Cond: (id = file_curations.comment_by)
Planning time : 21.689 ms
Execution time : 0.848 ms