explain.depesz.com

A tool for finding a real cause for slow queries.

Result: sIG

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.031 938.131 ↑ 1.0 10 1

Limit (cost=12934.63..12934.66 rows=10 width=187) (actual time=938.092..938.131 rows=10 loops=1)

2. 39.025 938.100 ↑ 62.0 10 1

Sort (cost=12934.63..12936.18 rows=620 width=187) (actual time=938.087..938.100 rows=10 loops=1)

  • Sort Key: public.core_film.popularity
  • Sort Method: top-N heapsort Memory: 19kB
3. 91.802 899.075 ↓ 23.3 14450 1

Nested Loop (cost=9406.64..12921.23 rows=620 width=187) (actual time=597.901..899.075 rows=14450 loops=1)

4. 74.613 706.123 ↓ 23.3 14450 1

Merge Left Join (cost=9406.64..9430.27 rows=620 width=165) (actual time=597.872..706.123 rows=14450 loops=1)

  • Merge Cond: (public.core_film.parent_id = core_rating.parent_id)
  • Filter: ((core_rating.last_displayed IS NULL) AND (((core_rating.type = 1) AND (core_rating.rating IS NULL)) OR (core_rating.user_id IS NULL)))
5. 69.255 598.155 ↓ 9.7 16305 1

Sort (cost=2567.22..2571.43 rows=1684 width=82) (actual time=572.699..598.155 rows=16305 loops=1)

  • Sort Key: public.core_film.parent_id
  • Sort Method: quicksort Memory: 2520kB
6. 73.260 528.900 ↓ 9.7 16305 1

Hash Join (cost=1994.63..2476.98 rows=1684 width=82) (actual time=429.260..528.900 rows=16305 loops=1)

  • Hash Cond: (public.core_film.parent_id = "IN_subquery".parent_id)
7. 26.444 26.444 ↑ 1.0 16634 1

Seq Scan on core_film (cost=0.00..382.34 rows=16634 width=78) (actual time=0.027..26.444 rows=16634 loops=1)

8. 28.517 429.196 ↓ 9.7 16305 1

Hash (cost=1973.58..1973.58 rows=1684 width=4) (actual time=429.196..429.196 rows=16305 loops=1)

9. 49.747 400.679 ↓ 9.7 16305 1

Subquery Scan "IN_subquery" (cost=1872.55..1973.58 rows=1684 width=4) (actual time=271.646..400.679 rows=16305 loops=1)

10. 53.685 350.932 ↓ 9.7 16305 1

SetOp Except (cost=1872.55..1956.74 rows=1684 width=4) (actual time=271.642..350.932 rows=16305 loops=1)

11. 81.750 297.247 ↓ 1.0 16963 1

Sort (cost=1872.55..1914.65 rows=16837 width=4) (actual time=271.631..297.247 rows=16963 loops=1)

  • Sort Key: "*SELECT* 1".parent_id
  • Sort Method: quicksort Memory: 1175kB
12. 62.940 215.497 ↓ 1.0 16963 1

Append (cost=0.00..690.65 rows=16837 width=4) (actual time=0.020..215.497 rows=16963 loops=1)

13. 68.741 149.917 ↑ 1.0 16634 1

Subquery Scan "*SELECT* 1" (cost=0.00..548.68 rows=16634 width=4) (actual time=0.016..149.917 rows=16634 loops=1)

14. 81.176 81.176 ↑ 1.0 16634 1

Seq Scan on core_film (cost=0.00..382.34 rows=16634 width=4) (actual time=0.010..81.176 rows=16634 loops=1)

15. 1.352 2.640 ↓ 1.6 329 1

Subquery Scan "*SELECT* 2" (cost=6.42..141.97 rows=203 width=4) (actual time=0.250..2.640 rows=329 loops=1)

16. 1.078 1.288 ↓ 1.6 329 1

Bitmap Heap Scan on filmbasket_basketitem (cost=6.42..139.94 rows=203 width=4) (actual time=0.244..1.288 rows=329 loops=1)

  • Recheck Cond: (user_id = 3)
  • Filter: (wishlist IS NOT NULL)
17. 0.210 0.210 ↓ 1.2 343 1

Bitmap Index Scan on filmbasket_basketitem_user_id (cost=0.00..6.37 rows=282 width=0) (actual time=0.210..0.210 rows=343 loops=1)

  • Index Cond: (user_id = 3)
18. 19.715 33.355 ↓ 2.2 5343 1

Sort (cost=6839.40..6845.48 rows=2431 width=83) (actual time=25.085..33.355 rows=5343 loops=1)

  • Sort Key: core_rating.parent_id
  • Sort Method: quicksort Memory: 672kB
19. 10.714 13.640 ↓ 2.2 5343 1

Bitmap Heap Scan on core_rating (cost=43.27..6702.69 rows=2431 width=83) (actual time=3.344..13.640 rows=5343 loops=1)

  • Recheck Cond: (user_id = 3)
20. 2.926 2.926 ↓ 6.7 16240 1

Bitmap Index Scan on core_rating_user_id (cost=0.00..42.66 rows=2431 width=0) (actual time=2.926..2.926 rows=16240 loops=1)

  • Index Cond: (user_id = 3)
21. 101.150 101.150 ↑ 1.0 1 14450

Index Scan using core_object_pkey on core_object (cost=0.00..5.62 rows=1 width=26) (actual time=0.005..0.007 rows=1 loops=14450)

  • Index Cond: (core_object.id = public.core_film.parent_id)