explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Tr6z

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=1,130.30..1,130.69 rows=28 width=493) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=1,130.30..1,130.69 rows=28 width=493) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=1,130.30..1,130.31 rows=28 width=493) (actual rows= loops=)

  • Sort Key: (sum(cart_items.quantity)) DESC, products.id, products.line_id, products.category_id, products.brand_code, products.name, products.description, products.size, products.price_in_cents, products.discount_in_cents, products.photo_file_name, products.photo_content_type, products.photo_file_size, products.photo_updated_at, products.target_gender, products.deleted_at, products.created_at, products.updated_at, products.product_type, products.on_sale, products.is_new, products.limited_edition, products.featured_position, products.catalog_page, products.points, products.is_percentage_discount, products.gender_id
4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,130.04..1,130.16 rows=28 width=493) (actual rows= loops=)

  • Group Key: products.id
5. 0.000 0.000 ↓ 0.0

Sort (cost=1,130.04..1,130.05 rows=28 width=489) (actual rows= loops=)

  • Sort Key: products.id
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.17..1,129.90 rows=28 width=489) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using index_products_on_cycle_id on products (cost=0.08..68.97 rows=65 width=485) (actual rows= loops=)

  • Index Cond: (cycle_id = 874)
  • Filter: ((deleted_at IS NULL) AND (brand_id = 1))
8. 0.000 0.000 ↓ 0.0

Index Scan using index_cart_items_on_product_id on cart_items (cost=0.09..16.31 rows=4 width=8) (actual rows= loops=)

  • Index Cond: (product_id = products.id)
  • Filter: ((deleted_at IS NULL) AND (created_at > '2019-08-10 20:37:33.382505'::timestamp without time zone) AND (quantity <= 10))