From b9362adab3bced778d54c4c83d6fdd9305ce52c7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 May 2011 12:25:50 +0000 Subject: [PATCH] idea --- src/datastore/perf_plugin_datastore.c | 2 +- src/datastore/selectrandom.sql | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/datastore/selectrandom.sql diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index c5ef9841d..7a8a0d4cf 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c @@ -37,7 +37,7 @@ * those take too long to run them in the usual "make check" * sequence. Hence the value used for shipping is tiny. */ -#define MAX_SIZE 1024LL * 1024 * 32 +#define MAX_SIZE 1024LL * 1024 * 16 #define ITERATIONS 2 diff --git a/src/datastore/selectrandom.sql b/src/datastore/selectrandom.sql new file mode 100644 index 000000000..82830a13a --- /dev/null +++ b/src/datastore/selectrandom.sql @@ -0,0 +1,9 @@ +select * +from (select random() as v from (values(1))) t1, + (select max(repl) as m from data) t2, + (select * from data + where repl=t2.m and + rnd>=t.v + order by rnd + limit 1) + -- 2.25.1