explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gprr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 109,607.274 ↑ 267.2 4 1

Finalize GroupAggregate (cost=28,900.86..29,049.00 rows=1,069 width=248) (actual time=109,607.093..109,607.274 rows=4 loops=1)

  • Group Key: n1.n_name, n2.n_name, (date_part('year'::text, (lineitem.l_shipdate)::timestamp without time zone))
2. 0.000 109,639.843 ↑ 74.2 12 1

Gather Merge (cost=28,900.86..29,019.17 rows=890 width=248) (actual time=109,606.990..109,639.843 rows=12 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 1.959 328,331.439 ↑ 111.2 4 3

Partial GroupAggregate (cost=27,900.84..27,916.41 rows=445 width=248) (actual time=109,443.357..109,443.813 rows=4 loops=3)

  • Group Key: n1.n_name, n2.n_name, (date_part('year'::text, (lineitem.l_shipdate)::timestamp without time zone))
4. 5.811 328,329.480 ↑ 1.3 343 3

Sort (cost=27,900.84..27,901.95 rows=445 width=228) (actual time=109,443.124..109,443.160 rows=343 loops=3)

  • Sort Key: n1.n_name, n2.n_name, (date_part('year'::text, (lineitem.l_shipdate)::timestamp without time zone))
  • Sort Method: quicksort Memory: 71kB
5. 28.140 328,323.669 ↑ 1.3 343 3

Hash Join (cost=12,445.61..27,881.26 rows=445 width=228) (actual time=33,876.117..109,441.223 rows=343 loops=3)

  • Hash Cond: (customer.c_nationkey = n2.n_nationkey)
  • Join Filter: (((n1.n_name = 'INDIA'::bpchar) AND (n2.n_name = 'FRANCE'::bpchar)) OR ((n1.n_name = 'FRANCE'::bpchar) AND (n2.n_name = 'INDIA'::bpchar)))
  • Rows Removed by Join Filter: 335
6. 66.848 328,294.164 ↑ 1.2 8,665 3

Nested Loop (cost=12,444.21..27,849.52 rows=10,705 width=128) (actual time=29,553.281..109,431.388 rows=8,665 loops=3)

7. 116.088 105,623.568 ↑ 1.2 8,665 3

Merge Join (cost=12,443.79..22,998.32 rows=10,705 width=128) (actual time=29,503.043..35,207.856 rows=8,665 loops=3)

  • Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)
8. 16,947.966 16,947.966 ↑ 5.0 87,370 3

Parallel Index Scan using orders_pkey on orders (cost=0.42..40,395.37 rows=436,907 width=12) (actual time=0.081..5,649.322 rows=87,370 loops=3)

9. 715.791 88,559.514 ↓ 1.0 25,996 3

Sort (cost=12,443.36..12,507.59 rows=25,691 width=128) (actual time=29,502.085..29,519.838 rows=25,996 loops=3)

  • Sort Key: lineitem.l_orderkey
  • Sort Method: external sort Disk: 1784kB
10. 118.356 87,843.723 ↓ 1.0 25,996 3

Nested Loop (cost=1.83..10,561.63 rows=25,691 width=128) (actual time=0.766..29,281.241 rows=25,996 loops=3)

11. 38.751 89.862 ↓ 1.0 817 3

Hash Join (cost=1.40..362.10 rows=800 width=108) (actual time=0.480..29.954 rows=817 loops=3)

  • Hash Cond: (supplier.s_nationkey = n1.n_nationkey)
12. 50.811 50.811 ↑ 1.0 10,000 3

Seq Scan on supplier (cost=0.00..330.00 rows=10,000 width=12) (actual time=0.328..16.937 rows=10,000 loops=3)

13. 0.078 0.300 ↑ 1.0 2 3

Hash (cost=1.38..1.38 rows=2 width=108) (actual time=0.100..0.100 rows=2 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.222 0.222 ↑ 1.0 2 3

Seq Scan on nation n1 (cost=0.00..1.38 rows=2 width=108) (actual time=0.051..0.074 rows=2 loops=3)

  • Filter: ((n_name = 'INDIA'::bpchar) OR (n_name = 'FRANCE'::bpchar))
  • Rows Removed by Filter: 23
15. 87,635.505 87,635.505 ↑ 1.0 32 2,451

Index Scan using idx_lineitem_suppkey on lineitem (cost=0.42..12.43 rows=32 width=32) (actual time=0.841..35.755 rows=32 loops=2,451)

  • Index Cond: (l_suppkey = supplier.s_suppkey)
  • Filter: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate <= '1996-12-31'::date))
  • Rows Removed by Filter: 73
16. 222,603.748 222,603.748 ↑ 1.0 1 25,996

Index Scan using customer_pkey on customer (cost=0.42..0.45 rows=1 width=12) (actual time=8.563..8.563 rows=1 loops=25,996)

  • Index Cond: (c_custkey = orders.o_custkey)
17. 0.102 1.365 ↑ 1.0 2 3

Hash (cost=1.38..1.38 rows=2 width=108) (actual time=0.455..0.455 rows=2 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 1.263 1.263 ↑ 1.0 2 3

Seq Scan on nation n2 (cost=0.00..1.38 rows=2 width=108) (actual time=0.395..0.421 rows=2 loops=3)

  • Filter: ((n_name = 'FRANCE'::bpchar) OR (n_name = 'INDIA'::bpchar))
  • Rows Removed by Filter: 23