explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kajk

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 16.012 ↓ 4.4 96 1

Limit (cost=125.05..137.42 rows=22 width=172) (actual time=14.884..16.012 rows=96 loops=1)

2. 0.016 16.003 ↓ 4.4 96 1

Subquery Scan on t1 (cost=125.05..137.42 rows=22 width=172) (actual time=14.883..16.003 rows=96 loops=1)

3. 1.670 15.987 ↓ 4.4 96 1

GroupAggregate (cost=125.05..137.20 rows=22 width=180) (actual time=14.882..15.987 rows=96 loops=1)

  • Group Key: p.title, v.title, p.published_at, v.sku, (rp_location_name(v.shopify_inventory_item_id))
4. 0.235 14.317 ↓ 4.4 96 1

Sort (cost=125.05..125.10 rows=22 width=136) (actual time=14.306..14.317 rows=96 loops=1)

  • Sort Key: p.title, v.title, p.published_at, v.sku, (rp_location_name(v.shopify_inventory_item_id))
  • Sort Method: quicksort Memory: 38kB
5. 2.542 14.082 ↓ 4.4 96 1

Hash Anti Join (cost=103.53..124.55 rows=22 width=136) (actual time=12.109..14.082 rows=96 loops=1)

  • Hash Cond: ((v.shop_id = dp.shop_id) AND (p.id = dp.product_id))
6. 0.063 11.535 ↓ 2.1 96 1

Hash Join (cost=46.95..61.97 rows=45 width=120) (actual time=11.490..11.535 rows=96 loops=1)

  • Hash Cond: (p.id = v.shopify_product_id)
7. 0.003 0.047 ↑ 5.4 25 1

Append (cost=0.42..14.49 rows=136 width=75) (actual time=0.032..0.047 rows=25 loops=1)

8. 0.044 0.044 ↑ 5.4 25 1

Index Scan using shopify_products_250_shop_id_idx on shopify_products_250 p (cost=0.42..13.81 rows=136 width=75) (actual time=0.031..0.044 rows=25 loops=1)

  • Index Cond: (shop_id = 1)
9. 0.023 11.425 ↓ 1.9 96 1

Hash (cost=45.90..45.90 rows=50 width=61) (actual time=11.425..11.425 rows=96 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
10. 0.038 11.402 ↓ 1.9 96 1

Hash Left Join (cost=31.02..45.90 rows=50 width=61) (actual time=11.338..11.402 rows=96 loops=1)

  • Hash Cond: ((v.shop_id = o.shopid) AND (v.id = o.variant_id))
  • Filter: (CASE WHEN ((lm.id = o.line_item_id) OR (COALESCE(o.line_item_id, '0'::bigint) = 0)) THEN v.inventory_quantity ELSE 0 END <= 0)
11. 0.007 0.055 ↑ 1.6 96 1

Append (cost=0.43..14.16 rows=151 width=53) (actual time=0.013..0.055 rows=96 loops=1)

12. 0.048 0.048 ↑ 1.6 96 1

Index Scan using shopify_product_variants_250_shop_id_idx on shopify_product_variants_250 v (cost=0.43..13.40 rows=151 width=53) (actual time=0.013..0.048 rows=96 loops=1)

  • Index Cond: (shop_id = 1)
  • Filter: (active IS TRUE)
13. 0.000 11.309 ↓ 0.0 0 1

Hash (cost=30.57..30.57 rows=1 width=32) (actual time=11.309..11.309 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
14. 0.001 11.309 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.50..30.57 rows=1 width=32) (actual time=11.309..11.309 rows=0 loops=1)

  • Join Filter: ((o.shopid = lm.shopid) AND (lm.id = o.line_item_id))
15. 11.308 11.308 ↓ 0.0 0 1

Function Scan on rp_shopify_order_line_items o (cost=0.25..17.75 rows=1 width=24) (actual time=11.308..11.308 rows=0 loops=1)

  • Filter: ((created_at >= '2020-09-03 04:00:00'::timestamp without time zone) AND (created_at <= '2020-09-10 03:59:59'::timestamp without time zone) AND (shopid = 1))
16. 0.000 0.000 ↓ 0.0 0

Function Scan on rp_min_line_items lm (cost=0.25..12.75 rows=5 width=16) (never executed)

  • Filter: (shopid = 1)
17. 0.000 0.005 ↓ 0.0 0 1

Hash (cost=55.52..55.52 rows=71 width=16) (actual time=0.005..0.005 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
18. 0.005 0.005 ↓ 0.0 0 1

Index Scan using index_deleted_products_on_shop_id on deleted_products dp (cost=0.42..55.52 rows=71 width=16) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
Planning time : 5.796 ms
Execution time : 16.850 ms