explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x5wJ

Settings
# exclusive inclusive rows x rows loops node
1. 44.086 44.086 ↑ 7.2 81 1

CTE Scan on cte (cost=41,947.17..41,986.75 rows=586 width=45) (actual time=40.257..44.086 rows=81 loops=1)

  • Filter: (rank <= 8)
  • Rows Removed by Filter: 1064
2.          

CTE cte

3. 1.875 42.889 ↑ 1.5 1,145 1

WindowAgg (cost=41,911.99..41,947.17 rows=1,759 width=61) (actual time=40.250..42.889 rows=1,145 loops=1)

4. 2.150 41.014 ↑ 1.5 1,145 1

Sort (cost=41,911.99..41,916.39 rows=1,759 width=37) (actual time=40.224..41.014 rows=1,145 loops=1)

  • Sort Key: prm.content_id, prm.score DESC
  • Sort Method: quicksort Memory: 138kB
5. 4.389 38.864 ↑ 1.5 1,145 1

Nested Loop (cost=147.66..41,817.17 rows=1,759 width=37) (actual time=0.915..38.864 rows=1,145 loops=1)

6. 10.326 11.111 ↑ 2.5 1,947 1

Bitmap Heap Scan on product_content_recommendation_main prm (cost=147.23..14,420.58 rows=4,939 width=37) (actual time=0.878..11.111 rows=1,947 loops=1)

  • Recheck Cond: ((content_id = ANY ('{4195645,4419973,3520881,4262541,3097075,3606189,2170061,2118682,2292006,586756}'::bigint[])) AND (version = 1))
  • Heap Blocks: exact=819
7. 0.785 0.785 ↑ 2.5 1,947 1

Bitmap Index Scan on product_content_recommendatio_content_id_recommended_content_vr (cost=0.00..146.00 rows=4,939 width=0) (actual time=0.784..0.785 rows=1,947 loops=1)

  • Index Cond: ((content_id = ANY ('{4195645,4419973,3520881,4262541,3097075,3606189,2170061,2118682,2292006,586756}'::bigint[])) AND (version = 1))
8. 23.364 23.364 ↑ 1.0 1 1,947

Index Scan using pk_product_content on product_content prc (cost=0.43..5.54 rows=1 width=8) (actual time=0.011..0.012 rows=1 loops=1,947)

  • Index Cond: (product_content_id = prm.recommended_content_id)
  • Filter: is_visible
  • Rows Removed by Filter: 0