explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Btcr

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 0.610 ↑ 2.0 1 1

GroupAggregate (cost=39.42..39.49 rows=2 width=218) (actual time=0.591..0.610 rows=1 loops=1)

  • Group Key: v.id, i.name, cat.name
2. 0.047 0.554 ↑ 2.0 1 1

Sort (cost=39.42..39.43 rows=2 width=222) (actual time=0.535..0.554 rows=1 loops=1)

  • Sort Key: v.id, i.name, cat.name
  • Sort Method: quicksort Memory: 25kB
3. 0.043 0.507 ↑ 2.0 1 1

Nested Loop Left Join (cost=5.84..39.41 rows=2 width=222) (actual time=0.409..0.507 rows=1 loops=1)

4. 0.040 0.421 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.32..30.74 rows=1 width=186) (actual time=0.343..0.421 rows=1 loops=1)

5. 0.121 0.355 ↑ 1.0 1 1

Nested Loop (cost=4.17..22.54 rows=1 width=102) (actual time=0.295..0.355 rows=1 loops=1)

6. 0.074 0.074 ↓ 4.0 4 1

Seq Scan on items i (cost=0.00..11.25 rows=1 width=40) (actual time=0.022..0.074 rows=4 loops=1)

  • Filter: ((type)::text = 'product'::text)
7. 0.096 0.160 ↓ 0.0 0 4

Bitmap Heap Scan on variants v (cost=4.17..11.28 rows=1 width=66) (actual time=0.035..0.040 rows=0 loops=4)

  • Recheck Cond: (item_id = i.id)
  • Filter: (deleted_at IS NULL)
  • Heap Blocks: exact=1
8. 0.064 0.064 ↓ 0.0 0 4

Bitmap Index Scan on "variants_itemId_idx" (cost=0.00..4.17 rows=3 width=0) (actual time=0.013..0.016 rows=0 loops=4)

  • Index Cond: (item_id = i.id)
9. 0.026 0.026 ↑ 1.0 1 1

Index Scan using categories_pkey on categories cat (cost=0.15..8.17 rows=1 width=92) (actual time=0.017..0.026 rows=1 loops=1)

  • Index Cond: (id = i.category_id)
10. 0.021 0.043 ↓ 0.0 0 1

Bitmap Heap Scan on variant_attributes attrib (cost=1.51..8.63 rows=4 width=40) (actual time=0.034..0.043 rows=0 loops=1)

  • Recheck Cond: (v.id = variant_id)
11. 0.022 0.022 ↓ 0.0 0 1

Bitmap Index Scan on "variant_attributes_variantId_idx" (cost=0.00..1.51 rows=4 width=0) (actual time=0.013..0.022 rows=0 loops=1)

  • Index Cond: (variant_id = v.id)