explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mzDO

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 16,541.264 ↑ 1.0 20 1

Limit (cost=548,168.72..548,168.77 rows=20 width=214) (actual time=16,541.232..16,541.264 rows=20 loops=1)

2. 1.200 16,541.240 ↑ 20.7 20 1

Sort (cost=548,168.72..548,169.75 rows=414 width=214) (actual time=16,541.231..16,541.240 rows=20 loops=1)

  • Sort Key: offers.id
  • Sort Method: top-N heapsort Memory: 35kB
3. 1.565 16,540.040 ↓ 1.9 802 1

Nested Loop (cost=12,853.76..548,157.70 rows=414 width=214) (actual time=538.406..16,540.040 rows=802 loops=1)

4. 3,139.875 16,524.841 ↓ 5.2 802 1

Merge Join (cost=12,853.32..547,696.06 rows=155 width=185) (actual time=538.387..16,524.841 rows=802 loops=1)

  • Merge Cond: (bb.id = takealot_buy_box_sellers.takealot_buy_box_id)
5. 1.566 538.707 ↓ 1.9 802 1

Sort (cost=12,852.89..12,853.94 rows=421 width=169) (actual time=538.288..538.707 rows=802 loops=1)

  • Sort Key: bb.id
  • Sort Method: quicksort Memory: 238kB
6. 1.784 537.141 ↓ 1.9 802 1

Nested Loop (cost=28.62..12,834.54 rows=421 width=169) (actual time=0.163..537.141 rows=802 loops=1)

7. 1.815 9.884 ↓ 2.5 1,079 1

Nested Loop (cost=28.18..6,598.92 rows=433 width=161) (actual time=0.135..9.884 rows=1,079 loops=1)

8. 1.487 1.583 ↓ 2.5 1,081 1

Bitmap Heap Scan on offers (cost=27.75..2,964.82 rows=433 width=55) (actual time=0.119..1.583 rows=1,081 loops=1)

  • Recheck Cond: (seller_account_id = 1)
  • Filter: buy_box_tracking
  • Heap Blocks: exact=214
9. 0.096 0.096 ↓ 1.1 1,081 1

Bitmap Index Scan on index_offers_on_seller_account_id_and_tsin_id (cost=0.00..27.64 rows=963 width=0) (actual time=0.096..0.096 rows=1,081 loops=1)

  • Index Cond: (seller_account_id = 1)
10. 6.486 6.486 ↑ 1.0 1 1,081

Index Scan using index_takealot_products_on_tsin on takealot_products p (cost=0.43..8.38 rows=1 width=106) (actual time=0.005..0.006 rows=1 loops=1,081)

  • Index Cond: (tsin = offers.tsin_id)
11. 525.473 525.473 ↑ 3.0 1 1,079

Index Scan using index_takealot_buy_boxes_on_takealot_product_id on takealot_buy_boxes bb (cost=0.43..14.37 rows=3 width=24) (actual time=0.063..0.487 rows=1 loops=1,079)

  • Index Cond: (takealot_product_id = p.id)
  • Filter: is_latest
  • Rows Removed by Filter: 16
12. 8,544.720 12,846.259 ↓ 2.7 12,715,743 1

GroupAggregate (cost=0.43..476,174.08 rows=4,693,235 width=16) (actual time=0.037..12,846.259 rows=12,715,743 loops=1)

  • Group Key: takealot_buy_box_sellers.takealot_buy_box_id
13. 4,301.539 4,301.539 ↓ 1.0 14,030,791 1

Index Only Scan using index_takealot_buy_box_sellers_on_takealot_buy_box_id on takealot_buy_box_sellers (cost=0.43..360,405.44 rows=13,767,259 width=8) (actual time=0.028..4,301.539 rows=14,030,791 loops=1)

  • Heap Fetches: 119,102
14. 13.634 13.634 ↑ 3.0 1 802

Index Scan using index_takealot_buy_box_sellers_on_takealot_buy_box_id on takealot_buy_box_sellers s1 (cost=0.43..2.95 rows=3 width=53) (actual time=0.016..0.017 rows=1 loops=802)

  • Index Cond: (takealot_buy_box_id = takealot_buy_box_sellers.takealot_buy_box_id)
  • Filter: (buy_box_position = 0)
  • Rows Removed by Filter: 0
Planning time : 1.599 ms
Execution time : 16,541.363 ms