explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zYPb

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.018 3,176.677 ↑ 4.8 42 1

Sort (cost=264,583.97..264,584.47 rows=200 width=8) (actual time=3,176.676..3,176.677 rows=42 loops=1)

  • Sort Key: (count(*)), (count(orders.o_orderkey))
  • Sort Method: quicksort Memory: 26kB
2. 30.100 3,176.659 ↑ 4.8 42 1

HashAggregate (cost=264,574.33..264,576.33 rows=200 width=8) (actual time=3,176.651..3,176.659 rows=42 loops=1)

  • Group Key: count(orders.o_orderkey)
3. 190.183 3,146.559 ↑ 1.0 150,000 1

GroupAggregate (cost=219,210.17..262,324.33 rows=150,000 width=8) (actual time=1,960.905..3,146.559 rows=150,000 loops=1)

  • Group Key: customer.c_custkey
4. 252.413 2,956.376 ↓ 1.0 1,533,923 1

Merge Left Join (cost=219,210.17..253,325.08 rows=1,499,850 width=8) (actual time=1,960.888..2,956.376 rows=1,533,923 loops=1)

  • Merge Cond: (customer.c_custkey = orders.o_custkey)
5. 64.791 64.791 ↑ 1.0 150,000 1

Index Only Scan using idx on customer (cost=0.42..7,494.43 rows=150,000 width=4) (actual time=0.082..64.791 rows=150,000 loops=1)

  • Heap Fetches: 150000
6. 179.650 2,639.172 ↑ 1.0 1,483,918 1

Materialize (cost=219,209.01..226,708.26 rows=1,499,850 width=8) (actual time=1,960.802..2,639.172 rows=1,483,918 loops=1)

7. 1,657.633 2,459.522 ↑ 1.0 1,483,918 1

Sort (cost=219,209.01..222,958.64 rows=1,499,850 width=8) (actual time=1,960.798..2,459.522 rows=1,483,918 loops=1)

  • Sort Key: orders.o_custkey
  • Sort Method: external merge Disk: 26056kB
8. 801.889 801.889 ↑ 1.0 1,483,918 1

Seq Scan on orders (cost=0.00..44,845.00 rows=1,499,850 width=8) (actual time=0.038..801.889 rows=1,483,918 loops=1)

  • Filter: ((o_comment)::text !~~ '%special%requests%'::text)
  • Rows Removed by Filter: 16082