explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.380 22.195 ↓ 2.1 742 1

Unique (cost=3,857.75..3,884.83 rows=361 width=224) (actual time=21.671..22.195 rows=742 loops=1)

2. 0.979 21.815 ↓ 2.1 759 1

Sort (cost=3,857.75..3,858.65 rows=361 width=224) (actual time=21.671..21.815 rows=759 loops=1)

  • Sort 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
  • Sort Method: quicksort Memory: 294kB
3. 3.660 20.836 ↓ 2.1 759 1

Nested Loop (cost=17.62..3,842.42 rows=361 width=224) (actual time=0.098..20.836 rows=759 loops=1)

4. 0.812 3.424 ↓ 1.7 4,584 1

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

5. 0.011 0.020 ↓ 1.6 8 1

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

  • Recheck Cond: (tree_id = 2)
  • Filter: ((lft >= 1) AND (lft <= 16))
  • Heap Blocks: exact=4
6. 0.009 0.009 ↑ 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.009..0.009 rows=8 loops=1)

  • Index Cond: (tree_id = 2)
7. 2.208 2.592 ↑ 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.063..0.324 rows=573 loops=8)

  • Recheck Cond: (category_id = shop_catalog_category.id)
  • Heap Blocks: exact=1,100
8. 0.384 0.384 ↑ 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.048..0.048 rows=573 loops=8)

  • Index Cond: (category_id = shop_catalog_category.id)
9. 13.752 13.752 ↓ 0.0 0 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=0 loops=4,584)

  • Index Cond: (id = shop_catalog_product_full_category.product_id)
  • Filter: (is_active AND is_main_active AND is_main_color_variant AND is_main_size_variant AND ((main_image)::text <> ''::text))
  • Rows Removed by Filter: 1
Planning time : 1.000 ms
Execution time : 22.331 ms