Commit 3d14c174 authored by Tom Lane's avatar Tom Lane

Doc: tweak examples to silence line-too-long PDF build warnings.

In one or two places it seemed reasonable to modify the example so as
to shorten its output slightly; but for the most part I just added a
&zwsp; after 67 characters, which is the most we can fit on a line
of monospace text in A4 format.

Discussion: https://postgr.es/m/6916.1589146280@sss.pgh.pa.us
parent 5cbfce56
...@@ -131,7 +131,7 @@ CREATE INDEX ...@@ -131,7 +131,7 @@ CREATE INDEX
<programlisting> <programlisting>
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; =# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------------------------
Seq Scan on tbloom (cost=0.00..213694.08 rows=1 width=24) (actual time=1445.438..1445.438 rows=0 loops=1) Seq Scan on tbloom (cost=0.00..213694.08 rows=1 width=24) (actual time=1445.438..1445.438 rows=0 loops=1)
Filter: ((i2 = 898732) AND (i5 = 123451)) Filter: ((i2 = 898732) AND (i5 = 123451))
Rows Removed by Filter: 10000000 Rows Removed by Filter: 10000000
...@@ -147,7 +147,7 @@ CREATE INDEX ...@@ -147,7 +147,7 @@ CREATE INDEX
<programlisting> <programlisting>
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; =# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------------------------------------------
Index Only Scan using btreeidx on tbloom (cost=0.56..298311.96 rows=1 width=24) (actual time=445.709..445.709 rows=0 loops=1) Index Only Scan using btreeidx on tbloom (cost=0.56..298311.96 rows=1 width=24) (actual time=445.709..445.709 rows=0 loops=1)
Index Cond: ((i2 = 898732) AND (i5 = 123451)) Index Cond: ((i2 = 898732) AND (i5 = 123451))
Heap Fetches: 0 Heap Fetches: 0
...@@ -162,7 +162,7 @@ CREATE INDEX ...@@ -162,7 +162,7 @@ CREATE INDEX
<programlisting> <programlisting>
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; =# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------------------------------------------------------
Bitmap Heap Scan on tbloom (cost=178435.39..178439.41 rows=1 width=24) (actual time=76.698..76.698 rows=0 loops=1) Bitmap Heap Scan on tbloom (cost=178435.39..178439.41 rows=1 width=24) (actual time=76.698..76.698 rows=0 loops=1)
Recheck Cond: ((i2 = 898732) AND (i5 = 123451)) Recheck Cond: ((i2 = 898732) AND (i5 = 123451))
Rows Removed by Index Recheck: 2439 Rows Removed by Index Recheck: 2439
...@@ -189,7 +189,7 @@ CREATE INDEX ...@@ -189,7 +189,7 @@ CREATE INDEX
<programlisting> <programlisting>
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; =# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------------------------------------------
Bitmap Heap Scan on tbloom (cost=9.29..13.30 rows=1 width=24) (actual time=0.148..0.148 rows=0 loops=1) Bitmap Heap Scan on tbloom (cost=9.29..13.30 rows=1 width=24) (actual time=0.148..0.148 rows=0 loops=1)
Recheck Cond: ((i5 = 123451) AND (i2 = 898732)) Recheck Cond: ((i5 = 123451) AND (i2 = 898732))
-&gt; BitmapAnd (cost=9.29..9.29 rows=1 width=0) (actual time=0.145..0.145 rows=0 loops=1) -&gt; BitmapAnd (cost=9.29..9.29 rows=1 width=0) (actual time=0.145..0.145 rows=0 loops=1)
......
...@@ -4036,7 +4036,7 @@ SELECT $$the lexeme 'Joe''s' contains a quote$$::tsvector; ...@@ -4036,7 +4036,7 @@ SELECT $$the lexeme 'Joe''s' contains a quote$$::tsvector;
<programlisting> <programlisting>
SELECT 'a:1 fat:2 cat:3 sat:4 on:5 a:6 mat:7 and:8 ate:9 a:10 fat:11 rat:12'::tsvector; SELECT 'a:1 fat:2 cat:3 sat:4 on:5 a:6 mat:7 and:8 ate:9 a:10 fat:11 rat:12'::tsvector;
tsvector tsvector
------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------
'a':1,6,10 'and':8 'ate':9 'cat':3 'fat':2,11 'mat':7 'on':5 'rat':12 'sat':4 'a':1,6,10 'and':8 'ate':9 'cat':3 'fat':2,11 'mat':7 'on':5 'rat':12 'sat':4
</programlisting> </programlisting>
......
...@@ -4537,7 +4537,7 @@ SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01'; ...@@ -4537,7 +4537,7 @@ SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01';
SET enable_partition_pruning = off; SET enable_partition_pruning = off;
EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01'; EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01';
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------------
Aggregate (cost=188.76..188.77 rows=1 width=8) Aggregate (cost=188.76..188.77 rows=1 width=8)
-&gt; Append (cost=0.00..181.05 rows=3085 width=0) -&gt; Append (cost=0.00..181.05 rows=3085 width=0)
-&gt; Seq Scan on measurement_y2006m02 (cost=0.00..33.12 rows=617 width=0) -&gt; Seq Scan on measurement_y2006m02 (cost=0.00..33.12 rows=617 width=0)
...@@ -4562,7 +4562,7 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01'; ...@@ -4562,7 +4562,7 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01';
SET enable_partition_pruning = on; SET enable_partition_pruning = on;
EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01'; EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2008-01-01';
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------------
Aggregate (cost=37.75..37.76 rows=1 width=8) Aggregate (cost=37.75..37.76 rows=1 width=8)
-&gt; Seq Scan on measurement_y2008m01 (cost=0.00..33.12 rows=617 width=0) -&gt; Seq Scan on measurement_y2008m01 (cost=0.00..33.12 rows=617 width=0)
Filter: (logdate &gt;= '2008-01-01'::date) Filter: (logdate &gt;= '2008-01-01'::date)
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<screen> <screen>
=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class; =# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------------------------------
Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=0.303..0.303 rows=1 loops=1) Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=0.303..0.303 rows=1 loops=1)
-> Seq Scan on pg_class (cost=0.00..15.42 rows=342 width=4) (actual time=0.017..0.111 rows=356 loops=1) -> Seq Scan on pg_class (cost=0.00..15.42 rows=342 width=4) (actual time=0.017..0.111 rows=356 loops=1)
Planning Time: 0.116 ms Planning Time: 0.116 ms
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
SET SET
=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class; =# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------------------------------
Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=6.049..6.049 rows=1 loops=1) Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=6.049..6.049 rows=1 loops=1)
-> Seq Scan on pg_class (cost=0.00..15.42 rows=342 width=4) (actual time=0.019..0.052 rows=356 loops=1) -> Seq Scan on pg_class (cost=0.00..15.42 rows=342 width=4) (actual time=0.019..0.052 rows=356 loops=1)
Planning Time: 0.133 ms Planning Time: 0.133 ms
......
...@@ -788,14 +788,14 @@ test=# SELECT * FROM hash_bitmap_info('con_hash_index', 2052); ...@@ -788,14 +788,14 @@ test=# SELECT * FROM hash_bitmap_info('con_hash_index', 2052);
<listitem> <listitem>
<para> <para>
<function>hash_metapage_info</function> returns information stored <function>hash_metapage_info</function> returns information stored
in meta page of a <acronym>HASH</acronym> index. For example: in the meta page of a <acronym>HASH</acronym> index. For example:
<screen> <screen>
test=# SELECT magic, version, ntuples, ffactor, bsize, bmsize, bmshift, test=# SELECT magic, version, ntuples, ffactor, bsize, bmsize, bmshift,
test-# maxbucket, highmask, lowmask, ovflpoint, firstfree, nmaps, procid, test-# maxbucket, highmask, lowmask, ovflpoint, firstfree, nmaps, procid,
test-# regexp_replace(spares::text, '(,0)*}', '}') as spares, test-# regexp_replace(spares::text, '(,0)*}', '}') as spares,
test-# regexp_replace(mapp::text, '(,0)*}', '}') as mapp test-# regexp_replace(mapp::text, '(,0)*}', '}') as mapp
test-# FROM hash_metapage_info(get_raw_page('con_hash_index', 0)); test-# FROM hash_metapage_info(get_raw_page('con_hash_index', 0));
-[ RECORD 1 ]------------------------------------------------------------------------------- -[ RECORD 1 ]-------------------------------------------------&zwsp;------------------------------
magic | 105121344 magic | 105121344
version | 4 version | 4
ntuples | 500500 ntuples | 500500
...@@ -810,7 +810,7 @@ ovflpoint | 28 ...@@ -810,7 +810,7 @@ ovflpoint | 28
firstfree | 1204 firstfree | 1204
nmaps | 1 nmaps | 1
procid | 450 procid | 450
spares | {0,0,0,0,0,0,1,1,1,1,1,1,1,1,3,4,4,4,45,55,58,59,508,567,628,704,1193,1202,1204} spares | {0,0,0,0,0,0,1,1,1,1,1,1,1,1,3,4,4,4,45,55,58,59,&zwsp;508,567,628,704,1193,1202,1204}
mapp | {65} mapp | {65}
</screen> </screen>
</para> </para>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<screen> <screen>
EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%'; EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------
Gather (cost=1000.00..217018.43 rows=1 width=97) Gather (cost=1000.00..217018.43 rows=1 width=97)
Workers Planned: 2 Workers Planned: 2
-> Parallel Seq Scan on pgbench_accounts (cost=0.00..216018.33 rows=1 width=97) -> Parallel Seq Scan on pgbench_accounts (cost=0.00..216018.33 rows=1 width=97)
......
...@@ -229,7 +229,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 7000; ...@@ -229,7 +229,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 7000;
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------
Bitmap Heap Scan on tenk1 (cost=5.07..229.20 rows=101 width=244) Bitmap Heap Scan on tenk1 (cost=5.07..229.20 rows=101 width=244)
Recheck Cond: (unique1 &lt; 100) Recheck Cond: (unique1 &lt; 100)
-&gt; Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0) -&gt; Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0)
...@@ -256,7 +256,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100; ...@@ -256,7 +256,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100;
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND stringu1 = 'xxx'; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND stringu1 = 'xxx';
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------
Bitmap Heap Scan on tenk1 (cost=5.04..229.43 rows=1 width=244) Bitmap Heap Scan on tenk1 (cost=5.04..229.43 rows=1 width=244)
Recheck Cond: (unique1 &lt; 100) Recheck Cond: (unique1 &lt; 100)
Filter: (stringu1 = 'xxx'::name) Filter: (stringu1 = 'xxx'::name)
...@@ -280,7 +280,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND stringu1 = 'xxx'; ...@@ -280,7 +280,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND stringu1 = 'xxx';
EXPLAIN SELECT * FROM tenk1 WHERE unique1 = 42; EXPLAIN SELECT * FROM tenk1 WHERE unique1 = 42;
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------
Index Scan using tenk1_unique1 on tenk1 (cost=0.29..8.30 rows=1 width=244) Index Scan using tenk1_unique1 on tenk1 (cost=0.29..8.30 rows=1 width=244)
Index Cond: (unique1 = 42) Index Cond: (unique1 = 42)
</screen> </screen>
...@@ -318,7 +318,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY unique1; ...@@ -318,7 +318,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY unique1;
<screen> <screen>
EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100; EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------------------
Limit (cost=521.06..538.05 rows=100 width=244) Limit (cost=521.06..538.05 rows=100 width=244)
-> Incremental Sort (cost=521.06..2220.95 rows=10000 width=244) -> Incremental Sort (cost=521.06..2220.95 rows=10000 width=244)
Sort Key: four, ten Sort Key: four, ten
...@@ -343,7 +343,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100; ...@@ -343,7 +343,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100;
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------
Bitmap Heap Scan on tenk1 (cost=25.08..60.21 rows=10 width=244) Bitmap Heap Scan on tenk1 (cost=25.08..60.21 rows=10 width=244)
Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000)) Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000))
-&gt; BitmapAnd (cost=25.08..25.08 rows=10 width=0) -&gt; BitmapAnd (cost=25.08..25.08 rows=10 width=0)
...@@ -366,7 +366,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000; ...@@ -366,7 +366,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000;
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------
Limit (cost=0.29..14.48 rows=2 width=244) Limit (cost=0.29..14.48 rows=2 width=244)
-&gt; Index Scan using tenk1_unique2 on tenk1 (cost=0.29..71.27 rows=10 width=244) -&gt; Index Scan using tenk1_unique2 on tenk1 (cost=0.29..71.27 rows=10 width=244)
Index Cond: (unique2 &gt; 9000) Index Cond: (unique2 &gt; 9000)
...@@ -396,7 +396,7 @@ FROM tenk1 t1, tenk2 t2 ...@@ -396,7 +396,7 @@ FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------
Nested Loop (cost=4.65..118.62 rows=10 width=488) Nested Loop (cost=4.65..118.62 rows=10 width=488)
-&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244) -&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244)
Recheck Cond: (unique1 &lt; 10) Recheck Cond: (unique1 &lt; 10)
...@@ -445,7 +445,7 @@ FROM tenk1 t1, tenk2 t2 ...@@ -445,7 +445,7 @@ FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t2.unique2 &lt; 10 AND t1.hundred &lt; t2.hundred; WHERE t1.unique1 &lt; 10 AND t2.unique2 &lt; 10 AND t1.hundred &lt; t2.hundred;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------------------------
Nested Loop (cost=4.65..49.46 rows=33 width=488) Nested Loop (cost=4.65..49.46 rows=33 width=488)
Join Filter: (t1.hundred &lt; t2.hundred) Join Filter: (t1.hundred &lt; t2.hundred)
-&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244) -&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244)
...@@ -493,7 +493,7 @@ FROM tenk1 t1, tenk2 t2 ...@@ -493,7 +493,7 @@ FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------
Hash Join (cost=230.47..713.98 rows=101 width=488) Hash Join (cost=230.47..713.98 rows=101 width=488)
Hash Cond: (t2.unique2 = t1.unique2) Hash Cond: (t2.unique2 = t1.unique2)
-&gt; Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244) -&gt; Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244)
...@@ -524,7 +524,7 @@ FROM tenk1 t1, onek t2 ...@@ -524,7 +524,7 @@ FROM tenk1 t1, onek t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------
Merge Join (cost=198.11..268.19 rows=10 width=488) Merge Join (cost=198.11..268.19 rows=10 width=488)
Merge Cond: (t1.unique2 = t2.unique2) Merge Cond: (t1.unique2 = t2.unique2)
-&gt; Index Scan using tenk1_unique2 on tenk1 t1 (cost=0.29..656.28 rows=101 width=244) -&gt; Index Scan using tenk1_unique2 on tenk1 t1 (cost=0.29..656.28 rows=101 width=244)
...@@ -562,7 +562,7 @@ FROM tenk1 t1, onek t2 ...@@ -562,7 +562,7 @@ FROM tenk1 t1, onek t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------
Merge Join (cost=0.56..292.65 rows=10 width=488) Merge Join (cost=0.56..292.65 rows=10 width=488)
Merge Cond: (t1.unique2 = t2.unique2) Merge Cond: (t1.unique2 = t2.unique2)
-&gt; Index Scan using tenk1_unique2 on tenk1 t1 (cost=0.29..656.28 rows=101 width=244) -&gt; Index Scan using tenk1_unique2 on tenk1 t1 (cost=0.29..656.28 rows=101 width=244)
...@@ -596,7 +596,7 @@ FROM tenk1 t1, tenk2 t2 ...@@ -596,7 +596,7 @@ FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------------------------------------------------------------
Nested Loop (cost=4.65..118.62 rows=10 width=488) (actual time=0.128..0.377 rows=10 loops=1) Nested Loop (cost=4.65..118.62 rows=10 width=488) (actual time=0.128..0.377 rows=10 loops=1)
-&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244) (actual time=0.057..0.121 rows=10 loops=1) -&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244) (actual time=0.057..0.121 rows=10 loops=1)
Recheck Cond: (unique1 &lt; 10) Recheck Cond: (unique1 &lt; 10)
...@@ -640,7 +640,7 @@ FROM tenk1 t1, tenk2 t2 ...@@ -640,7 +640,7 @@ FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous; WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------------------------------------------------&zwsp;------
Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1) Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1)
Sort Key: t1.fivethous Sort Key: t1.fivethous
Sort Method: quicksort Memory: 77kB Sort Method: quicksort Memory: 77kB
...@@ -673,7 +673,7 @@ WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous; ...@@ -673,7 +673,7 @@ WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten &lt; 7; EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten &lt; 7;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------------------------------------
Seq Scan on tenk1 (cost=0.00..483.00 rows=7000 width=244) (actual time=0.016..5.107 rows=7000 loops=1) Seq Scan on tenk1 (cost=0.00..483.00 rows=7000 width=244) (actual time=0.016..5.107 rows=7000 loops=1)
Filter: (ten &lt; 7) Filter: (ten &lt; 7)
Rows Removed by Filter: 3000 Rows Removed by Filter: 3000
...@@ -696,7 +696,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten &lt; 7; ...@@ -696,7 +696,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten &lt; 7;
EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)'; EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)';
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------------------
Seq Scan on polygon_tbl (cost=0.00..1.05 rows=1 width=32) (actual time=0.044..0.044 rows=0 loops=1) Seq Scan on polygon_tbl (cost=0.00..1.05 rows=1 width=32) (actual time=0.044..0.044 rows=0 loops=1)
Filter: (f1 @&gt; '((0.5,2))'::polygon) Filter: (f1 @&gt; '((0.5,2))'::polygon)
Rows Removed by Filter: 4 Rows Removed by Filter: 4
...@@ -715,7 +715,7 @@ SET enable_seqscan TO off; ...@@ -715,7 +715,7 @@ SET enable_seqscan TO off;
EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)'; EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)';
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------------------------------------
Index Scan using gpolygonind on polygon_tbl (cost=0.13..8.15 rows=1 width=32) (actual time=0.062..0.062 rows=0 loops=1) Index Scan using gpolygonind on polygon_tbl (cost=0.13..8.15 rows=1 width=32) (actual time=0.062..0.062 rows=0 loops=1)
Index Cond: (f1 @&gt; '((0.5,2))'::polygon) Index Cond: (f1 @&gt; '((0.5,2))'::polygon)
Rows Removed by Index Recheck: 1 Rows Removed by Index Recheck: 1
...@@ -738,7 +738,7 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)'; ...@@ -738,7 +738,7 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)';
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000; EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------------------------------------------------------------
Bitmap Heap Scan on tenk1 (cost=25.08..60.21 rows=10 width=244) (actual time=0.323..0.342 rows=10 loops=1) Bitmap Heap Scan on tenk1 (cost=25.08..60.21 rows=10 width=244) (actual time=0.323..0.342 rows=10 loops=1)
Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000)) Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000))
Buffers: shared hit=15 Buffers: shared hit=15
...@@ -772,7 +772,7 @@ BEGIN; ...@@ -772,7 +772,7 @@ BEGIN;
EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 &lt; 100; EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 &lt; 100;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------------------------------------------
Update on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=14.628..14.628 rows=0 loops=1) Update on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=14.628..14.628 rows=0 loops=1)
-&gt; Bitmap Heap Scan on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=0.101..0.439 rows=100 loops=1) -&gt; Bitmap Heap Scan on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=0.101..0.439 rows=100 loops=1)
Recheck Cond: (unique1 &lt; 100) Recheck Cond: (unique1 &lt; 100)
...@@ -808,7 +808,7 @@ ROLLBACK; ...@@ -808,7 +808,7 @@ ROLLBACK;
<screen> <screen>
EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101;
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------------
Update on parent (cost=0.00..24.53 rows=4 width=14) Update on parent (cost=0.00..24.53 rows=4 width=14)
Update on parent Update on parent
Update on child1 Update on child1
...@@ -896,7 +896,7 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; ...@@ -896,7 +896,7 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101;
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2; EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------------------------------------------------------
Limit (cost=0.29..14.71 rows=2 width=244) (actual time=0.177..0.249 rows=2 loops=1) Limit (cost=0.29..14.71 rows=2 width=244) (actual time=0.177..0.249 rows=2 loops=1)
-&gt; Index Scan using tenk1_unique2 on tenk1 (cost=0.29..72.42 rows=10 width=244) (actual time=0.174..0.244 rows=2 loops=1) -&gt; Index Scan using tenk1_unique2 on tenk1 (cost=0.29..72.42 rows=10 width=244) (actual time=0.174..0.244 rows=2 loops=1)
Index Cond: (unique2 &gt; 9000) Index Cond: (unique2 &gt; 9000)
...@@ -1311,7 +1311,7 @@ ANALYZE zipcodes; ...@@ -1311,7 +1311,7 @@ ANALYZE zipcodes;
SELECT stxkeys AS k, stxdndistinct AS nd SELECT stxkeys AS k, stxdndistinct AS nd
FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid) FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid)
WHERE stxname = 'stts2'; WHERE stxname = 'stts2';
-[ RECORD 1 ]-------------------------------------------------------- -[ RECORD 1 ]------------------------------------------------------&zwsp;--
k | 1 2 5 k | 1 2 5
nd | {"1, 2": 33178, "1, 5": 33178, "2, 5": 27435, "1, 2, 5": 33178} nd | {"1, 2": 33178, "1, 5": 33178, "2, 5": 27435, "1, 2, 5": 33178}
(1 row) (1 row)
......
...@@ -653,31 +653,31 @@ bench=# \x ...@@ -653,31 +653,31 @@ bench=# \x
bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit / bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5; FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5;
-[ RECORD 1 ]---+-------------------------------------------------------------------- -[ RECORD 1 ]---+--------------------------------------------------&zwsp;------------------
query | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 query | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2
calls | 3000 calls | 3000
total_exec_time | 25565.855387 total_exec_time | 25565.855387
rows | 3000 rows | 3000
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 2 ]---+-------------------------------------------------------------------- -[ RECORD 2 ]---+--------------------------------------------------&zwsp;------------------
query | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 query | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
calls | 3000 calls | 3000
total_exec_time | 20756.669379 total_exec_time | 20756.669379
rows | 3000 rows | 3000
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 3 ]---+-------------------------------------------------------------------- -[ RECORD 3 ]---+--------------------------------------------------&zwsp;------------------
query | copy pgbench_accounts from stdin query | copy pgbench_accounts from stdin
calls | 1 calls | 1
total_exec_time | 291.865911 total_exec_time | 291.865911
rows | 100000 rows | 100000
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 4 ]---+-------------------------------------------------------------------- -[ RECORD 4 ]---+--------------------------------------------------&zwsp;------------------
query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2
calls | 3000 calls | 3000
total_exec_time | 271.232977 total_exec_time | 271.232977
rows | 3000 rows | 3000
hit_percent | 98.8454011741682975 hit_percent | 98.8454011741682975
-[ RECORD 5 ]---+-------------------------------------------------------------------- -[ RECORD 5 ]---+--------------------------------------------------&zwsp;------------------
query | alter table pgbench_accounts add primary key (aid) query | alter table pgbench_accounts add primary key (aid)
calls | 1 calls | 1
total_exec_time | 160.588563 total_exec_time | 160.588563
...@@ -691,31 +691,31 @@ bench=# SELECT pg_stat_statements_reset(0,0,s.queryid) FROM pg_stat_statements A ...@@ -691,31 +691,31 @@ bench=# SELECT pg_stat_statements_reset(0,0,s.queryid) FROM pg_stat_statements A
bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit / bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5; FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5;
-[ RECORD 1 ]---+-------------------------------------------------------------------- -[ RECORD 1 ]---+--------------------------------------------------&zwsp;------------------
query | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 query | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
calls | 3000 calls | 3000
total_exec_time | 20756.669379 total_exec_time | 20756.669379
rows | 3000 rows | 3000
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 2 ]---+-------------------------------------------------------------------- -[ RECORD 2 ]---+--------------------------------------------------&zwsp;------------------
query | copy pgbench_accounts from stdin query | copy pgbench_accounts from stdin
calls | 1 calls | 1
total_exec_time | 291.865911 total_exec_time | 291.865911
rows | 100000 rows | 100000
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 3 ]---+-------------------------------------------------------------------- -[ RECORD 3 ]---+--------------------------------------------------&zwsp;------------------
query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2
calls | 3000 calls | 3000
total_exec_time | 271.232977 total_exec_time | 271.232977
rows | 3000 rows | 3000
hit_percent | 98.8454011741682975 hit_percent | 98.8454011741682975
-[ RECORD 4 ]---+-------------------------------------------------------------------- -[ RECORD 4 ]---+--------------------------------------------------&zwsp;------------------
query | alter table pgbench_accounts add primary key (aid) query | alter table pgbench_accounts add primary key (aid)
calls | 1 calls | 1
total_exec_time | 160.588563 total_exec_time | 160.588563
rows | 0 rows | 0
hit_percent | 100.0000000000000000 hit_percent | 100.0000000000000000
-[ RECORD 5 ]---+-------------------------------------------------------------------- -[ RECORD 5 ]---+--------------------------------------------------&zwsp;------------------
query | vacuum analyze pgbench_accounts query | vacuum analyze pgbench_accounts
calls | 1 calls | 1
total_exec_time | 136.448116 total_exec_time | 136.448116
...@@ -727,13 +727,13 @@ bench=# SELECT pg_stat_statements_reset(0,0,0); ...@@ -727,13 +727,13 @@ bench=# SELECT pg_stat_statements_reset(0,0,0);
bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit / bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5; FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 5;
-[ RECORD 1 ]---+----------------------------------------------------------------------------- -[ RECORD 1 ]---+--------------------------------------------------&zwsp;---------------------------
query | SELECT pg_stat_statements_reset(0,0,0) query | SELECT pg_stat_statements_reset(0,0,0)
calls | 1 calls | 1
total_exec_time | 0.189497 total_exec_time | 0.189497
rows | 1 rows | 1
hit_percent | hit_percent |
-[ RECORD 2 ]---+----------------------------------------------------------------------------- -[ RECORD 2 ]---+--------------------------------------------------&zwsp;---------------------------
query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_hit / + query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_hit / +
| nullif(shared_blks_hit + shared_blks_read, $2) AS hit_percent+ | nullif(shared_blks_hit + shared_blks_read, $2) AS hit_percent+
| FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT $3 | FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT $3
......
...@@ -80,7 +80,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 'tenk1'; ...@@ -80,7 +80,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 'tenk1';
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------
Bitmap Heap Scan on tenk1 (cost=24.06..394.64 rows=1007 width=244) Bitmap Heap Scan on tenk1 (cost=24.06..394.64 rows=1007 width=244)
Recheck Cond: (unique1 &lt; 1000) Recheck Cond: (unique1 &lt; 1000)
-&gt; Bitmap Index Scan on tenk1_unique1 (cost=0.00..23.80 rows=1007 width=0) -&gt; Bitmap Index Scan on tenk1_unique1 (cost=0.00..23.80 rows=1007 width=0)
...@@ -160,8 +160,8 @@ WHERE tablename='tenk1' AND attname='stringu1'; ...@@ -160,8 +160,8 @@ WHERE tablename='tenk1' AND attname='stringu1';
null_frac | 0 null_frac | 0
n_distinct | 676 n_distinct | 676
most_common_vals | {EJAAAA,BBAAAA,CRAAAA,FCAAAA,FEAAAA,GSAAAA,JOAAAA,MCAAAA,NAAAAA,WGAAAA} most_common_vals | {EJAAAA,BBAAAA,CRAAAA,FCAAAA,FEAAAA,GSAAAA,&zwsp;JOAAAA,MCAAAA,NAAAAA,WGAAAA}
most_common_freqs | {0.00333333,0.003,0.003,0.003,0.003,0.003,0.003,0.003,0.003,0.003} most_common_freqs | {0.00333333,0.003,0.003,0.003,0.003,0.003,&zwsp;0.003,0.003,0.003,0.003}
</programlisting> </programlisting>
...@@ -261,8 +261,8 @@ SELECT histogram_bounds FROM pg_stats ...@@ -261,8 +261,8 @@ SELECT histogram_bounds FROM pg_stats
WHERE tablename='tenk1' AND attname='stringu1'; WHERE tablename='tenk1' AND attname='stringu1';
histogram_bounds histogram_bounds
-------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------
{AAAAAA,CQAAAA,FRAAAA,IBAAAA,KRAAAA,NFAAAA,PSAAAA,SGAAAA,VAAAAA,XLAAAA,ZZAAAA} {AAAAAA,CQAAAA,FRAAAA,IBAAAA,KRAAAA,NFAAAA,PSAAAA,SGAAAA,VAAAAA,&zwsp;XLAAAA,ZZAAAA}
</programlisting> </programlisting>
Checking the MCV list, we find that the condition <literal>stringu1 &lt; Checking the MCV list, we find that the condition <literal>stringu1 &lt;
...@@ -312,7 +312,7 @@ rows = 10000 * 0.307669 ...@@ -312,7 +312,7 @@ rows = 10000 * 0.307669
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000 AND stringu1 = 'xxx'; EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000 AND stringu1 = 'xxx';
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------
Bitmap Heap Scan on tenk1 (cost=23.80..396.91 rows=1 width=244) Bitmap Heap Scan on tenk1 (cost=23.80..396.91 rows=1 width=244)
Recheck Cond: (unique1 &lt; 1000) Recheck Cond: (unique1 &lt; 1000)
Filter: (stringu1 = 'xxx'::name) Filter: (stringu1 = 'xxx'::name)
...@@ -346,7 +346,7 @@ EXPLAIN SELECT * FROM tenk1 t1, tenk2 t2 ...@@ -346,7 +346,7 @@ EXPLAIN SELECT * FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 50 AND t1.unique2 = t2.unique2; WHERE t1.unique1 &lt; 50 AND t1.unique2 = t2.unique2;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------
Nested Loop (cost=4.64..456.23 rows=50 width=488) Nested Loop (cost=4.64..456.23 rows=50 width=488)
-&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.64..142.17 rows=50 width=244) -&gt; Bitmap Heap Scan on tenk1 t1 (cost=4.64..142.17 rows=50 width=244)
Recheck Cond: (unique1 &lt; 50) Recheck Cond: (unique1 &lt; 50)
...@@ -491,7 +491,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 't'; ...@@ -491,7 +491,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 't';
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------
Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1) Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1)
Filter: (a = 1) Filter: (a = 1)
Rows Removed by Filter: 9900 Rows Removed by Filter: 9900
...@@ -508,7 +508,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1; ...@@ -508,7 +508,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1) Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1)
Filter: ((a = 1) AND (b = 1)) Filter: ((a = 1) AND (b = 1))
Rows Removed by Filter: 9900 Rows Removed by Filter: 9900
...@@ -532,7 +532,7 @@ CREATE STATISTICS stts (dependencies) ON a, b FROM t; ...@@ -532,7 +532,7 @@ CREATE STATISTICS stts (dependencies) ON a, b FROM t;
ANALYZE t; ANALYZE t;
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1) Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
Filter: ((a = 1) AND (b = 1)) Filter: ((a = 1) AND (b = 1))
Rows Removed by Filter: 9900 Rows Removed by Filter: 9900
...@@ -553,7 +553,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; ...@@ -553,7 +553,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a; EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
QUERY PLAN QUERY PLAN
----------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;----------------------
HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1) HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1)
Group Key: a Group Key: a
-&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=4) (actual rows=10000 loops=1) -&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=4) (actual rows=10000 loops=1)
...@@ -564,7 +564,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a; ...@@ -564,7 +564,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------
HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1) HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1)
Group Key: a, b Group Key: a, b
-&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=8) (actual rows=10000 loops=1) -&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=8) (actual rows=10000 loops=1)
...@@ -577,7 +577,7 @@ CREATE STATISTICS stts (dependencies, ndistinct) ON a, b FROM t; ...@@ -577,7 +577,7 @@ CREATE STATISTICS stts (dependencies, ndistinct) ON a, b FROM t;
ANALYZE t; ANALYZE t;
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
QUERY PLAN QUERY PLAN
-------------------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;-------------------------
HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1) HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1)
Group Key: a, b Group Key: a, b
-&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=8) (actual rows=10000 loops=1) -&gt; Seq Scan on t (cost=0.00..145.00 rows=10000 width=8) (actual rows=10000 loops=1)
...@@ -617,7 +617,7 @@ CREATE STATISTICS stts2 (mcv) ON a, b FROM t; ...@@ -617,7 +617,7 @@ CREATE STATISTICS stts2 (mcv) ON a, b FROM t;
ANALYZE t; ANALYZE t;
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;------------
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1) Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
Filter: ((a = 1) AND (b = 1)) Filter: ((a = 1) AND (b = 1))
Rows Removed by Filter: 9900 Rows Removed by Filter: 9900
...@@ -674,7 +674,7 @@ SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid), ...@@ -674,7 +674,7 @@ SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1) Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1)
Filter: ((a = 1) AND (b = 10)) Filter: ((a = 1) AND (b = 10))
Rows Removed by Filter: 10000 Rows Removed by Filter: 10000
...@@ -687,7 +687,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10; ...@@ -687,7 +687,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10;
<programlisting> <programlisting>
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a &lt;= 49 AND b &gt; 49; EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a &lt;= 49 AND b &gt; 49;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--------
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1) Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1)
Filter: ((a &lt;= 49) AND (b &gt; 49)) Filter: ((a &lt;= 49) AND (b &gt; 49))
Rows Removed by Filter: 10000 Rows Removed by Filter: 10000
......
...@@ -420,7 +420,7 @@ EXPLAIN (COSTS FALSE) SELECT * FROM foo WHERE i = 4; ...@@ -420,7 +420,7 @@ EXPLAIN (COSTS FALSE) SELECT * FROM foo WHERE i = 4;
EXPLAIN SELECT sum(i) FROM foo WHERE i &lt; 10; EXPLAIN SELECT sum(i) FROM foo WHERE i &lt; 10;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------- -------------------------------------------------------------------&zwsp;--
Aggregate (cost=23.93..23.93 rows=1 width=4) Aggregate (cost=23.93..23.93 rows=1 width=4)
-&gt; Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4) -&gt; Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4)
Index Cond: (i &lt; 10) Index Cond: (i &lt; 10)
...@@ -440,7 +440,7 @@ PREPARE query(int, int) AS SELECT sum(bar) FROM test ...@@ -440,7 +440,7 @@ PREPARE query(int, int) AS SELECT sum(bar) FROM test
EXPLAIN ANALYZE EXECUTE query(100, 200); EXPLAIN ANALYZE EXECUTE query(100, 200);
QUERY PLAN QUERY PLAN
------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------------------------------------
HashAggregate (cost=9.54..9.54 rows=1 width=8) (actual time=0.156..0.161 rows=11 loops=1) HashAggregate (cost=9.54..9.54 rows=1 width=8) (actual time=0.156..0.161 rows=11 loops=1)
Group Key: foo Group Key: foo
-&gt; Index Scan using test_pkey on test (cost=0.29..9.29 rows=50 width=8) (actual time=0.039..0.091 rows=99 loops=1) -&gt; Index Scan using test_pkey on test (cost=0.29..9.29 rows=50 width=8) (actual time=0.039..0.091 rows=99 loops=1)
......
...@@ -362,7 +362,7 @@ mydb=# ...@@ -362,7 +362,7 @@ mydb=#
<screen> <screen>
<prompt>mydb=&gt;</prompt> <userinput>SELECT version();</userinput> <prompt>mydb=&gt;</prompt> <userinput>SELECT version();</userinput>
version version
------------------------------------------------------------------------------------------ -------------------------------------------------------------------&zwsp;-----------------------
PostgreSQL &version; on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit PostgreSQL &version; on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
(1 row) (1 row)
......
...@@ -2317,9 +2317,9 @@ SELECT ARRAY[]::integer[]; ...@@ -2317,9 +2317,9 @@ SELECT ARRAY[]::integer[];
bracketed) subquery. For example: bracketed) subquery. For example:
<programlisting> <programlisting>
SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE 'bytea%'); SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE 'bytea%');
array array
----------------------------------------------------------------------- ------------------------------------------------------------------
{2011,1954,1948,1952,1951,1244,1950,2005,1949,1953,2006,31,2412,2413} {2011,1954,1948,1952,1951,1244,1950,2005,1949,1953,2006,31,2412}
(1 row) (1 row)
SELECT ARRAY(SELECT ARRAY[i, i*2] FROM generate_series(1,5) AS a(i)); SELECT ARRAY(SELECT ARRAY[i, i*2] FROM generate_series(1,5) AS a(i));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment