3 \begin{enumerate}[label=(\alph*)]
4 \item Hash Join, then Merge Join
6 Merge Join (cost=126688.84..189746.85 rows=4812309 width=12) (actual time=1235.201..3507.532 rows=4790517 loops=1)
8 Merge Cond: ((t.a = r.a) AND (t.c = s.c))
9 Buffers: shared hit=138, temp read=1320 written=3593
10 -> Sort (cost=809.39..834.39 rows=10000 width=8) (actual time=15.180..17.809 rows=10000 loops=1)
13 Sort Method: quicksort Memory: 853kB
14 Buffers: shared hit=45
15 -> Seq Scan on public.t (cost=0.00..145.00 rows=10000 width=8) (actual time=0.036..4.271 rows=10000 loops=1)
17 Buffers: shared hit=45
18 -> Materialize (cost=125878.37..130770.59 rows=978445 width=12) (actual time=1220.009..1810.482 rows=4790518 loops=1)
20 Buffers: shared hit=93, temp read=1320 written=3593
21 -> Sort (cost=125878.37..128324.48 rows=978445 width=12) (actual time=1220.003..1267.097 rows=105629 loops=1)
24 Sort Method: external merge Disk: 21312kB
25 Buffers: shared hit=93, temp read=1320 written=3593
26 -> Hash Join (cost=270.00..11799.45 rows=978445 width=12) (actual time=7.133..326.364 rows=993774 loops=1)
28 Hash Cond: (r.b = s.b)
29 Buffers: shared hit=93
30 -> Seq Scan on public.r (cost=0.00..145.00 rows=10000 width=8) (actual time=0.023..2.157 rows=10000 loops=1)
32 Buffers: shared hit=45
33 -> Hash (cost=145.00..145.00 rows=10000 width=8) (actual time=7.022..7.022 rows=10000 loops=1)
35 Buckets: 16384 Batches: 1 Memory Usage: 519kB
36 Buffers: shared hit=45
37 -> Seq Scan on public.s (cost=0.00..145.00 rows=10000 width=8) (actual time=0.021..3.459 rows=10000 loops=1)
39 Buffers: shared hit=45
40 Planning time: 0.899 ms
41 Execution time: 4040.426 ms
47 Only Merge join: Total cost: 190481.63
48 Only Hash join: Total cost: 378418.91
49 Only Nestloop: Total cost: 174352535.00