explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lJMe

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.382 25.660 ↓ 2.1 742 1

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

2. 0.850 25.278 ↓ 2.1 759 1

Sort (cost=3,857.75..3,858.65 rows=361 width=224) (actual time=25.167..25.278 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. 0.727 24.428 ↓ 2.1 759 1

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

4. 0.703 5.365 ↓ 1.7 4,584 1

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

5. 0.026 0.038 ↓ 1.6 8 1

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

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

  • Index Cond: (tree_id = 2)
7. 4.096 4.624 ↑ 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.085..0.578 rows=573 loops=8)

  • Recheck Cond: (category_id = u0.id)
  • Heap Blocks: exact=1,100
8. 0.528 0.528 ↑ 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.066..0.066 rows=573 loops=8)

  • Index Cond: (category_id = u0.id)
9. 18.336 18.336 ↓ 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.004..0.004 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 : 2.973 ms
Execution time : 25.805 ms