explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XALr

Settings
# exclusive inclusive rows x rows loops node
1. 4,768.604 9,335.787 ↓ 1.2 3,886,332 1

Sort (cost=814,017.38..821,868.82 rows=3,140,576 width=113) (actual time=8,350.117..9,335.787 rows=3,886,332 loops=1)

  • Sort Key: product_variants.product_id
  • Sort Method: external merge Disk: 372312kB
2. 4,466.934 4,567.183 ↓ 1.2 3,886,332 1

Hash Right Join (cost=1,449.37..88,666.43 rows=3,140,576 width=113) (actual time=36.354..4,567.183 rows=3,886,332 loops=1)

  • Hash Cond: ((product_variants.data ->> 'sku'::text) = (master_variants.sku)::text)
  • Filter: (((product_variants.data ->> 'sku'::text) IS NOT NULL) OR ((supplier_variants.data ->> 'sku'::text) IS NOT NULL))
  • Rows Removed by Filter: 41
3. 63.935 63.935 ↑ 1.0 131,283 1

Seq Scan on product_variants (cost=0.00..16,199.06 rows=131,285 width=772) (actual time=0.017..63.935 rows=131,283 loops=1)

  • Filter: ((status)::text = ANY ('{available,active}'::text[]))
4. 5.417 36.314 ↓ 1.0 8,449 1

Hash (cost=1,345.31..1,345.31 rows=8,325 width=222) (actual time=36.314..36.314 rows=8,449 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 2253kB
5. 11.291 30.897 ↓ 1.0 8,449 1

Hash Right Join (cost=920.62..1,345.31 rows=8,325 width=222) (actual time=8.728..30.897 rows=8,449 loops=1)

  • Hash Cond: ((supplier_variants.data ->> 'sku'::text) = (master_variants.sku)::text)
6. 8.303 19.388 ↑ 1.0 8,325 1

Hash Right Join (cost=891.79..1,191.60 rows=8,325 width=205) (actual time=8.500..19.388 rows=8,325 loops=1)

  • Hash Cond: (m2.supplier_product_variant_id = supplier_variants.id)
7. 2.609 2.609 ↑ 1.0 16,618 1

Seq Scan on master_product_variant_supplier_product_variant m2 (cost=0.00..256.18 rows=16,618 width=16) (actual time=0.010..2.609 rows=16,618 loops=1)

8. 3.076 8.476 ↑ 1.0 8,325 1

Hash (cost=787.73..787.73 rows=8,325 width=197) (actual time=8.476..8.476 rows=8,325 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1991kB
9. 5.400 5.400 ↑ 1.0 8,325 1

Seq Scan on supplier_product_variants supplier_variants (cost=0.00..787.73 rows=8,325 width=197) (actual time=0.005..5.400 rows=8,325 loops=1)

  • Filter: ((status)::text = ANY ('{available,active}'::text[]))
  • Rows Removed by Filter: 8293
10. 0.080 0.218 ↓ 1.0 353 1

Hash (cost=24.48..24.48 rows=348 width=17) (actual time=0.218..0.218 rows=353 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
11. 0.138 0.138 ↓ 1.0 353 1

Seq Scan on master_product_variants master_variants (cost=0.00..24.48 rows=348 width=17) (actual time=0.007..0.138 rows=353 loops=1)

  • Filter: (sku IS NOT NULL)
Planning time : 0.660 ms
Execution time : 9,946.430 ms