explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qREn

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 4,500.582 ↑ 4.9 41 1

Sort (cost=20,000,632,388.02..20,000,632,388.52 rows=200 width=16) (actual time=4,500.58..4,500.582 rows=41 loops=1)

  • Sort Key: (count(*)) DESC, c_orders.c_count DESC
  • Sort Method: quicksort Memory: 26kB
2. 23.037 4,500.559 ↑ 4.9 41 1

GroupAggregate (cost=20,000,630,128.37..20,000,632,380.37 rows=200 width=16) (actual time=4,449.869..4,500.559 rows=41 loops=1)

  • Group Key: c_orders.c_count
3. 88.196 4,477.522 ↑ 1.0 300,000 1

Sort (cost=20,000,630,128.37..20,000,630,878.37 rows=300,000 width=8) (actual time=4,449.863..4,477.522 rows=300,000 loops=1)

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

Subquery Scan on c_orders (cost=20,000,570,461.74..20,000,598,734.47 rows=300,000 width=8) (actual time=3,723.192..4,389.326 rows=300,000 loops=1)

5. 306.892 4,364.857 ↑ 1.0 300,000 1

GroupAggregate (cost=20,000,570,461.74..20,000,595,734.47 rows=300,000 width=12) (actual time=3,723.191..4,364.857 rows=300,000 loops=1)

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

Sort (cost=20,000,570,461.74..20,000,577,885.98 rows=2,969,697 width=8) (actual time=3,723.179..4,057.965 rows=3,067,850 loops=1)

  • Sort Key: customer.c_custkey
  • Sort Method: external merge Disk: 53,664kB
7. 1,477.071 2,428.775 ↓ 1.0 3,067,850 1

Hash Join (cost=20,000,015,091..20,000,169,984.33 rows=2,969,697 width=8) (actual time=82.252..2,428.775 rows=3,067,850 loops=1)

8. 869.625 869.625 ↑ 1.0 2,967,848 1

Seq Scan on orders orders (cost=10,000,000,000..10,000,089,686 rows=2,969,697 width=8) (actual time=0.012..869.625 rows=2,967,848 loops=1)

  • Filter: ((o_comment)::text !~~ '%pending%packages%'::text)
9. 44.042 82.079 ↑ 1.0 300,000 1

Hash (cost=10,000,010,169..10,000,010,169 rows=300,000 width=4) (actual time=82.078..82.079 rows=300,000 loops=1)

10. 38.037 38.037 ↑ 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..38.037 rows=300,000 loops=1)

Planning time : 0.177 ms
Execution time : 4,509.62 ms