explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TbnH

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 4.825 ↑ 1.0 5 1

Limit (cost=937.60..937.61 rows=5 width=138) (actual time=4.812..4.825 rows=5 loops=1)

  • Output: product_variant.title, inventory_item.product_variant_id, brand.title, category.title, (min(inventory_item.price)), (max(inventory_item.price)), product.showcase_order, product_variant.id, brand.id, category.id, product.id
  • Buffers: shared hit=399
2. 0.041 4.810 ↑ 54.4 5 1

Sort (cost=937.60..938.28 rows=272 width=138) (actual time=4.810..4.810 rows=5 loops=1)

  • Output: product_variant.title, inventory_item.product_variant_id, brand.title, category.title, (min(inventory_item.price)), (max(inventory_item.price)), product.showcase_order, product_variant.id, brand.id, category.id, product.id
  • Sort Key: product.showcase_order
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=399
3. 0.073 4.769 ↑ 5.4 50 1

HashAggregate (cost=930.36..933.08 rows=272 width=138) (actual time=4.750..4.769 rows=50 loops=1)

  • Output: product_variant.title, inventory_item.product_variant_id, brand.title, category.title, min(inventory_item.price), max(inventory_item.price), product.showcase_order, product_variant.id, brand.id, category.id, product.id
  • Group Key: inventory_item.product_variant_id, product_variant.id, brand.id, category.id, product.id
  • Buffers: shared hit=399
4. 0.080 4.696 ↑ 5.4 50 1

Hash Join (cost=876.93..925.60 rows=272 width=130) (actual time=3.444..4.696 rows=50 loops=1)

  • Output: inventory_item.product_variant_id, product_variant.id, brand.id, category.id, product.id, product_variant.title, brand.title, category.title, inventory_item.price, product.showcase_order
  • Hash Cond: (product.brand_id = brand.id)
  • Buffers: shared hit=399
5. 0.139 4.588 ↑ 1.5 187 1

Hash Join (cost=875.36..922.22 rows=272 width=98) (actual time=3.339..4.588 rows=187 loops=1)

  • Output: inventory_item.product_variant_id, inventory_item.price, product_variant.title, product_variant.id, product.showcase_order, product.id, product.brand_id, category.title, category.id
  • Hash Cond: (product_variant.product_id = product.id)
  • Buffers: shared hit=398
6. 0.116 3.380 ↓ 1.2 187 1

Hash Join (cost=832.87..877.56 rows=157 width=94) (actual time=2.254..3.380 rows=187 loops=1)

  • Output: inventory_item.product_variant_id, inventory_item.price, product_variant.title, product_variant.id, product_variant.product_id, product_category.product_id, category.title, category.id
  • Hash Cond: (product_category.category_id = category.id)
  • Buffers: shared hit=381
7. 0.581 3.254 ↓ 1.2 187 1

Hash Join (cost=831.74..874.27 rows=157 width=62) (actual time=2.228..3.254 rows=187 loops=1)

  • Output: inventory_item.product_variant_id, inventory_item.price, product_variant.title, product_variant.id, product_variant.product_id, product_category.product_id, product_category.category_id
  • Hash Cond: (product_category.product_id = product_variant.product_id)
  • Buffers: shared hit=380
8. 0.484 0.484 ↑ 1.0 1,961 1

Seq Scan on public.product_category (cost=0.00..33.61 rows=1,961 width=8) (actual time=0.008..0.484 rows=1,961 loops=1)

  • Output: product_category.created_date, product_category.updated_date, product_category.id, product_category.product_id, product_category.category_id, product_category."order
  • Buffers: shared hit=14
9. 0.361 2.189 ↓ 1.2 187 1

Hash (cost=829.77..829.77 rows=157 width=54) (actual time=2.188..2.189 rows=187 loops=1)

  • Output: inventory_item.product_variant_id, inventory_item.price, product_variant.title, product_variant.id, product_variant.product_id
  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
  • Buffers: shared hit=366
10. 0.141 1.828 ↓ 1.2 187 1

Hash Join (cost=57.71..829.77 rows=157 width=54) (actual time=1.065..1.828 rows=187 loops=1)

  • Output: inventory_item.product_variant_id, inventory_item.price, product_variant.title, product_variant.id, product_variant.product_id
  • Hash Cond: (inventory_item.product_variant_id = product_variant.id)
  • Buffers: shared hit=366
11. 0.689 0.788 ↓ 1.2 187 1

Bitmap Heap Scan on public.inventory_item (cost=13.30..783.21 rows=157 width=12) (actual time=0.149..0.788 rows=187 loops=1)

  • Output: inventory_item.created_date, inventory_item.updated_date, inventory_item.id, inventory_item.poc_id, inventory_item.product_variant_id, inventory_item.quantity, inventory_item.price, inventory_item.published_date, inventory_item.available_date
  • Recheck Cond: (inventory_item.poc_id = 21)
  • Filter: ((inventory_item.available_date IS NOT NULL) AND (inventory_item.price > '0'::double precision))
  • Rows Removed by Filter: 470
  • Heap Blocks: exact=343
  • Buffers: shared hit=347
12. 0.099 0.099 ↑ 1.0 657 1

Bitmap Index Scan on poc_product_variant (cost=0.00..13.27 rows=663 width=0) (actual time=0.099..0.099 rows=657 loops=1)

  • Index Cond: (inventory_item.poc_id = 21)
  • Buffers: shared hit=4
13. 0.463 0.899 ↑ 1.0 1,129 1

Hash (cost=30.29..30.29 rows=1,129 width=42) (actual time=0.899..0.899 rows=1,129 loops=1)

  • Output: product_variant.title, product_variant.id, product_variant.product_id
  • Buckets: 2048 Batches: 1 Memory Usage: 100kB
  • Buffers: shared hit=19
14. 0.436 0.436 ↑ 1.0 1,129 1

Seq Scan on public.product_variant (cost=0.00..30.29 rows=1,129 width=42) (actual time=0.006..0.436 rows=1,129 loops=1)

  • Output: product_variant.title, product_variant.id, product_variant.product_id
  • Buffers: shared hit=19
15. 0.005 0.010 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=36) (actual time=0.010..0.010 rows=6 loops=1)

  • Output: category.title, category.id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
16. 0.005 0.005 ↑ 1.0 6 1

Seq Scan on public.category (cost=0.00..1.06 rows=6 width=36) (actual time=0.003..0.005 rows=6 loops=1)

  • Output: category.title, category.id
  • Buffers: shared hit=1
17. 0.498 1.069 ↑ 1.0 1,133 1

Hash (cost=28.33..28.33 rows=1,133 width=12) (actual time=1.069..1.069 rows=1,133 loops=1)

  • Output: product.showcase_order, product.id, product.brand_id
  • Buckets: 2048 Batches: 1 Memory Usage: 62kB
  • Buffers: shared hit=17
18. 0.571 0.571 ↑ 1.0 1,133 1

Seq Scan on public.product (cost=0.00..28.33 rows=1,133 width=12) (actual time=0.004..0.571 rows=1,133 loops=1)

  • Output: product.showcase_order, product.id, product.brand_id
  • Buffers: shared hit=17
19. 0.012 0.028 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=36) (actual time=0.028..0.028 rows=25 loops=1)

  • Output: brand.title, brand.id
  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
20. 0.016 0.016 ↑ 1.0 25 1

Seq Scan on public.brand (cost=0.00..1.25 rows=25 width=36) (actual time=0.007..0.016 rows=25 loops=1)

  • Output: brand.title, brand.id
  • Buffers: shared hit=1
Planning time : 1.836 ms
Execution time : 5.061 ms