summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-06 12:25:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-06 12:25:50 +0000
commitb9362adab3bced778d54c4c83d6fdd9305ce52c7 (patch)
treef868c9f1263d3f301ab9fedbff9f1d5fe8b8419f /src
parentf9e4b3c6a514c33aa4301e49723cc52757a254e1 (diff)
idea
Diffstat (limited to 'src')
-rw-r--r--src/datastore/perf_plugin_datastore.c2
-rw-r--r--src/datastore/selectrandom.sql9
2 files changed, 10 insertions, 1 deletions
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)
+