explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TmFQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 128.886 ↑ 1.2 9 1

Sort (cost=12,628.23..12,628.26 rows=11 width=44) (actual time=128.885..128.886 rows=9 loops=1)

  • Sort Key: (sum(((s.quantity)::numeric * s.price))) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.058 128.848 ↑ 1.2 9 1

GroupAggregate (cost=12,627.74..12,628.04 rows=11 width=44) (actual time=128.826..128.848 rows=9 loops=1)

  • Group Key: p.product_id
3. 0.085 128.790 ↑ 1.2 9 1

Sort (cost=12,627.74..12,627.77 rows=11 width=13) (actual time=128.789..128.790 rows=9 loops=1)

  • Sort Key: p.product_id
  • Sort Method: quicksort Memory: 25kB
4. 0.000 128.705 ↑ 1.2 9 1

Nested Loop (cost=1,000.58..12,627.55 rows=11 width=13) (actual time=33.928..128.705 rows=9 loops=1)

5. 0.268 0.268 ↑ 1.0 1 1

Index Only Scan using customer_pkey on customer c (cost=0.29..8.31 rows=1 width=4) (actual time=0.265..0.268 rows=1 loops=1)

  • Index Cond: (customer_id = 13)
  • Heap Fetches: 1
6. 75.073 133.998 ↑ 1.2 9 1

Gather (cost=1,000.28..12,619.13 rows=11 width=17) (actual time=33.662..133.998 rows=9 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.311 58.925 ↑ 1.7 3 3

Nested Loop (cost=0.29..11,618.03 rows=5 width=17) (actual time=23.257..58.925 rows=3 loops=3)

8. 58.471 58.471 ↑ 1.7 3 3

Parallel Seq Scan on sale s (cost=0.00..11,578.33 rows=5 width=17) (actual time=22.847..58.471 rows=3 loops=3)

  • Filter: (customer_id = 13)
  • Rows Removed by Filter: 333330
9. 0.143 0.143 ↑ 1.0 1 9

Index Only Scan using product_pkey on product p (cost=0.29..7.94 rows=1 width=4) (actual time=0.143..0.143 rows=1 loops=9)

  • Index Cond: (product_id = s.product_id)
  • Heap Fetches: 9
Planning time : 3.111 ms
Execution time : 134.566 ms