explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CbAN

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 15,799.028 ↑ 1.0 30 1

Limit (cost=866,804.25..866,804.32 rows=30 width=1,172) (actual time=15,799.014..15,799.028 rows=30 loops=1)

  • loops=10,540)
2. 8.503 15,799.016 ↑ 20.2 30 1

Sort (cost=866,804.25..866,805.76 rows=607 width=1,172) (actual time=15,799.012..15,799.016 rows=30 loops=1)

  • Sort Key: ((product."basePrice" = '0'::double precision))
  • Sort Method: top-N heapsort Memory: 40kB
3. 7.106 15,790.513 ↓ 2.7 1,625 1

Nested Loop Left Join (cost=15.77..866,786.32 rows=607 width=1,172) (actual time=15.472..15,790.513 rows=1,625 loops=1)

4. 7.171 81.032 ↓ 2.7 1,625 1

Nested Loop (cost=15.35..5,388.19 rows=607 width=1,155) (actual time=0.165..81.032 rows=1,625 loops=1)

5. 31.283 53.941 ↑ 2.8 1,660 1

Hash Join (cost=14.93..2,307.88 rows=4,684 width=16) (actual time=0.145..53.941 rows=1,660 loops=1)

  • Hash Cond: (pc."categoryId" = cc.descendant)
6. 22.600 22.600 ↑ 1.0 114,505 1

Seq Scan on "productCategory" pc (cost=0.00..1,989.41 rows=114,641 width=32) (actual time=0.014..22.600 rows=114,505 loops=1)

7. 0.013 0.058 ↑ 1.0 20 1

Hash (cost=14.68..14.68 rows=20 width=16) (actual time=0.058..0.058 rows=20 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.028 0.045 ↑ 1.0 20 1

Bitmap Heap Scan on "categoryClosure" cc (cost=4.43..14.68 rows=20 width=16) (actual time=0.025..0.045 rows=20 loops=1)

  • Recheck Cond: (ancestor = '865869ac-d30a-4fbd-87e7-219bd15bc532'::uuid)
  • Heap Blocks: exact=5
9. 0.017 0.017 ↑ 1.0 20 1

Bitmap Index Scan on "categoryClosure_pkey" (cost=0.00..4.43 rows=20 width=0) (actual time=0.016..0.017 rows=20 loops=1)

  • Index Cond: (ancestor = '865869ac-d30a-4fbd-87e7-219bd15bc532'::uuid)
10. 19.920 19.920 ↑ 1.0 1 1,660

Index Scan using product_pkey on product (cost=0.42..0.66 rows=1 width=1,155) (actual time=0.012..0.012 rows=1 loops=1,660)

  • Index Cond: (id = pc."productId")
  • Filter: ((NOT "hideCategory") AND (NOT hide) AND (type = ANY ('{1,2,3}'::integer[])))
  • Rows Removed by Filter: 0
11. 15,481.035 15,702.375 ↓ 0.0 0 1,625

Index Scan using "remainsB2b_pkey" on "remainsB2b" rb (cost=0.42..1,419.09 rows=1 width=32) (actual time=6.964..9.663 rows=0 loops=1,625)

  • Index Cond: (product.id = "productId")
  • Filter: ("warehouseId" = (SubPlan 1))
  • Rows Removed by Filter: 6
12.          

SubPlan (for Index Scan)

13. 21.080 221.340 ↑ 1.0 1 10,540

Limit (cost=17.31..17.32 rows=1 width=20) (actual time=0.020..0.021 rows=1 loops=10,540)

14. 200.260 200.260 ↑ 1.0 1 10,540

Sort (cost=17.31..17.32 rows=1 width=20) (actual time=0.019..0.019 rows=1 loops=10,540)

  • Sort Key: rb2.count DESC
  • Sort Method: quicksort Memory: 25kB
  • -> Index Scan using "remainsB2b_pkey" on "remainsB2b" rb2 (cost=0.42..17.30 rows=1 width=20) (actualtime=0.011..0.014 rows=1
  • Index Cond: (("warehouseId" = ANY ('{0bab4a65-e4a1-439e-99c4-6fa2d70cab0b,171b69d8-bca5-406d-a77c-7401d5ad1c12,640755af-4cb9-4835-83a6-e13ce04945ff}'::uuid[])) AND ("productId" = rb."productId"))