explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UB5G

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 0.842 ↑ 1.2 9 1

Sort (cost=144.86..144.89 rows=11 width=44) (actual time=0.842..0.842 rows=9 loops=1)

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

GroupAggregate (cost=1.00..144.67 rows=11 width=44) (actual time=0.741..0.814 rows=9 loops=1)

  • Group Key: p.product_id
3. 0.012 0.775 ↑ 1.2 9 1

Nested Loop (cost=1.00..144.40 rows=11 width=13) (actual time=0.692..0.775 rows=9 loops=1)

4. 0.000 0.457 ↑ 1.2 9 1

Nested Loop (cost=0.72..57.07 rows=11 width=13) (actual time=0.442..0.457 rows=9 loops=1)

5. 0.143 0.143 ↑ 1.2 9 1

Index Scan using sale_index on sale s (cost=0.42..48.62 rows=11 width=17) (actual time=0.135..0.143 rows=9 loops=1)

  • Index Cond: (customer_id = 13)
6. 0.015 0.315 ↑ 1.0 1 9

Materialize (cost=0.29..8.32 rows=1 width=4) (actual time=0.034..0.035 rows=1 loops=9)

7. 0.300 0.300 ↑ 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.299..0.300 rows=1 loops=1)

  • Index Cond: (customer_id = 13)
  • Heap Fetches: 1
8. 0.306 0.306 ↑ 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.034..0.034 rows=1 loops=9)

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