explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pewQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.257 318.821 ↓ 248.0 248 1

Limit (cost=65,154.90..65,154.91 rows=1 width=187) (actual time=318.792..318.821 rows=248 loops=1)

2. 2.521 318.564 ↓ 172.6 7,248 1

Sort (cost=65,154.80..65,154.90 rows=42 width=187) (actual time=318.238..318.564 rows=7,248 loops=1)

  • Sort Key: tmp."Product Type
  • Sort Method: quicksort Memory: 1214kB
3. 0.757 316.043 ↓ 172.6 7,248 1

Subquery Scan on tmp (cost=62,312.05..65,153.67 rows=42 width=187) (actual time=302.808..316.043 rows=7,248 loops=1)

4. 12.018 315.286 ↓ 172.6 7,248 1

GroupAggregate (cost=62,312.05..65,153.25 rows=42 width=201) (actual time=302.806..315.286 rows=7,248 loops=1)

  • Group Key: p.product_type, p.vendor, p.title, shopify_product_variants.title, shopify_product_variants.sku, shopify_product_variants.barcode, (product_visibility(p.id))
  • Filter: (CASE WHEN ((GROUPING(p.product_type) = 0) AND (GROUPING(p.vendor) = 0) AND (GROUPING(p.title) = 0) AND (GROUPING(shopify_product_variants.title) = 0) AND (GROUPING(shopify_product_variants.sku) = 0) AND (GROUPING(shopify_product_variants.barcode) = 0) AND (GROUPING((product_visibility(p.id))) = 0)) THEN 1 ELSE 0 END = 1)
5. 34.177 303.268 ↑ 1.2 7,253 1

Sort (cost=62,312.05..62,333.09 rows=8,416 width=133) (actual time=302.776..303.268 rows=7,253 loops=1)

  • Sort Key: p.product_type, p.vendor, p.title, shopify_product_variants.title, shopify_product_variants.sku, shopify_product_variants.barcode, (product_visibility(p.id))
  • Sort Method: quicksort Memory: 1358kB
6. 45.801 269.091 ↑ 1.2 7,253 1

Nested Loop (cost=42,132.64..61,763.37 rows=8,416 width=133) (actual time=214.697..269.091 rows=7,253 loops=1)

7. 1.386 216.037 ↑ 1.2 7,253 1

Hash Right Join (cost=42,132.21..42,145.97 rows=8,416 width=75) (actual time=214.664..216.037 rows=7,253 loops=1)

  • Hash Cond: (lm.id = l.id)
8. 2.152 2.152 ↑ 13.0 77 1

Function Scan on min_line_items lm (cost=0.25..10.25 rows=1,000 width=8) (actual time=2.145..2.152 rows=77 loops=1)

9. 1.744 212.499 ↑ 1.2 7,253 1

Hash (cost=42,026.76..42,026.76 rows=8,416 width=67) (actual time=212.499..212.499 rows=7,253 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 778kB
10. 0.000 210.755 ↑ 1.2 7,253 1

Nested Loop Left Join (cost=186.09..42,026.76 rows=8,416 width=67) (actual time=0.527..210.755 rows=7,253 loops=1)

11. 3.692 8.585 ↑ 1.2 7,249 1

Hash Anti Join (cost=185.52..8,017.60 rows=8,416 width=67) (actual time=0.139..8.585 rows=7,249 loops=1)

  • Hash Cond: ((shopify_product_variants.shop_id = dp.shop_id) AND (shopify_product_variants.shopify_product_id = dp.product_id))
12. 4.773 4.773 ↓ 1.0 8,743 1

Index Scan using index_shopify_product_variants_on_shop_id on shopify_product_variants (cost=0.43..7,704.09 rows=8,425 width=75) (actual time=0.015..4.773 rows=8,743 loops=1)

  • Index Cond: (shop_id = 9)
13. 0.043 0.120 ↓ 1.3 331 1

Hash (cost=181.33..181.33 rows=251 width=16) (actual time=0.120..0.120 rows=331 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
14. 0.077 0.077 ↓ 1.3 331 1

Index Scan using index_deleted_products_on_shop_id on deleted_products dp (cost=0.42..181.33 rows=251 width=16) (actual time=0.012..0.077 rows=331 loops=1)

  • Index Cond: (shop_id = 9)
15. 0.000 202.972 ↓ 0.0 0 7,249

Nested Loop (cost=0.56..4.03 rows=1 width=16) (actual time=0.028..0.028 rows=0 loops=7,249)

16. 72.490 72.490 ↓ 10.0 10 7,249

Index Scan using ix_line_item_id_variant_id_2 on shopify_line_items l (cost=0.56..2.56 rows=1 width=24) (actual time=0.002..0.010 rows=10 loops=7,249)

  • Index Cond: ((shopify_product_variants.id = shopify_product_variant_id) AND (shopify_product_variant_id = shopify_product_variants.id))
17. 71.380 142.760 ↓ 0.0 0 71,380

Append (cost=0.00..1.45 rows=2 width=8) (actual time=0.002..0.002 rows=0 loops=71,380)

18. 0.000 0.000 ↓ 0.0 0 71,380

Seq Scan on shopify_orders so (cost=0.00..0.00 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=71,380)

  • Filter: ((created_at >= '2020-03-17 23:00:00'::timestamp without time zone) AND (created_at <= '2020-03-18 22:59:59'::timestamp without time zone) AND (l.shopify_order_id = id))
19. 71.380 71.380 ↓ 0.0 0 71,380

Index Scan using shopify_orders_2020_03_06_pkey on shopify_orders_2020_03_06 so_1 (cost=0.42..1.44 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=71,380)

  • Index Cond: (id = l.shopify_order_id)
  • Filter: ((created_at >= '2020-03-17 23:00:00'::timestamp without time zone) AND (created_at <= '2020-03-18 22:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 0
20. 7.253 7.253 ↑ 1.0 1 7,253

Index Scan using shopify_products_pkey on shopify_products p (cost=0.43..2.08 rows=1 width=73) (actual time=0.001..0.001 rows=1 loops=7,253)

  • Index Cond: (id = shopify_product_variants.shopify_product_id)
Planning time : 1.960 ms
Execution time : 318.949 ms