explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ogXD

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 5,228.962 ↑ 4.9 41 1

Sort (cost=10,001,116,020.68..10,001,116,021.18 rows=200 width=16) (actual time=5,228.959..5,228.962 rows=41 loops=1)

  • Sort Key: (count(*)) DESC, c_orders.c_count DESC
  • Sort Method: quicksort Memory: 26kB
2. 22.286 5,228.945 ↑ 4.9 41 1

GroupAggregate (cost=10,001,113,761.04..10,001,116,013.04 rows=200 width=16) (actual time=5,179.362..5,228.945 rows=41 loops=1)

  • Group Key: c_orders.c_count
3. 86.041 5,206.659 ↑ 1.0 300,000 1

Sort (cost=10,001,113,761.04..10,001,114,511.04 rows=300,000 width=8) (actual time=5,179.356..5,206.659 rows=300,000 loops=1)

  • Sort Key: c_orders.c_count DESC
  • Sort Method: external merge Disk: 5,320kB
4. 24.759 5,120.618 ↑ 1.0 300,000 1

Subquery Scan on c_orders (cost=10,001,054,094.41..10,001,082,367.13 rows=300,000 width=8) (actual time=4,511.132..5,120.618 rows=300,000 loops=1)

5. 305.336 5,095.859 ↑ 1.0 300,000 1

GroupAggregate (cost=10,001,054,094.41..10,001,079,367.13 rows=300,000 width=12) (actual time=4,511.131..5,095.859 rows=300,000 loops=1)

  • Group Key: customer.c_custkey
6. 1,085.137 4,790.523 ↓ 1.0 3,067,850 1

Sort (cost=10,001,054,094.41..10,001,061,518.65 rows=2,969,697 width=8) (actual time=4,511.12..4,790.523 rows=3,067,850 loops=1)

  • Sort Key: customer.c_custkey
  • Sort Method: external merge Disk: 53,712kB
7. 369.352 3,705.386 ↓ 1.0 3,067,850 1

Nested Loop (cost=10,000,000,000.56..10,000,653,617 rows=2,969,697 width=8) (actual time=0.023..3,705.386 rows=3,067,850 loops=1)

8. 36.034 36.034 ↑ 1.0 300,000 1

Seq Scan on customer customer (cost=10,000,000,000..10,000,010,169 rows=300,000 width=4) (actual time=0.007..36.034 rows=300,000 loops=1)

9. 3,300.000 3,300.000 ↑ 1.7 10 300,000

Index Scan using orders_ckey_comm on orders orders (cost=0.56..1.97 rows=17 width=8) (actual time=0.002..0.011 rows=10 loops=300,000)

  • Index Cond: (customer.c_custkey = o_custkey)
  • Filter: ((o_comment)::text !~~ '%pending%packages%'::text)
Planning time : 0.153 ms
Execution time : 5,238.406 ms