idea
authorChristian Grothoff <christian@grothoff.org>
Fri, 6 May 2011 12:25:50 +0000 (12:25 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 6 May 2011 12:25:50 +0000 (12:25 +0000)
src/datastore/perf_plugin_datastore.c
src/datastore/selectrandom.sql [new file with mode: 0644]

index c5ef9841d89abd8debbf0057125b20db07703e57..7a8a0d4cf9cdfcd85cd0b0dc7bfd428fbda6b24c 100644 (file)
@@ -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 (file)
index 0000000..82830a1
--- /dev/null
@@ -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)
+