explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mnHx : Optimization for: plan #JhEK

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.026 18,023.224 ↑ 4.8 42 1

Sort (cost=186,608.43..186,608.93 rows=200 width=8) (actual time=18,023.222..18,023.224 rows=42 loops=1)

  • Sort Key: (count(*)), (count(orders.o_orderkey))
  • Sort Method: quicksort Memory: 26kB
2. 61.567 18,023.198 ↑ 4.8 42 1

HashAggregate (cost=186,598.78..186,600.78 rows=200 width=8) (actual time=18,023.190..18,023.198 rows=42 loops=1)

  • Group Key: count(orders.o_orderkey)
3. 305.739 17,961.631 ↑ 1.0 150,000 1

GroupAggregate (cost=0.85..184,348.78 rows=150,000 width=8) (actual time=0.208..17,961.631 rows=150,000 loops=1)

  • Group Key: customer.c_custkey
4. 334.109 17,655.892 ↓ 1.0 1,533,923 1

Merge Left Join (cost=0.85..175,349.53 rows=1,499,850 width=8) (actual time=0.117..17,655.892 rows=1,533,923 loops=1)

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

Index Only Scan using pkcustomer on customer (cost=0.42..9,134.43 rows=150,000 width=4) (actual time=0.100..439.614 rows=150,000 loops=1)

  • Heap Fetches: 150000
6. 16,882.169 16,882.169 ↑ 1.0 1,483,918 1

Index Scan using idx on orders (cost=0.43..147,091.98 rows=1,499,850 width=8) (actual time=0.011..16,882.169 rows=1,483,918 loops=1)

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