From ee271764934e5b1a8758d040f64a6a9b645f3443 Mon Sep 17 00:00:00 2001
From: Shigeru Hanada 以ä¸ã«ç¤ºããå
·ä½ä¾ã«ã¤ãã¦èª¬æãã¾ãããã®ä¾ã§ã¯ãHashJoin(a b)ã¨SeqScan(a)ããã³ãã¨è¦ãªãããIndexScan(a)ã¨MergeJoin(a b)ã¯ç¡è¦ããã¦ãã¾ãã
postgres=# /*
-postgres*# HashJoin(a b)
-postgres*# SeqScan(a)
+postgres*# HashJoin(a b)
+postgres*# SeqScan(a)
postgres*# */
postgres-# /* IndexScan(a) */
postgres-# EXPLAIN SELECT /* MergeJoin(a b) */ *
@@ -106,9 +106,9 @@ postgres-# ORDER BY a.aid;
---------------------------------------------------------------------------------------
Sort (cost=31465.84..31715.84 rows=100000 width=197)
Sort Key: a.aid
- -> Hash Join (cost=1.02..4016.02 rows=100000 width=197)
+ -> Hash Join (cost=1.02..4016.02 rows=100000 width=197)
Hash Cond: (a.bid = b.bid)
- -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97)
+ -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97)
-> Hash (cost=1.01..1.01 rows=1 width=100)
-> Seq Scan on pgbench_branches b (cost=0.00..1.01 rows=1 width=100)
(7 rows)
@@ -124,13 +124,13 @@ postgres=#
2ã¤ç®ã®SQLæã§ã¯ãåãã¼ãã«ã«ptãstã¨ããå¥åãã¤ãã¦ãããããå®è¡è¨ç»ä½ææã«ãã³ãã§æå®ããéãã«Merge Joinãé¸æãã¦ãã¾ãã
-postgres=# /* MergeJoin(t1 t1)*/ +postgres=# /* MergeJoin(t1 t1)*/ postgres-# EXPLAIN SELECT * FROM s1.t1 postgres-# JOIN public.t1 ON (s1.t1.id=public.t1.id); INFO: hint syntax error at or near "t1 t1)" -DETAIL: relation name "t1" is ambiguous +DETAIL: relation name "t1" is ambiguous INFO: hint syntax error at or near "t1 t1)" -DETAIL: relation name "t1" is ambiguous +DETAIL: relation name "t1" is ambiguous QUERY PLAN -------------------------------------------------------------------- Hash Join (cost=270.00..323.05 rows=1230 width=44) @@ -140,12 +140,12 @@ INFO: hint syntax error at or near "t1 t1)" -> Seq Scan on t1 (cost=0.00..145.00 rows=10000 width=8) (5 rows) -postgres=# /* MergeJoin(pt st) */ +postgres=# /* MergeJoin(pt st) */ postgres-# EXPLAIN SELECT * FROM s1.t1 st postgres-# JOIN public.t1 pt ON (st.id=pt.id); QUERY PLAN ---------------------------------------------------------------------------------- - Merge Join (cost=0.00..421.33 rows=1230 width=44) + Merge Join (cost=0.00..421.33 rows=1230 width=44) Merge Cond: (st.id = pt.id) -> Index Scan using t1_id_idx on t1 st (cost=0.00..62.70 rows=1230 width=36) -> Index Scan using t1_pkey on t1 pt (cost=0.00..318.25 rows=10000 width=8)(4 rows) @@ -155,13 +155,13 @@ postgres=#
ã¤ã³ããã¯ã¹ã対象ã«ããå ´åã¯ãã¤ã³ããã¯ã¹åã§æå®ãã¦ãã ããããªããã¤ã³ããã¯ã¹åã®ã¿ã対象ã¨ãããã³ãã¯ããã¾ããã
以ä¸ã«ç¤ºããå ·ä½ä¾ã«ã¤ãã¦èª¬æãã¾ãããã®ä¾ã§ã¯ãIndexScanãã³ãã«å¯¾ãã¦t1ãã¼ãã«ã®ä»ã«t1_valã¤ã³ããã¯ã¹ãæå®ãããããå®è¡è¨ç»ä½ææã«t1_valã¤ã³ããã¯ã¹ãç¨ããIndex Scanãé¸æãã¦ãã¾ãã
-postgres=# /* IndexScan(t1 t1_val) */ +postgres=# /* IndexScan(t1 t1_val) */ postgres-# EXPLAIN SELECT * FROM t1 postgres-# WHERE id < 5 postgres-# AND val < 3; QUERY PLAN ------------------------------------------------------------------- - Index Scan using t1_val on t1 (cost=0.00..190.19 rows=1 width=8) + Index Scan using t1_val on t1 (cost=0.00..190.19 rows=1 width=8) Index Cond: (val < 3) Filter: (id < 5) (3 rows) @@ -179,16 +179,16 @@ postgres=#以ä¸ã«ç¤ºããå ·ä½ä¾ã«ã¤ãã¦èª¬æãã¾ãã 1ã¤ç®ã®SQLæã§ã¯ãaãã¼ãã«ã«Index Scanãé¸æããããã³ããç¨ãããããå®è¡è¨ç»ä½ææã«aãã¼ãã«ã«å¯¾ãã¦Index Scanãé¸æãã¦ãã¾ãã 2ã¤ç®ã®SQLæã§ã¯ãaãã¼ãã«ã«Index Scan以å¤ãé¸æããããã³ããç¨ãããããå®è¡è¨ç»ä½ææã«aãã¼ãã«ã«å¯¾ãã¦Index Scan以å¤ã®ã¹ãã£ã³æ¹å¼ã§ããSeq Scanãé¸æãã¦ãã¾ãã
-postgres=# /* IndexScan(a) */ +postgres=# /* IndexScan(a) */ postgres-# EXPLAIN SELECT * postgres-# FROM pgbench_accounts a postgres-# ORDER BY aid; QUERY PLAN --------------------------------------------------------------------------------------------------------- - Index Scan using pgbench_accounts_pkey on pgbench_accounts a (cost=0.00..4247.26 rows=100000 width=97) + Index Scan using pgbench_accounts_pkey on pgbench_accounts a (cost=0.00..4247.26 rows=100000 width=97) (1 row) -postgres=# /* NoIndexScan(a) */ +postgres=# /* NoIndexScan(a) */ postgres-# EXPLAIN SELECT * postgres-# FROM pgbench_accounts a postgres-# ORDER BY aid; @@ -196,7 +196,7 @@ postgres-# ORDER BY aid; --------------------------------------------------------------------------------- Sort (cost=21885.82..22135.82 rows=100000 width=97) Sort Key: aid - -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97) + -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97) (3 rows) postgres=# @@ -210,14 +210,14 @@ postgres=# 2ã¤ç®ã®SQLæã§ã¯ãaãã¼ãã«ã¨bãã¼ãã«ã®çµåã«Merge Join以å¤ãé¸æããããã³ããç¨ãããããå®è¡è¨ç»ä½ææã«Merge Join以å¤ã®çµåæ¹å¼ã§ããNested Loopãé¸æãã¦ãã¾ããpostgres=# /* -postgres*# MergeJoin(b a) +postgres*# MergeJoin(b a) postgres*# */ postgres-# EXPLAIN SELECT * postgres-# FROM pgbench_branches b postgres-# JOIN pgbench_accounts a ON b.bid = a.bid; QUERY PLAN --------------------------------------------------------------------------------------------- - Merge Join (cost=21886.84..23636.85 rows=100000 width=197) + Merge Join (cost=21886.84..23636.85 rows=100000 width=197) Merge Cond: (b.bid = a.bid) -> Sort (cost=1.02..1.02 rows=1 width=100) Sort Key: b.bid @@ -229,14 +229,14 @@ postgres-# JOIN pgbench_accounts a ON b.bid = a.bid; (9 rows) postgres=# /* -postgres*# NoMergeJoin(b a) +postgres*# NoMergeJoin(b a) postgres*# */ postgres-# EXPLAIN SELECT * postgres-# FROM pgbench_branches b postgres-# JOIN pgbench_accounts a ON b.bid = a.bid; QUERY PLAN --------------------------------------------------------------------------------- - Nested Loop (cost=0.00..3891.01 rows=100000 width=197) + Nested Loop (cost=0.00..3891.01 rows=100000 width=197) Join Filter: (b.bid = a.bid) -> Seq Scan on pgbench_branches b (cost=0.00..1.01 rows=1 width=100) -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97) @@ -249,7 +249,7 @@ postgres=#以ä¸ã«ç¤ºããå ·ä½ä¾ã«ã¤ãã¦èª¬æãã¾ãã ãã®ä¾ã§ã¯ãbãã¼ãã«ã¨aãã¼ãã«ãçµåãããå¾ããã®çµåãã¼ãã«ã¨tãã¼ãã«ãçµåããããã³ããç¨ãããããå®è¡è¨ç»ä½ææã«ãã³ãã§æå®ãããã¼ãã«é ã§ãã¼ãã«çµåãé¸æãã¦ãã¾ãã
postgres=# /* -postgres*# Leading(b a t) +postgres*# Leading(b a t) postgres*# */ postgres-# EXPLAIN SELECT * postgres-# FROM pgbench_branches b @@ -258,9 +258,9 @@ postgres-# JOIN pgbench_tellers t ON b.bid = t.bid; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Hash Join (cost=1.23..15399.49 rows=1000000 width=297) - Hash Cond: (b.bid = t.bid) + Hash Cond: (b.bid = t.bid) -> Nested Loop (cost=0.00..3898.27 rows=100000 width=197) - Join Filter: (b.bid = a.bid) + Join Filter: (b.bid = a.bid) -> Index Scan using pgbench_branches_pkey on pgbench_branches b (cost=0.00..8.27 rows=1 width=100) -> Seq Scan on pgbench_accounts a (cost=0.00..2640.00 rows=100000 width=97) -> Hash (cost=1.10..1.10 rows=10 width=100) @@ -284,9 +284,9 @@ postgres-# JOIN pgbench_accounts a ON b.bid = a.bid postgres-# JOIN pgbench_tellers t ON b.bid = t.bid; QUERY PLAN --------------------------------------------------------------------------------------------- - Merge Join (cost=21888.11..37138.29 rows=1000000 width=297) + Merge Join (cost=21888.11..37138.29 rows=1000000 width=297) Merge Cond: (b.bid = a.bid) - -> Merge Join (cost=2.29..2.44 rows=10 width=200) + -> Merge Join (cost=2.29..2.44 rows=10 width=200) Merge Cond: (b.bid = t.bid) -> Sort (cost=1.02..1.02 rows=1 width=100) Sort Key: b.bid diff --git a/doc/style.css b/doc/style.css old mode 100644 new mode 100755 index d832887..54c34ca --- a/doc/style.css +++ b/doc/style.css @@ -83,3 +83,8 @@ p.footer { span.param { color: #0000cd; } + +span.strong { + font-weight: bold; + text-decoration: underline; +} \ No newline at end of file -- 2.11.0