diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index ad8e272..77f60ae 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -40,6 +40,7 @@
 #include <ctype.h>
 #include <math.h>
 #include <signal.h>
+#include <limits.h>
 
 #ifndef WIN32
 #include <sys/time.h>
@@ -175,6 +176,8 @@ int         progress_nclients = 0; /* number of clients for progress report */
 bool		is_connect;			/* establish connection for each transaction */
 bool		is_latencies;		/* report per-command latencies */
 int			main_pid;			/* main process id used in log filename */
+bool		use_gaussian = false;		/* use gaussian distribution benchmark */
+double		stdev_threshold = 5;		/* standard deviation threshold */
 
 char	   *pghost = "";
 char	   *pgport = "";
@@ -360,6 +363,7 @@ usage(void)
 		   "  -D, --define=VARNAME=VALUE\n"
 		   "                           define variable for use by custom script\n"
 		   "  -f, --file=FILENAME      read transaction script from FILENAME\n"
+		   "  -g, --gaussian=NUM       gaussian distribution benchmark with NUM standard deviation threshold\n"
 		   "  -j, --jobs=NUM           number of threads (default: 1)\n"
 		   "  -l, --log                write transaction times to log file\n"
 		   "  -M, --protocol=simple|extended|prepared\n"
@@ -471,7 +475,27 @@ getrand(TState *thread, int64 min, int64 max)
 	 * protected by a mutex, and therefore a bottleneck on machines with many
 	 * CPUs.
 	 */
-	return min + (int64) ((max - min + 1) * pg_erand48(thread->random_state));
+	double rand = pg_erand48(thread->random_state);
+	double rand1;
+	double rand2;
+	double stdev;
+
+	if(!use_gaussian)
+		return min + (int64) ((max - min + 1) * rand);
+
+	/* generate gaussian distribution */
+	rand1 = (rand * (LONG_MAX - 1.0) + 0.5) / LONG_MAX;
+	do
+	{
+		rand2 = pg_erand48(thread->random_state);
+		/* Box-Muller transform */
+		stdev = sqrt(-2.0 * log(rand1)) * sin(2.0 * M_PI * rand2);
+	}while( stdev < (-1.0 * stdev_threshold) || stdev > stdev_threshold);
+
+	/* normalization */
+	rand = (stdev + stdev_threshold) / (stdev_threshold * 2.0);
+
+	return min + (int64) (max - min + 1) * rand ;
 }
 
 /* call PQexec() and exit() on failure */
@@ -935,7 +959,7 @@ top:
 		 * a transaction, the next transaction will start right away.
 		 */
 		int64 wait = (int64)
-			throttle_delay * -log(getrand(thread, 1, 1000)/1000.0);
+			throttle_delay * - log((int64) ((pg_erand48(thread->random_state) * (LONG_MAX - 1.0) + 0.5) / LONG_MAX));
 
 		thread->throttle_trigger += wait;
 
@@ -2119,6 +2143,15 @@ printResults(int ttype, int normal_xacts, int nclients,
 
 	printf("transaction type: %s\n", s);
 	printf("scaling factor: %d\n", scale);
+	if(use_gaussian)
+	{
+		printf("standard deviation threshold: %.5f\n", stdev_threshold);
+		printf("access probability of top 20%%, 10%% and 5%% records: %.5f %.5f %.5f\n",
+			(double) ((erf (stdev_threshold * 0.2 / sqrt(2.0))) / (erf (stdev_threshold / sqrt(2.0)))),
+			(double) ((erf (stdev_threshold * 0.1 / sqrt(2.0))) / (erf (stdev_threshold / sqrt(2.0)))),
+			(double) ((erf (stdev_threshold * 0.05 / sqrt(2.0))) / (erf (stdev_threshold / sqrt(2.0))))
+			);
+	}
 	printf("query mode: %s\n", QUERYMODE[querymode]);
 	printf("number of clients: %d\n", nclients);
 	printf("number of threads: %d\n", nthreads);
@@ -2208,6 +2241,7 @@ main(int argc, char **argv)
 		{"define", required_argument, NULL, 'D'},
 		{"file", required_argument, NULL, 'f'},
 		{"fillfactor", required_argument, NULL, 'F'},
+		{"gaussian", required_argument, NULL, 'g'},
 		{"host", required_argument, NULL, 'h'},
 		{"initialize", no_argument, NULL, 'i'},
 		{"jobs", required_argument, NULL, 'j'},
@@ -2301,7 +2335,7 @@ main(int argc, char **argv)
 	state = (CState *) pg_malloc(sizeof(CState));
 	memset(state, 0, sizeof(CState));
 
-	while ((c = getopt_long(argc, argv, "ih:nvp:dqSNc:j:Crs:t:T:U:lf:D:F:M:P:R:", long_options, &optindex)) != -1)
+	while ((c = getopt_long(argc, argv, "ih:nvp:dqSNc:j:Crs:t:T:U:lf:g:D:F:M:P:R:", long_options, &optindex)) != -1)
 	{
 		switch (c)
 		{
@@ -2418,6 +2452,15 @@ main(int argc, char **argv)
 				if (process_file(filename) == false || *sql_files[num_files - 1] == NULL)
 					exit(1);
 				break;
+			case 'g':
+				use_gaussian = true;
+				stdev_threshold = atoi(optarg);
+				if(stdev_threshold < 2)
+				{
+					fprintf(stderr, "gaussian option (-g) must be more than 2: %f\n", stdev_threshold);
+					exit(1);
+				}
+				break;
 			case 'D':
 				{
 					char	   *p;
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml
index 49a79b1..5f7cb1e 100644
--- a/doc/src/sgml/pgbench.sgml
+++ b/doc/src/sgml/pgbench.sgml
@@ -320,6 +320,18 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
      </varlistentry>
 
      <varlistentry>
+      <term><option>-g</option> <replaceable>standard deviation</></term>
+      <term><option>--gaussian</option><replaceable>standard deviation</></term>
+      <listitem>
+       <para>
+        Gaussian distribution pgbench option. Need the standard deviation threshold.
+        If we set larger standard deviation threshold, pgbench access patern limited
+        more specific records. Min standard deviation threshold is 2.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry>
       <term><option>-j</option> <replaceable>threads</></term>
       <term><option>--jobs=</option><replaceable>threads</></term>
       <listitem>
