postgresql/contrib
Tatsuo Ishii 3da0dfb4b1 Multi-threaded version of pgbench contributed by ITAGAKI Takahiro,
reviewed by Greg Smith and Josh Williams.

Following is the proposal from ITAGAKI Takahiro:

Pgbench is a famous tool to measure postgres performance, but nowadays
it does not work well because it cannot use multiple CPUs. On the other
hand, postgres server can use CPUs very well, so the bottle-neck of
workload is *in pgbench*.

Multi-threading would be a solution. The attached patch adds -j
(number of jobs) option to pgbench. If the value N is greater than 1,
pgbench runs with N threads. Connections are equally-divided into
them (ex. -c64 -j4 => 4 threads with 16 connections each). It can
run on POSIX platforms with pthread and on Windows with win32 threads.

Here are results of multi-threaded pgbench runs on Fedora 11 with intel
core i7 (8 logical cores = 4 physical cores * HT). -j8 (8 threads) was
the best and the tps is 4.5 times of -j1, that is a traditional result.

$ pgbench -i -s10
$ pgbench -n -S -c64 -j1   =>  tps = 11600.158593
$ pgbench -n -S -c64 -j2   =>  tps = 17947.100954
$ pgbench -n -S -c64 -j4   =>  tps = 26571.124001
$ pgbench -n -S -c64 -j8   =>  tps = 52725.470403
$ pgbench -n -S -c64 -j16  =>  tps = 38976.675319
$ pgbench -n -S -c64 -j32  =>  tps = 28998.499601
$ pgbench -n -S -c64 -j64  =>  tps = 26701.877815

Is it acceptable to use pthread in contrib module?
If ok, I will add the patch to the next commitfest.
2009-08-03 15:18:14 +00:00
..
adminpack Update copyright for 2009. 2009-01-01 17:24:05 +00:00
auto_explain Extend EXPLAIN to allow generic options to be specified. 2009-07-26 23:34:18 +00:00
btree_gin 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_gist Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
chkpass 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
citext Improve unique-constraint-violation error messages to include the exact 2009-08-01 19:59:41 +00:00
cube Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
dblink 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
dict_int 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
dict_xsyn Update copyright for 2009. 2009-01-01 17:24:05 +00:00
earthdistance 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
fuzzystrmatch 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
hstore Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
intagg Reduce contrib/intagg to a thin wrapper around the new core functions 2008-11-14 19:58:45 +00:00
intarray Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
isn 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
lo
ltree Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
oid2name 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pageinspect 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pg_buffercache 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pg_freespacemap 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pg_standby pg_standby doesn't need to be linked with libpq. Fujii Masao. 2009-07-16 09:59:46 +00:00
pg_stat_statements Improve comment, per gripe from Alvaro. 2009-07-27 04:09:55 +00:00
pg_trgm Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
pgbench Multi-threaded version of pgbench contributed by ITAGAKI Takahiro, 2009-08-03 15:18:14 +00:00
pgcrypto 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pgrowlocks 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
pgstattuple 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
seg Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
spi 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
sslinfo Fix old bug in contrib/sslinfo: X509_NAME_to_text freed the BIO_s_mem buffer 2008-11-10 14:57:38 +00:00
start-scripts
tablefunc 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
test_parser 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
tsearch2 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
uuid-ossp 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
vacuumlo vacuumlo query cleanups 2009-07-13 22:56:30 +00:00
xml2 Fix xslt_process() to ensure that it inserts a NULL terminator after the 2009-07-10 00:32:00 +00:00
contrib-global.mk
Makefile Add btree_gin contrib module. 2009-03-25 23:20:01 +00:00
README Add btree_gin contrib module. 2009-03-25 23:20:01 +00:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly because
they address a limited audience or are too experimental to be part of
the main source tree.  This does not preclude their usefulness.

User documentation for each module appears in the main SGML documentation.

Most items can be built with `gmake all' and installed with
`gmake install' in the usual fashion, after you have run the `configure'
script in the top-level directory.  Some directories supply new
user-defined functions, operators, or types.  In these cases, after you have
installed the files you need to register the new entities in the database
system by running the commands in the supplied .sql file.  For example,

	$ psql -d dbname -f module.sql

See the PostgreSQL documentation for more information about this
procedure.


Index:
------

adminpack -
	File and log manipulation routines, used by pgAdmin
	by Dave Page <dpage@vale-housing.co.uk>

auto_explain -
	Log EXPLAIN output for long-running queries
	by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

btree_gin -
	Support for emulating BTREE indexing in GIN
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

btree_gist -
	Support for emulating BTREE indexing in GiST
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

chkpass -
	An auto-encrypted password datatype
	by D'Arcy J.M. Cain <darcy@druid.net>

citext -
	A case-insensitive character string datatype
	by David E. Wheeler <david@kineticode.com>

cube -
	Multidimensional-cube datatype (GiST indexing example)
	by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>

dblink -
	Allows remote query execution
	by Joe Conway <mail@joeconway.com>

dict_int -
	Text search dictionary template for integers
	by Sergey Karpov <karpov@sao.ru>

dict_xsyn -
	Text search dictionary template for extended synonym processing
	by Sergey Karpov <karpov@sao.ru>

earthdistance -
	Functions for computing distances between two points on Earth
        by Bruno Wolff III <bruno@wolff.to> and Hal Snyder <hal@vailsys.com>

fuzzystrmatch -
	Levenshtein, metaphone, and soundex fuzzy string matching
	by Joe Conway <mail@joeconway.com> and Joel Burton <jburton@scw.org>

hstore -
	Module for storing (key, value) pairs
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

intagg -
	Integer aggregator
	by mlw <markw@mohawksoft.com>

intarray -
	Index support for arrays of int4, using GiST
	by Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>

isn -
	PostgreSQL type extensions for ISBN, ISSN, ISMN, EAN13 product numbers
	by Germ<72>n M<>ndez Bravo (Kronuz) <kronuz@hotmail.com>

lo -
	Large Object maintenance
	by Peter Mount <peter@retep.org.uk> 

ltree -
	Tree-like data structures
	by Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>

oid2name - 
	Maps numeric files to table names
	by B Palmer <bpalmer@crimelabs.net>

pageinspect -
	Allows inspection of database pages
	Heikki Linnakangas <heikki@enterprisedb.com>

pg_buffercache -
	Real time queries on the shared buffer cache
	by Mark Kirkwood <markir@paradise.net.nz>

pg_freespacemap -
	Displays the contents of the free space map (FSM)
	by Mark Kirkwood <markir@paradise.net.nz>

pg_standby -
	Sample archive_command for warm standby operation
	by Simon Riggs <simon@2ndquadrant.com>

pg_stat_statements -
	Track statement execution times across a whole database cluster
	by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

pg_trgm -
	Functions for determining the similarity of text based on trigram
	matching.
	by Oleg Bartunov <oleg@sai.msu.su> and Teodor Sigaev <teodor@sigaev.ru>

pgbench -
	TPC-B like benchmarking tool
	by Tatsuo Ishii <ishii@sraoss.co.jp>

pgcrypto -
	Cryptographic functions
	by Marko Kreen <marko@l-t.ee>

pgrowlocks -
	A function to return row locking information
	by Tatsuo Ishii <ishii@sraoss.co.jp>

pgstattuple -
	Functions to return statistics about "dead" tuples and free
	space within a table
	by Tatsuo Ishii <ishii@sraoss.co.jp>

seg -
	Confidence-interval datatype (GiST indexing example)
	by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>

spi -
	Various trigger functions, examples for using SPI.

sslinfo -
	Functions to get information about SSL certificates
	by Victor Wagner <vitus@cryptocom.ru>

start-scripts - 
	Scripts for starting the server at boot time on various platforms.

tablefunc -
	Examples of functions returning tables
	by Joe Conway <mail@joeconway.com>

test_parser -
	Sample text search parser
	by Sergey Karpov <karpov@sao.ru>

tsearch2 -
	Compatibility package for the pre-8.3 implementation of text search.
	Pavel Stehule <pavel.stehule@gmail.com>, based on code originally by
	Teodor Sigaev <teodor@sigaev.ru> and Oleg Bartunov <oleg@sai.msu.su>.

uuid-ossp -
	UUID generation functions
	by Peter Eisentraut <peter_e@gmx.net>

vacuumlo -
	Remove orphaned large objects
	by Peter T Mount <peter@retep.org.uk>

xml2 -
	Storing XML in PostgreSQL
	by John Gray <jgray@azuli.co.uk>