explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G4i4

Settings
# exclusive inclusive rows x rows loops node
1. 0.043 4,629.114 ↑ 4.8 42 1

Sort (cost=266,223.97..266,224.47 rows=200 width=8) (actual time=4,629.111..4,629.114 rows=42 loops=1)

  • Sort Key: (count(*)), (count(orders.o_orderkey))
  • Sort Method: quicksort Memory: 26kB
2. 53.357 4,629.071 ↑ 4.8 42 1

HashAggregate (cost=266,214.33..266,216.33 rows=200 width=8) (actual time=4,629.065..4,629.071 rows=42 loops=1)

  • Group Key: count(orders.o_orderkey)
3. 334.068 4,575.714 ↑ 1.0 150,000 1

GroupAggregate (cost=219,210.17..263,964.33 rows=150,000 width=8) (actual time=2,580.969..4,575.714 rows=150,000 loops=1)

  • Group Key: customer.c_custkey
4. 440.185 4,241.646 ↓ 1.0 1,549,385 1

Merge Left Join (cost=219,210.17..254,965.08 rows=1,499,850 width=8) (actual time=2,580.938..4,241.646 rows=1,549,385 loops=1)

  • Merge Cond: (customer.c_custkey = orders.o_custkey)
5. 155.953 155.953 ↑ 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.749..155.953 rows=150,000 loops=1)

  • Heap Fetches: 150000
6. 287.928 3,645.508 ↑ 1.0 1,499,381 1

Materialize (cost=219,209.01..226,708.26 rows=1,499,850 width=8) (actual time=2,580.171..3,645.508 rows=1,499,381 loops=1)

7. 2,315.566 3,357.580 ↑ 1.0 1,499,381 1

Sort (cost=219,209.01..222,958.64 rows=1,499,850 width=8) (actual time=2,580.163..3,357.580 rows=1,499,381 loops=1)

  • Sort Key: orders.o_custkey
  • Sort Method: external merge Disk: 26336kB
8. 1,042.014 1,042.014 ↑ 1.0 1,499,381 1

Seq Scan on orders (cost=0.00..44,845.00 rows=1,499,850 width=8) (actual time=0.561..1,042.014 rows=1,499,381 loops=1)

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