explain.depesz.com

PostgreSQL's explain analyze made readable

Result: c651 : q18-p1

Settings
# exclusive inclusive rows x rows loops node
1. 0.077 4,577.370 ↑ 52,643.1 57 1

Sort (cost=2,423,816.58..2,431,318.21 rows=3,000,654 width=75) (actual time=4,577.366..4,577.370 rows=57 loops=1)

  • Sort Key: _t.o_totalprice DESC, _t.o_orderdate
  • Sort Method: quicksort Memory: 32kB
2. 0.189 4,577.293 ↑ 52,643.1 57 1

GroupAggregate (cost=1,847,634.87..1,937,654.49 rows=3,000,654 width=44) (actual time=4,577.098..4,577.293 rows=57 loops=1)

  • Group Key: _t.c_name, _t.c_custkey, _t.o_orderkey, _t.o_orderdate, _t.o_totalprice
3. 1.336 4,577.104 ↑ 7,520.4 399 1

Sort (cost=1,847,634.87..1,855,136.51 rows=3,000,654 width=44) (actual time=4,577.077..4,577.104 rows=399 loops=1)

  • Sort Key: _t.c_name, _t.c_custkey, _t.o_orderkey, _t.o_orderdate, _t.o_totalprice
  • Sort Method: quicksort Memory: 56kB
4. 0.136 4,575.768 ↑ 7,520.4 399 1

Subquery Scan on _t (cost=382,998.76..1,432,506.33 rows=3,000,654 width=44) (actual time=3,412.733..4,575.768 rows=399 loops=1)

5. 17.753 4,575.632 ↑ 7,520.4 399 1

Hash Join (cost=382,998.76..1,402,499.79 rows=3,000,654 width=56) (actual time=3,412.729..4,575.632 rows=399 loops=1)

  • Hash Cond: (o.o_custkey = c.c_custkey)
6. 600.835 4,494.357 ↑ 7,520.4 399 1

Hash Join (cost=375,952.76..604,031.30 rows=3,000,654 width=33) (actual time=3,345.894..4,494.357 rows=399 loops=1)

  • Hash Cond: (l.l_orderkey = o.o_orderkey)
7. 554.028 554.028 ↑ 1.0 6,001,215 1

Seq Scan on lineitem_1 l (cost=0.00..175,567.09 rows=6,001,309 width=13) (actual time=0.004..554.028 rows=6,001,215 loops=1)

8. 0.263 3,339.494 ↑ 13,157.9 57 1

Hash (cost=366,577.76..366,577.76 rows=750,000 width=28) (actual time=3,339.494..3,339.494 rows=57 loops=1)

  • Buckets: 1048576 Batches: 1 Memory Usage: 8196kB
9. 196.690 3,339.231 ↑ 13,157.9 57 1

Hash Join (cost=315,375.22..366,577.76 rows=750,000 width=28) (actual time=2,993.900..3,339.231 rows=57 loops=1)

  • Hash Cond: (o.o_orderkey = l2.l_orderkey)
10. 151.973 151.973 ↑ 1.0 1,500,000 1

Seq Scan on orders_1 o (cost=0.00..41,854.00 rows=1,500,000 width=24) (actual time=0.010..151.973 rows=1,500,000 loops=1)

11. 0.294 2,990.568 ↑ 6,532.5 57 1

Hash (cost=310,720.79..310,720.79 rows=372,354 width=4) (actual time=2,990.568..2,990.568 rows=57 loops=1)

  • Buckets: 524288 Batches: 1 Memory Usage: 4099kB
12. 1,822.031 2,990.274 ↑ 6,532.5 57 1

GroupAggregate (cost=0.43..306,997.25 rows=372,354 width=9) (actual time=3.545..2,990.274 rows=57 loops=1)

  • Group Key: l2.l_orderkey
  • Filter: (sum(l2.l_quantity) > '300'::numeric)
  • Rows Removed by Filter: 1499943
13. 1,168.243 1,168.243 ↑ 1.0 6,001,215 1

Index Scan using lineitem_1_l_orderkey_idx on lineitem_1 l2 (cost=0.43..271,405.40 rows=6,001,309 width=9) (actual time=0.016..1,168.243 rows=6,001,215 loops=1)

14. 34.838 63.522 ↑ 1.0 150,000 1

Hash (cost=5,171.00..5,171.00 rows=150,000 width=27) (actual time=63.522..63.522 rows=150,000 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 10838kB
15. 28.684 28.684 ↑ 1.0 150,000 1

Seq Scan on customer_1 c (cost=0.00..5,171.00 rows=150,000 width=27) (actual time=0.007..28.684 rows=150,000 loops=1)

Planning time : 4.443 ms
Execution time : 4,578.999 ms