explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ptd

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,253.951 ↑ 267.2 4 1

Finalize GroupAggregate (cost=28,900.86..29,049.00 rows=1,069 width=248) (actual time=3,252.562..3,253.951 rows=4 loops=1)

  • Group Key: n1.n_name, n2.n_name, (date_part('year'::text, (lineitem.l_shipdate)::timestamp without time zone))
  • Buffers: shared hit=100268 read=22414, temp read=446 written=446
2. 0.000 3,314.072 ↑ 74.2 12 1

Gather Merge (cost=28,900.86..29,019.17 rows=890 width=248) (actual time=3,252.220..3,314.072 rows=12 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=335186 read=40157, temp read=1338 written=1338
3. 4.239 9,154.215 ↑ 111.2 4 3

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

  • Group Key: n1.n_name, n2.n_name, (date_part('year'::text, (lineitem.l_shipdate)::timestamp without time zone))
  • Buffers: shared hit=335186 read=40157, temp read=1338 written=1338
4. 6.453 9,149.976 ↑ 1.3 343 3

Sort (cost=27,900.84..27,901.95 rows=445 width=228) (actual time=3,049.918..3,049.992 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: 72kB
  • Buffers: shared hit=335186 read=40157, temp read=1338 written=1338
5. 22.800 9,143.523 ↑ 1.3 343 3

Hash Join (cost=12,445.61..27,881.26 rows=445 width=228) (actual time=2,537.928..3,047.841 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
  • Buffers: shared hit=335154 read=40155, temp read=1338 written=1338
6. 43.900 9,119.529 ↑ 1.2 8,665 3

Nested Loop (cost=12,444.21..27,849.52 rows=10,705 width=128) (actual time=2,523.491..3,039.843 rows=8,665 loops=3)

  • Buffers: shared hit=335122 read=40150, temp read=1338 written=1338
7. 154.593 8,165.769 ↑ 1.2 8,665 3

Merge Join (cost=12,443.79..22,998.32 rows=10,705 width=128) (actual time=2,522.579..2,721.923 rows=8,665 loops=3)

  • Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)
  • Buffers: shared hit=235191 read=35945, temp read=1338 written=1338
8. 386.388 386.388 ↑ 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.609..128.796 rows=87,370 loops=3)

  • Buffers: shared hit=1243 read=5538
9. 629.343 7,624.788 ↓ 1.0 25,996 3

Sort (cost=12,443.36..12,507.59 rows=25,691 width=128) (actual time=2,521.901..2,541.596 rows=25,996 loops=3)

  • Sort Key: lineitem.l_orderkey
  • Sort Method: external sort Disk: 1784kB
  • Buffers: shared hit=233948 read=30407, temp read=1338 written=1338
10. 63.639 6,995.445 ↓ 1.0 25,996 3

Nested Loop (cost=1.83..10,561.63 rows=25,691 width=128) (actual time=0.745..2,331.815 rows=25,996 loops=3)

  • Buffers: shared hit=233934 read=30407
11. 31.731 78.810 ↓ 1.0 817 3

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

  • Hash Cond: (supplier.s_nationkey = n1.n_nationkey)
  • Buffers: shared hit=464 read=229
12. 46.842 46.842 ↑ 1.0 10,000 3

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

  • Buffers: shared hit=461 read=229
13. 0.102 0.237 ↑ 1.0 2 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=3
14. 0.135 0.135 ↑ 1.0 2 3

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

  • Filter: ((n_name = 'INDIA'::bpchar) OR (n_name = 'FRANCE'::bpchar))
  • Rows Removed by Filter: 23
  • Buffers: shared hit=3
15. 6,852.996 6,852.996 ↑ 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.131..2.796 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
  • Buffers: shared hit=233470 read=30178
16. 909.860 909.860 ↑ 1.0 1 25,996

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

  • Index Cond: (c_custkey = orders.o_custkey)
  • Buffers: shared hit=99931 read=4205
17. 0.072 1.194 ↑ 1.0 2 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=2 read=1
18. 1.122 1.122 ↑ 1.0 2 3

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

  • Filter: ((n_name = 'FRANCE'::bpchar) OR (n_name = 'INDIA'::bpchar))
  • Rows Removed by Filter: 23
  • Buffers: shared hit=2 read=1