explain.depesz.com

PostgreSQL's explain analyze made readable

Result: agp5 : Optimization for: Optimization for: Optimization for: plan #Wp49; plan #wBnj; plan #11Zp

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 9.862 33.103 ↓ 1.7 4,564 1

HashAggregate (cost=4,034.85..4,062.34 rows=2,749 width=224) (actual time=30.987..33.103 rows=4,564 loops=1)

  • Group Key: shop_catalog_product.id, shop_catalog_product.name, shop_catalog_product.name_overwrite, shop_catalog_product.price, shop_catalog_product.old_price, shop_catalog_product.is_on_sale, shop_catalog_product.is_popular, shop_catalog_product.is_new, shop_catalog_product.is_active, shop_catalog_product.is_main_active, shop_catalog_product.created_at, shop_catalog_product.last_updated_at, shop_catalog_product.is_main_color_variant, shop_catalog_product.color_variant_of_id, shop_catalog_product.is_main_size_variant, shop_catalog_product.size_variant_of_id, shop_catalog_product.category_manual_id, shop_catalog_product.sex, shop_catalog_product.sort, shop_catalog_product.main_image, shop_catalog_product.rotate_counter_clockwise, shop_catalog_product.rotate_clockwise, shop_catalog_product.disable_update_main_image, shop_catalog_product.popularity, shop_catalog_product.need_upload_to_crm, shop_catalog_product.article, shop_catalog_product.bpm_id, shop_catalog_product.update_price, shop_catalog_product.disable_update
2. 5.276 23.241 ↓ 1.7 4,584 1

Nested Loop (cost=17.62..3,835.54 rows=2,749 width=224) (actual time=0.037..23.241 rows=4,584 loops=1)

3. 0.800 4.213 ↓ 1.7 4,584 1

Nested Loop (cost=17.20..2,268.22 rows=2,749 width=4) (actual time=0.030..4.213 rows=4,584 loops=1)

4. 0.023 0.029 ↓ 1.6 8 1

Bitmap Heap Scan on shop_catalog_category (cost=4.21..24.16 rows=5 width=4) (actual time=0.013..0.029 rows=8 loops=1)

  • Recheck Cond: (tree_id = 2)
  • Filter: ((lft >= 1) AND (lft <= 16))
  • Heap Blocks: exact=4
5. 0.006 0.006 ↑ 1.0 8 1

Bitmap Index Scan on shop_catalog_category_tree_id_fa7e2b98 (cost=0.00..4.21 rows=8 width=0) (actual time=0.006..0.006 rows=8 loops=1)

  • Index Cond: (tree_id = 2)
6. 2.712 3.384 ↑ 1.0 573 8

Bitmap Heap Scan on shop_catalog_product_full_category (cost=12.99..442.91 rows=590 width=8) (actual time=0.106..0.423 rows=573 loops=8)

  • Recheck Cond: (category_id = shop_catalog_category.id)
  • Heap Blocks: exact=1,100
7. 0.672 0.672 ↑ 1.0 573 8

Bitmap Index Scan on shop_catalog_product_full_category_category_id_60608c45 (cost=0.00..12.85 rows=590 width=0) (actual time=0.084..0.084 rows=573 loops=8)

  • Index Cond: (category_id = shop_catalog_category.id)
8. 13.752 13.752 ↑ 1.0 1 4,584

Index Scan using shop_catalog_product_pkey on shop_catalog_product (cost=0.42..0.56 rows=1 width=224) (actual time=0.003..0.003 rows=1 loops=4,584)

  • Index Cond: (id = shop_catalog_product_full_category.product_id)
Planning time : 0.867 ms
Execution time : 33.410 ms