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
This commit is contained in:
parent
5cbfce562f
commit
3d14c174cb
|
@ -131,7 +131,7 @@ CREATE INDEX
|
|||
<programlisting>
|
||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||
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)
|
||||
Filter: ((i2 = 898732) AND (i5 = 123451))
|
||||
Rows Removed by Filter: 10000000
|
||||
|
@ -147,7 +147,7 @@ CREATE INDEX
|
|||
<programlisting>
|
||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||
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 Cond: ((i2 = 898732) AND (i5 = 123451))
|
||||
Heap Fetches: 0
|
||||
|
@ -162,7 +162,7 @@ CREATE INDEX
|
|||
<programlisting>
|
||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||
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)
|
||||
Recheck Cond: ((i2 = 898732) AND (i5 = 123451))
|
||||
Rows Removed by Index Recheck: 2439
|
||||
|
@ -189,7 +189,7 @@ CREATE INDEX
|
|||
<programlisting>
|
||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||
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)
|
||||
Recheck Cond: ((i5 = 123451) AND (i2 = 898732))
|
||||
-> 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;
|
|||
<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;
|
||||
tsvector
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------
|
||||
'a':1,6,10 'and':8 'ate':9 'cat':3 'fat':2,11 'mat':7 'on':5 'rat':12 'sat':4
|
||||
</programlisting>
|
||||
|
||||
|
|
|
@ -4537,7 +4537,7 @@ SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01';
|
|||
SET enable_partition_pruning = off;
|
||||
EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01';
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------------
|
||||
Aggregate (cost=188.76..188.77 rows=1 width=8)
|
||||
-> Append (cost=0.00..181.05 rows=3085 width=0)
|
||||
-> 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 >= DATE '2008-01-01';
|
|||
SET enable_partition_pruning = on;
|
||||
EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01';
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------------
|
||||
Aggregate (cost=37.75..37.76 rows=1 width=8)
|
||||
-> Seq Scan on measurement_y2008m01 (cost=0.00..33.12 rows=617 width=0)
|
||||
Filter: (logdate >= '2008-01-01'::date)
|
||||
|
|
|
@ -147,7 +147,7 @@
|
|||
<screen>
|
||||
=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------------------------------
|
||||
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)
|
||||
Planning Time: 0.116 ms
|
||||
|
@ -163,7 +163,7 @@
|
|||
SET
|
||||
=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------------------------------
|
||||
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)
|
||||
Planning Time: 0.133 ms
|
||||
|
|
|
@ -788,14 +788,14 @@ test=# SELECT * FROM hash_bitmap_info('con_hash_index', 2052);
|
|||
<listitem>
|
||||
<para>
|
||||
<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>
|
||||
test=# SELECT magic, version, ntuples, ffactor, bsize, bmsize, bmshift,
|
||||
test-# maxbucket, highmask, lowmask, ovflpoint, firstfree, nmaps, procid,
|
||||
test-# regexp_replace(spares::text, '(,0)*}', '}') as spares,
|
||||
test-# regexp_replace(mapp::text, '(,0)*}', '}') as mapp
|
||||
test-# FROM hash_metapage_info(get_raw_page('con_hash_index', 0));
|
||||
-[ RECORD 1 ]-------------------------------------------------------------------------------
|
||||
-[ RECORD 1 ]-------------------------------------------------&zwsp;------------------------------
|
||||
magic | 105121344
|
||||
version | 4
|
||||
ntuples | 500500
|
||||
|
@ -810,7 +810,7 @@ ovflpoint | 28
|
|||
firstfree | 1204
|
||||
nmaps | 1
|
||||
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}
|
||||
</screen>
|
||||
</para>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<screen>
|
||||
EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------
|
||||
Gather (cost=1000.00..217018.43 rows=1 width=97)
|
||||
Workers Planned: 2
|
||||
-> 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 < 7000;
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100;
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------
|
||||
Bitmap Heap Scan on tenk1 (cost=5.07..229.20 rows=101 width=244)
|
||||
Recheck Cond: (unique1 < 100)
|
||||
-> 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 < 100;
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND stringu1 = 'xxx';
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------
|
||||
Bitmap Heap Scan on tenk1 (cost=5.04..229.43 rows=1 width=244)
|
||||
Recheck Cond: (unique1 < 100)
|
||||
Filter: (stringu1 = 'xxx'::name)
|
||||
|
@ -280,7 +280,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND stringu1 = 'xxx';
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 = 42;
|
||||
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------
|
||||
Index Scan using tenk1_unique1 on tenk1 (cost=0.29..8.30 rows=1 width=244)
|
||||
Index Cond: (unique1 = 42)
|
||||
</screen>
|
||||
|
@ -318,7 +318,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY unique1;
|
|||
<screen>
|
||||
EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100;
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------------------
|
||||
Limit (cost=521.06..538.05 rows=100 width=244)
|
||||
-> Incremental Sort (cost=521.06..2220.95 rows=10000 width=244)
|
||||
Sort Key: four, ten
|
||||
|
@ -343,7 +343,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY four, ten LIMIT 100;
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000;
|
||||
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------
|
||||
Bitmap Heap Scan on tenk1 (cost=25.08..60.21 rows=10 width=244)
|
||||
Recheck Cond: ((unique1 < 100) AND (unique2 > 9000))
|
||||
-> BitmapAnd (cost=25.08..25.08 rows=10 width=0)
|
||||
|
@ -366,7 +366,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000;
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 LIMIT 2;
|
||||
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------
|
||||
Limit (cost=0.29..14.48 rows=2 width=244)
|
||||
-> Index Scan using tenk1_unique2 on tenk1 (cost=0.29..71.27 rows=10 width=244)
|
||||
Index Cond: (unique2 > 9000)
|
||||
|
@ -396,7 +396,7 @@ FROM tenk1 t1, tenk2 t2
|
|||
WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------------
|
||||
Nested Loop (cost=4.65..118.62 rows=10 width=488)
|
||||
-> Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244)
|
||||
Recheck Cond: (unique1 < 10)
|
||||
|
@ -445,7 +445,7 @@ FROM tenk1 t1, tenk2 t2
|
|||
WHERE t1.unique1 < 10 AND t2.unique2 < 10 AND t1.hundred < t2.hundred;
|
||||
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;--------------------------
|
||||
Nested Loop (cost=4.65..49.46 rows=33 width=488)
|
||||
Join Filter: (t1.hundred < t2.hundred)
|
||||
-> Bitmap Heap Scan on tenk1 t1 (cost=4.36..39.47 rows=10 width=244)
|
||||
|
@ -493,7 +493,7 @@ FROM tenk1 t1, tenk2 t2
|
|||
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------
|
||||
Hash Join (cost=230.47..713.98 rows=101 width=488)
|
||||
Hash Cond: (t2.unique2 = t1.unique2)
|
||||
-> Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244)
|
||||
|
@ -524,7 +524,7 @@ FROM tenk1 t1, onek t2
|
|||
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------
|
||||
Merge Join (cost=198.11..268.19 rows=10 width=488)
|
||||
Merge Cond: (t1.unique2 = t2.unique2)
|
||||
-> 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
|
|||
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------
|
||||
Merge Join (cost=0.56..292.65 rows=10 width=488)
|
||||
Merge Cond: (t1.unique2 = t2.unique2)
|
||||
-> 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
|
|||
WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;--------------------------------------------------------------
|
||||
Nested Loop (cost=4.65..118.62 rows=10 width=488) (actual time=0.128..0.377 rows=10 loops=1)
|
||||
-> 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 < 10)
|
||||
|
@ -640,7 +640,7 @@ FROM tenk1 t1, tenk2 t2
|
|||
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
|
||||
|
||||
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 Key: t1.fivethous
|
||||
Sort Method: quicksort Memory: 77kB
|
||||
|
@ -673,7 +673,7 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
|
|||
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten < 7;
|
||||
|
||||
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)
|
||||
Filter: (ten < 7)
|
||||
Rows Removed by Filter: 3000
|
||||
|
@ -696,7 +696,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten < 7;
|
|||
EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)';
|
||||
|
||||
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)
|
||||
Filter: (f1 @> '((0.5,2))'::polygon)
|
||||
Rows Removed by Filter: 4
|
||||
|
@ -715,7 +715,7 @@ SET enable_seqscan TO off;
|
|||
EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)';
|
||||
|
||||
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 Cond: (f1 @> '((0.5,2))'::polygon)
|
||||
Rows Removed by Index Recheck: 1
|
||||
|
@ -738,7 +738,7 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)';
|
|||
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000;
|
||||
|
||||
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)
|
||||
Recheck Cond: ((unique1 < 100) AND (unique2 > 9000))
|
||||
Buffers: shared hit=15
|
||||
|
@ -772,7 +772,7 @@ BEGIN;
|
|||
EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 < 100;
|
||||
|
||||
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)
|
||||
-> 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 < 100)
|
||||
|
@ -808,7 +808,7 @@ ROLLBACK;
|
|||
<screen>
|
||||
EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------------
|
||||
Update on parent (cost=0.00..24.53 rows=4 width=14)
|
||||
Update on parent
|
||||
Update on child1
|
||||
|
@ -896,7 +896,7 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101;
|
|||
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 LIMIT 2;
|
||||
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------------------------------------------------------
|
||||
Limit (cost=0.29..14.71 rows=2 width=244) (actual time=0.177..0.249 rows=2 loops=1)
|
||||
-> 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 > 9000)
|
||||
|
@ -1311,7 +1311,7 @@ ANALYZE zipcodes;
|
|||
SELECT stxkeys AS k, stxdndistinct AS nd
|
||||
FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid)
|
||||
WHERE stxname = 'stts2';
|
||||
-[ RECORD 1 ]--------------------------------------------------------
|
||||
-[ RECORD 1 ]------------------------------------------------------&zwsp;--
|
||||
k | 1 2 5
|
||||
nd | {"1, 2": 33178, "1, 5": 33178, "2, 5": 27435, "1, 2, 5": 33178}
|
||||
(1 row)
|
||||
|
|
|
@ -653,31 +653,31 @@ bench=# \x
|
|||
bench=# SELECT query, calls, total_exec_time, rows, 100.0 * shared_blks_hit /
|
||||
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
|
||||
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
|
||||
calls | 3000
|
||||
total_exec_time | 25565.855387
|
||||
rows | 3000
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 2 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 2 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2
|
||||
calls | 3000
|
||||
total_exec_time | 20756.669379
|
||||
rows | 3000
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 3 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 3 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | copy pgbench_accounts from stdin
|
||||
calls | 1
|
||||
total_exec_time | 291.865911
|
||||
rows | 100000
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 4 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 4 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2
|
||||
calls | 3000
|
||||
total_exec_time | 271.232977
|
||||
rows | 3000
|
||||
hit_percent | 98.8454011741682975
|
||||
-[ RECORD 5 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 5 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | alter table pgbench_accounts add primary key (aid)
|
||||
calls | 1
|
||||
total_exec_time | 160.588563
|
||||
|
@ -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 /
|
||||
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
|
||||
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
|
||||
calls | 3000
|
||||
total_exec_time | 20756.669379
|
||||
rows | 3000
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 2 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 2 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | copy pgbench_accounts from stdin
|
||||
calls | 1
|
||||
total_exec_time | 291.865911
|
||||
rows | 100000
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 3 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 3 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2
|
||||
calls | 3000
|
||||
total_exec_time | 271.232977
|
||||
rows | 3000
|
||||
hit_percent | 98.8454011741682975
|
||||
-[ RECORD 4 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 4 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | alter table pgbench_accounts add primary key (aid)
|
||||
calls | 1
|
||||
total_exec_time | 160.588563
|
||||
rows | 0
|
||||
hit_percent | 100.0000000000000000
|
||||
-[ RECORD 5 ]---+--------------------------------------------------------------------
|
||||
-[ RECORD 5 ]---+--------------------------------------------------&zwsp;------------------
|
||||
query | vacuum analyze pgbench_accounts
|
||||
calls | 1
|
||||
total_exec_time | 136.448116
|
||||
|
@ -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 /
|
||||
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
|
||||
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)
|
||||
calls | 1
|
||||
total_exec_time | 0.189497
|
||||
rows | 1
|
||||
hit_percent |
|
||||
-[ RECORD 2 ]---+-----------------------------------------------------------------------------
|
||||
-[ RECORD 2 ]---+--------------------------------------------------&zwsp;---------------------------
|
||||
query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_hit / +
|
||||
| nullif(shared_blks_hit + shared_blks_read, $2) AS hit_percent+
|
||||
| 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';
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 1000;
|
||||
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------
|
||||
Bitmap Heap Scan on tenk1 (cost=24.06..394.64 rows=1007 width=244)
|
||||
Recheck Cond: (unique1 < 1000)
|
||||
-> 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';
|
|||
|
||||
null_frac | 0
|
||||
n_distinct | 676
|
||||
most_common_vals | {EJAAAA,BBAAAA,CRAAAA,FCAAAA,FEAAAA,GSAAAA,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_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,&zwsp;0.003,0.003,0.003,0.003}
|
||||
|
||||
</programlisting>
|
||||
|
||||
|
@ -261,8 +261,8 @@ SELECT histogram_bounds FROM pg_stats
|
|||
WHERE tablename='tenk1' AND attname='stringu1';
|
||||
|
||||
histogram_bounds
|
||||
--------------------------------------------------------------------------------
|
||||
{AAAAAA,CQAAAA,FRAAAA,IBAAAA,KRAAAA,NFAAAA,PSAAAA,SGAAAA,VAAAAA,XLAAAA,ZZAAAA}
|
||||
-------------------------------------------------------------------&zwsp;-------------
|
||||
{AAAAAA,CQAAAA,FRAAAA,IBAAAA,KRAAAA,NFAAAA,PSAAAA,SGAAAA,VAAAAA,&zwsp;XLAAAA,ZZAAAA}
|
||||
</programlisting>
|
||||
|
||||
Checking the MCV list, we find that the condition <literal>stringu1 <
|
||||
|
@ -312,7 +312,7 @@ rows = 10000 * 0.307669
|
|||
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 1000 AND stringu1 = 'xxx';
|
||||
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------
|
||||
Bitmap Heap Scan on tenk1 (cost=23.80..396.91 rows=1 width=244)
|
||||
Recheck Cond: (unique1 < 1000)
|
||||
Filter: (stringu1 = 'xxx'::name)
|
||||
|
@ -346,7 +346,7 @@ EXPLAIN SELECT * FROM tenk1 t1, tenk2 t2
|
|||
WHERE t1.unique1 < 50 AND t1.unique2 = t2.unique2;
|
||||
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------------
|
||||
Nested Loop (cost=4.64..456.23 rows=50 width=488)
|
||||
-> Bitmap Heap Scan on tenk1 t1 (cost=4.64..142.17 rows=50 width=244)
|
||||
Recheck Cond: (unique1 < 50)
|
||||
|
@ -491,7 +491,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 't';
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------
|
||||
Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1)
|
||||
Filter: (a = 1)
|
||||
Rows Removed by Filter: 9900
|
||||
|
@ -508,7 +508,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------
|
||||
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1)
|
||||
Filter: ((a = 1) AND (b = 1))
|
||||
Rows Removed by Filter: 9900
|
||||
|
@ -532,7 +532,7 @@ CREATE STATISTICS stts (dependencies) ON a, b FROM t;
|
|||
ANALYZE t;
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------
|
||||
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
|
||||
Filter: ((a = 1) AND (b = 1))
|
||||
Rows Removed by Filter: 9900
|
||||
|
@ -553,7 +553,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;----------------------
|
||||
HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1)
|
||||
Group Key: a
|
||||
-> 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;
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------------------
|
||||
HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1)
|
||||
Group Key: a, b
|
||||
-> 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;
|
|||
ANALYZE t;
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-------------------------
|
||||
HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1)
|
||||
Group Key: a, b
|
||||
-> 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;
|
|||
ANALYZE t;
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;------------
|
||||
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
|
||||
Filter: ((a = 1) AND (b = 1))
|
||||
Rows Removed by Filter: 9900
|
||||
|
@ -674,7 +674,7 @@ SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10;
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;--------
|
||||
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1)
|
||||
Filter: ((a = 1) AND (b = 10))
|
||||
Rows Removed by Filter: 10000
|
||||
|
@ -687,7 +687,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10;
|
|||
<programlisting>
|
||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a <= 49 AND b > 49;
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;--------
|
||||
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1)
|
||||
Filter: ((a <= 49) AND (b > 49))
|
||||
Rows Removed by Filter: 10000
|
||||
|
|
|
@ -420,7 +420,7 @@ EXPLAIN (COSTS FALSE) SELECT * FROM foo WHERE i = 4;
|
|||
EXPLAIN SELECT sum(i) FROM foo WHERE i < 10;
|
||||
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;--
|
||||
Aggregate (cost=23.93..23.93 rows=1 width=4)
|
||||
-> Index Scan using fi on foo (cost=0.00..23.92 rows=6 width=4)
|
||||
Index Cond: (i < 10)
|
||||
|
@ -440,7 +440,7 @@ PREPARE query(int, int) AS SELECT sum(bar) FROM test
|
|||
EXPLAIN ANALYZE EXECUTE query(100, 200);
|
||||
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------------------------------------
|
||||
HashAggregate (cost=9.54..9.54 rows=1 width=8) (actual time=0.156..0.161 rows=11 loops=1)
|
||||
Group Key: foo
|
||||
-> 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=#
|
|||
<screen>
|
||||
<prompt>mydb=></prompt> <userinput>SELECT version();</userinput>
|
||||
version
|
||||
------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------&zwsp;-----------------------
|
||||
PostgreSQL &version; on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
|
||||
(1 row)
|
||||
|
||||
|
|
|
@ -2317,9 +2317,9 @@ SELECT ARRAY[]::integer[];
|
|||
bracketed) subquery. For example:
|
||||
<programlisting>
|
||||
SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE 'bytea%');
|
||||
array
|
||||
-----------------------------------------------------------------------
|
||||
{2011,1954,1948,1952,1951,1244,1950,2005,1949,1953,2006,31,2412,2413}
|
||||
array
|
||||
------------------------------------------------------------------
|
||||
{2011,1954,1948,1952,1951,1244,1950,2005,1949,1953,2006,31,2412}
|
||||
(1 row)
|
||||
|
||||
SELECT ARRAY(SELECT ARRAY[i, i*2] FROM generate_series(1,5) AS a(i));
|
||||
|
|
Loading…
Reference in New Issue