public inbox for [email protected]
help / color / mirror / Atom feed[PATCH 08/10] Default to zstd..
15+ messages / 4 participants
[nested] [flat]
* [PATCH 08/10] Default to zstd..
@ 2021-03-12 21:35 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 15+ messages in thread
From: Justin Pryzby @ 2021-03-12 21:35 UTC (permalink / raw)
for CI, not for merge
---
configure | 6 ++++--
configure.ac | 2 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/utils/misc/guc.c | 2 +-
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 81e23418b2..253f028fc4 100755
--- a/configure
+++ b/configure
@@ -1582,7 +1582,7 @@ Optional Packages:
use system time zone data in DIR
--without-zlib do not use Zlib
--without-lz4 build without LZ4 support
- --with-zstd build with Zstd compression library
+ --without-zstd build without Zstd compression library
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-ssl=LIB use LIB for SSL/TLS support (openssl)
--with-openssl obsolete spelling of --with-ssl=openssl
@@ -8740,7 +8740,9 @@ $as_echo "#define USE_ZSTD 1" >>confdefs.h
esac
else
- with_zstd=no
+ with_zstd=yes
+
+$as_echo "#define USE_ZSTD 1" >>confdefs.h
fi
diff --git a/configure.ac b/configure.ac
index d6f6349067..8d72710fa7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1005,7 +1005,7 @@ fi
# ZSTD
#
AC_MSG_CHECKING([whether to build with zstd support])
-PGAC_ARG_BOOL(with, zstd, no, [build with Zstd compression library],
+PGAC_ARG_BOOL(with, zstd, yes, [build without Zstd compression library],
[AC_DEFINE([USE_ZSTD], 1, [Define to 1 to build with zstd support. (--with-zstd)])])
AC_MSG_RESULT([$with_zstd])
AC_SUBST(with_zstd)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 307eee6626..92023de9f5 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -99,7 +99,7 @@ bool EnableHotStandby = false;
bool fullPageWrites = true;
bool wal_log_hints = false;
bool wal_compression = false;
-int wal_compression_method = WAL_COMPRESSION_LZ4;
+int wal_compression_method = WAL_COMPRESSION_ZSTD;
char *wal_consistency_checking_string = NULL;
bool *wal_consistency_checking = NULL;
bool wal_init_zero = true;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 52f9cd0242..8031e027aa 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4728,7 +4728,7 @@ static struct config_enum ConfigureNamesEnum[] =
NULL
},
&wal_compression_method,
- WAL_COMPRESSION_LZ4, wal_compression_options,
+ WAL_COMPRESSION_ZSTD, wal_compression_options,
NULL, NULL, NULL
},
--
2.17.0
--XsQoSWH+UP9D9v3l
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="0009-Add-zstd-compression-levels.patch"
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-01-19 02:39 John Naylor <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-01-19 02:39 UTC (permalink / raw)
To: Thomas Munro <[email protected]>; +Cc: pgsql-hackers
I wrote:
> That said, I think what I'll do next is test the v3-0001 standalone
> patch with tuplesort specializations for more data types. I already
> have a decent test script that I can build on for this.
I've run a test with 10 million records using all types found in the
v3 patch "accelerate tuple sorting for common types", using a variety
of initial orderings, covering index build (btree only, no gist) and
queries (both single value and whole record). Attached is the test
script and a spreadsheet with the raw data as well as comparisons of
the min runtimes in seconds from 5 runs. This is using gcc 11.1 on
fairly recent Intel hardware.
Overall, this shows a good improvement for these types. One exception
is the "0/1" ordering, which is two values in random order. I'm
guessing it's because of the cardinality detector, but some runs have
apparent possible regressions. It's a bit high and sporadic to just
blow off as noise, but this case might not be telling us anything
useful.
Other notes:
- The inet type seems unnaturally fast in some places, meaning faster
than int or date. That's suspicous, but I haven't yet dug deeper into
that.
- With the patch, the VM binary size increases by ~9kB.
I have some hunches on the "future research" comments:
XXX Can we avoid repeating the null-handling logic?
More templating? ;-)
XXX Is it worth specializing for reverse sort?
I'll run a limited test on DESC to see if anything stands out, but I
wonder if the use case is not common -- I seem to remember seeing DESC
less often on the first sort key column.
XXX Is it worth specializing for nulls first, nulls last, not null?
Editorializing the null position in queries is not very common in my
experience. Not null is interesting since it'd be trivial to pass
constant false to the same Apply[XYZ]SortComparator() and let the
compiler remove all those branches for us. On the other hand, those
branches would be otherwise predicted well, so it might make little or
no difference.
XXX Should we have separate cases for "result is authoritative", "need
XXX tiebreaker for atts 1..n (= abbrev case)", "need tie breaker for
XXX atts 2..n"?
The first one seems to be the only case where the SortTuple could be
smaller, since the tuple pointer is null. That sounds like a good
avenue to explore. Less memory usage is always good.
Not sure what you mean by the third case -- there are 2+ sort keys,
but the first is authoritative from the datum, so the full comparison
can skip the first key?
--
John Naylor
EDB: http://www.enterprisedb.com
Attachments:
[application/vnd.oasis.opendocument.spreadsheet] qsort-specialize-types-jcn1.ods (36.0K, ../../CAFBsxsEFGAJ9eBpQVb5a86BE93WER3497zn2OT5wbjm1HHcqgA@mail.gmail.com/2-qsort-specialize-types-jcn1.ods)
download
[application/vnd.oasis.opendocument.spreadsheet] test-tuplesort-20220113.ods (20.4K, ../../CAFBsxsEFGAJ9eBpQVb5a86BE93WER3497zn2OT5wbjm1HHcqgA@mail.gmail.com/3-test-tuplesort-20220113.ods)
download
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-01-19 02:57 Peter Geoghegan <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: Peter Geoghegan @ 2022-01-19 02:57 UTC (permalink / raw)
To: John Naylor <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
On Tue, Jan 18, 2022 at 6:39 PM John Naylor
<[email protected]> wrote:
> Editorializing the null position in queries is not very common in my
> experience. Not null is interesting since it'd be trivial to pass
> constant false to the same Apply[XYZ]SortComparator() and let the
> compiler remove all those branches for us. On the other hand, those
> branches would be otherwise predicted well, so it might make little or
> no difference.
If you were going to do this, maybe you could encode NULL directly in
an abbreviated key. I think that that could be made to work if it was
limited to opclasses with abbreviated keys encoded as unsigned
integers. Just a thought.
--
Peter Geoghegan
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-01-19 16:08 John Naylor <[email protected]>
parent: Peter Geoghegan <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-01-19 16:08 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
On Tue, Jan 18, 2022 at 9:58 PM Peter Geoghegan <[email protected]> wrote:
>
> On Tue, Jan 18, 2022 at 6:39 PM John Naylor
> <[email protected]> wrote:
> > Editorializing the null position in queries is not very common in my
> > experience. Not null is interesting since it'd be trivial to pass
> > constant false to the same Apply[XYZ]SortComparator() and let the
> > compiler remove all those branches for us. On the other hand, those
> > branches would be otherwise predicted well, so it might make little or
> > no difference.
>
> If you were going to do this, maybe you could encode NULL directly in
> an abbreviated key. I think that that could be made to work if it was
> limited to opclasses with abbreviated keys encoded as unsigned
> integers. Just a thought.
Now that you mention that, I do remember reading about this technique
in the context of b-tree access, so it does make sense. If we had that
capability, it would be trivial to order the nulls how we want while
building the sort tuple datums, and the not-null case would be handled
automatically. And have a smaller code footprint, I think.
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-01-27 23:25 John Naylor <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-01-27 23:25 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
Hi,
I've run a few tests to get some feel for the effects of various
comparators on Datums containing int32. I've attached the full
results, as well as the (messy) patch which applies on top of 0012 to
run the tests. I'll excerpt some of those results as I go through them
here. For now, I only ran input orders of sorted, random, and
reversed.
1) Specializing
This is a win in all cases, including SQL-callable comparators (the
case here is for _bt_sort_array_elements).
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=2,
time=0.140526
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=0, time=0.085023
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=2, time=0.256708
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=0,
time=0.192063
2) Branchless operations
The int case is for how to perform the comparison, and the SQL case is
referring to how to reverse the sort order.Surprisingly, they don't
seem to help for direct comparisons, and in fact they seem worse. I'll
have to dig a bit deeper to be sure, but it's not looking good now.
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=2, time=0.084781
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=0,
time=0.091837
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=2,
time=0.192018
NOTICE: [SQL inlined reverse] size=8MB, order=random,
cmp=SQL-inline-rev, test=0, time=0.190797
When the effect is reversing a list, the direct comparisons seem much
worse, and the SQL ones aren't helped.
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=2, time=0.024963
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless,
test=0, time=0.036423
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline,
test=0, time=0.125182
NOTICE: [SQL inlined reverse] size=8MB, order=increasing,
cmp=SQL-inline-rev, test=0, time=0.127051
--
Since I have a couple more planned tests, I'll keep a running tally on
the current state of the patch set so that summaries are not scattered
over many emails:
0001 - bsearch and unique is good to have, and we can keep the return
type pending further tests
0002/3 - I've yet to see a case where branchless comparators win, but
other than that, these are good. Notational improvement and not
performance sensitive.
0004/5 - Computing the arguments slows it down, but accessing the
underlying int16s gives an improvement. [1] Haven't done an in-situ
test on VACUUM. Could be worth it for pg15, since I imagine the
proposals for dead tuple storage won't be ready this cycle.
0006 - I expect this to be slower too. I also wonder if this could
also use the global function in 0004 once it's improved.
0007 - untested
0008 - Good performance in microbenchmarks, no in-situ testing.
Inlined reversal is not worth the binary space or notational overhead.
0009 - Based on 0004, I would guess that computing the arguments is
too slow. Not sure how to test in-situ to see if specializing helps.
0010 - Thresholds on my TODO list.
0011 - A simple correction -- I'll go ahead and commit this.
v3-0001 comparators for abbreviated keys - Clearly a win, especially
for the "unsigned" case [2]. There are still possible improvements,
but they seem like a pg16 project(s).
[1] https://www.postgresql.org/message-id/CA%2BhUKG%2BS5SMoG8Z2PHj0bsK70CxVLgqQR1orQJq6Cjgibu26vA%40mail...
[2] https://www.postgresql.org/message-id/CAFBsxsEFGAJ9eBpQVb5a86BE93WER3497zn2OT5wbjm1HHcqgA%40mail.gma...
(I just realized in that message I didn't attach the script for that,
and also attached an extra draft spreadsheet. I'll improve the tests
and rerun later)
--
John Naylor
EDB: http://www.enterprisedb.com
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=0, time=0.144545
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=1, time=0.140534
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=2, time=0.140526
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=0, time=0.085023
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=1, time=0.086370
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=2, time=0.084781
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=0, time=0.091837
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=1, time=0.090426
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=2, time=0.091245
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=0, time=0.257024
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=1, time=0.256487
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=2, time=0.256708
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=0, time=0.192063
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=1, time=0.191919
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=2, time=0.192018
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=0, time=0.251948
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=1, time=0.251733
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=2, time=0.251913
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=0, time=0.190797
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=1, time=0.191047
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=2, time=0.190807
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=0, time=0.001608
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=1, time=0.001608
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=2, time=0.001607
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=0, time=0.000588
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=1, time=0.000585
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=2, time=0.000623
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=0, time=0.000729
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=1, time=0.001734
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=2, time=0.000762
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=0, time=0.005885
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=1, time=0.005934
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=2, time=0.006892
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=0, time=0.004524
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=1, time=0.004509
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=2, time=0.004523
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=0, time=0.160391
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=1, time=0.159284
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=2, time=0.159275
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=0, time=0.127051
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=1, time=0.126240
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=2, time=0.125769
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=0, time=0.069454
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=1, time=0.068313
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=2, time=0.068701
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=0, time=0.022330
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=1, time=0.023942
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=2, time=0.024963
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=0, time=0.036423
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=1, time=0.034867
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=2, time=0.035467
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=0, time=0.166501
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=1, time=0.165822
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=2, time=0.165749
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=0, time=0.125182
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=1, time=0.126536
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=2, time=0.122951
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=0, time=0.005721
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=1, time=0.005725
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=2, time=0.006157
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=0, time=0.004404
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=1, time=0.004415
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=2, time=0.006027
diff --git a/src/test/modules/test_sort_perf/Makefile b/src/test/modules/test_sort_perf/Makefile
index ab7f8e24b0..e70187f3a6 100644
--- a/src/test/modules/test_sort_perf/Makefile
+++ b/src/test/modules/test_sort_perf/Makefile
@@ -6,12 +6,15 @@ DATA = test_sort_perf--1.0.sql
first: all
-test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c
+#test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c test_sort_int64_include.c
+test_sort_perf.o: test_sort_int64_include.c
-test_sort_object_include.c: make-object-tests.sh
- ./make-object-tests.sh > test_sort_object_include.c
-test_sort_itemptr_include.c: make-itemptr-tests.sh
- ./make-itemptr-tests.sh > test_sort_itemptr_include.c
+# test_sort_object_include.c: make-object-tests.sh
+# ./make-object-tests.sh > test_sort_object_include.c
+# test_sort_itemptr_include.c: make-itemptr-tests.sh
+# ./make-itemptr-tests.sh > test_sort_itemptr_include.c
+test_sort_int64_include.c: make-int32-tests.sh
+ ./make-int32-tests.sh > test_sort_int32_include.c
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/src/test/modules/test_sort_perf/make-int32-tests.sh b/src/test/modules/test_sort_perf/make-int32-tests.sh
new file mode 100755
index 0000000000..a861ef608a
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-int32-tests.sh
@@ -0,0 +1,151 @@
+#!/bin/sh
+
+cat <<EOF
+#include "utils/builtins.h"
+
+EOF
+
+# generate the function that runs all the tests
+echo "static void"
+echo "do_sort_int32(int nmegs)"
+echo "{"
+echo " size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);"
+echo " Datum *unsorted = malloc(sizeof(Datum) * nobjects);"
+echo " Datum *sorted = malloc(sizeof(Datum) * nobjects);"
+echo
+
+# for btree
+cat <<EOF
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ // we set cxt.reverse later
+
+EOF
+
+for order in random increasing decreasing ; do
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 16;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = INT_MAX - i;"
+ fi
+ echo " unsorted[i] = Int32GetDatum(v);"
+echo " }"
+echo
+
+# traditional qsort
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort(sorted, nobjects, sizeof(Datum), btint4fastcmp);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[traditional qsort] size=%dMB, order=$order, cmp=arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[inlined] size=%dMB, order=$order, cmp=inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined and branchless
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32_branchless(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[branchless] size=%dMB, order=$order, cmp=branchless, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+### B-tree forward
+
+echo "cxt.reverse = false;"
+
+# B-tree SQL-callable qsort arg
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg] size=%dMB, order=$order, cmp=SQL-arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, cmp=SQL-inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+### Btree reversed
+
+echo "cxt.reverse = true;"
+
+# B-tree SQL-callable qsort arg (same as above, but with reversed comparator)
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg reverse] size=%dMB, order=$order, cmp=SQL-arg-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined reversed
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements_reverse(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined reverse] size=%dMB, order=$order, cmp=SQL-inline-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+
+
+done;
+
+echo " free(sorted);"
+echo " free(unsorted);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
index 953717f8ba..15203d9382 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
+++ b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
@@ -1,2 +1,3 @@
-CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
-CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+--CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+--CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_int32(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
diff --git a/src/test/modules/test_sort_perf/test_sort_perf.c b/src/test/modules/test_sort_perf/test_sort_perf.c
index 05a10924f3..177d2b1c35 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf.c
+++ b/src/test/modules/test_sort_perf/test_sort_perf.c
@@ -2,12 +2,18 @@
#include "funcapi.h"
#include "catalog/index.h"
+#include "catalog/pg_collation.h"
+#include "catalog/pg_type_d.h"
+#include "catalog/pg_opfamily_d.h"
#include "miscadmin.h"
#include "portability/instr_time.h"
#include "storage/itemptr.h"
+#include "utils/lsyscache.h"
#include <stdlib.h>
+
+/*
static int
itemptr_comparator(const void *a, const void *b)
{
@@ -27,14 +33,106 @@ itemptr_comparator(const void *a, const void *b)
if (oa > ob)
return 1;
return 0;
+}*/
+
+
+// standard comparators
+
+// comparator for qsort_arg()
+// XXX rewritten from the version in nbtutils.c
+static int
+btint4fastcmp(const void * x, const void * y)
+{
+ int32 *a = (int32 *) x;
+ int32 *b = (int32 *) y;
+
+ if (*a > *b)
+ return 1;
+ else if (*a == *b)
+ return 0;
+ else
+ return -1;
}
+// qsort with inlined comparator
+#define ST_SORT qsort_int32
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+// qsort with branchless comparator
+#define ST_SORT qsort_int32_branchless
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) ((int64) *(a) - (int64) *(b))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+
+// SQL-callable comparators
+
+typedef struct BTSortArrayContext
+{
+ FmgrInfo flinfo;
+ Oid collation;
+ bool reverse;
+} BTSortArrayContext;
+
+// comparator for qsort arg
+static int
+_bt_compare_array_elements(const void *a, const void *b, void *arg)
+{
+ Datum da = *((const Datum *) a);
+ Datum db = *((const Datum *) b);
+ BTSortArrayContext *cxt = (BTSortArrayContext *) arg;
+ int32 compare;
+
+ compare = DatumGetInt32(FunctionCall2Coll(&cxt->flinfo,
+ cxt->collation,
+ da, db));
+ if (cxt->reverse)
+ INVERT_COMPARE_RESULT(compare);
+ return compare;
+}
+
+
+/* Define a specialized sort function for _bt_sort_array_elements. */
+#define ST_SORT qsort_bt_array_elements
+//#define ST_UNIQUE unique_bt_array_elements
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+// inline the reversal
+#define ST_SORT qsort_bt_array_elements_reverse
+//#define ST_UNIQUE unique_bt_array_elements_reverse
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ (0 - (DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+
PG_MODULE_MAGIC;
/* include the generated code */
-#include "test_sort_object_include.c"
-#include "test_sort_itemptr_include.c"
+// #include "test_sort_object_include.c"
+// #include "test_sort_itemptr_include.c"
+#include "test_sort_int32_include.c"
+/*
PG_FUNCTION_INFO_V1(test_sort_object);
PG_FUNCTION_INFO_V1(test_sort_itemptr);
@@ -53,3 +151,15 @@ test_sort_itemptr(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
}
+*/
+
+
+PG_FUNCTION_INFO_V1(test_sort_int32);
+Datum
+test_sort_int32(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_int32(nmegs);
+ PG_RETURN_NULL();
+}
Attachments:
[text/plain] sort-test-microbenchmark-branchless.txt (5.4K, ../../CAFBsxsHxy4LuJZVaFD7n-197qoCWZAvXgCxVkWV=_b_9MDnmPA@mail.gmail.com/2-sort-test-microbenchmark-branchless.txt)
download | inline:
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=0, time=0.144545
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=1, time=0.140534
NOTICE: [traditional qsort] size=8MB, order=random, cmp=arg, test=2, time=0.140526
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=0, time=0.085023
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=1, time=0.086370
NOTICE: [inlined] size=8MB, order=random, cmp=inline, test=2, time=0.084781
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=0, time=0.091837
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=1, time=0.090426
NOTICE: [branchless] size=8MB, order=random, cmp=branchless, test=2, time=0.091245
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=0, time=0.257024
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=1, time=0.256487
NOTICE: [SQL arg] size=8MB, order=random, cmp=SQL-arg, test=2, time=0.256708
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=0, time=0.192063
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=1, time=0.191919
NOTICE: [SQL inlined] size=8MB, order=random, cmp=SQL-inline, test=2, time=0.192018
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=0, time=0.251948
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=1, time=0.251733
NOTICE: [SQL arg reverse] size=8MB, order=random, cmp=SQL-arg-rev, test=2, time=0.251913
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=0, time=0.190797
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=1, time=0.191047
NOTICE: [SQL inlined reverse] size=8MB, order=random, cmp=SQL-inline-rev, test=2, time=0.190807
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=0, time=0.001608
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=1, time=0.001608
NOTICE: [traditional qsort] size=8MB, order=increasing, cmp=arg, test=2, time=0.001607
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=0, time=0.000588
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=1, time=0.000585
NOTICE: [inlined] size=8MB, order=increasing, cmp=inline, test=2, time=0.000623
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=0, time=0.000729
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=1, time=0.001734
NOTICE: [branchless] size=8MB, order=increasing, cmp=branchless, test=2, time=0.000762
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=0, time=0.005885
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=1, time=0.005934
NOTICE: [SQL arg] size=8MB, order=increasing, cmp=SQL-arg, test=2, time=0.006892
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=0, time=0.004524
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=1, time=0.004509
NOTICE: [SQL inlined] size=8MB, order=increasing, cmp=SQL-inline, test=2, time=0.004523
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=0, time=0.160391
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=1, time=0.159284
NOTICE: [SQL arg reverse] size=8MB, order=increasing, cmp=SQL-arg-rev, test=2, time=0.159275
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=0, time=0.127051
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=1, time=0.126240
NOTICE: [SQL inlined reverse] size=8MB, order=increasing, cmp=SQL-inline-rev, test=2, time=0.125769
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=0, time=0.069454
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=1, time=0.068313
NOTICE: [traditional qsort] size=8MB, order=decreasing, cmp=arg, test=2, time=0.068701
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=0, time=0.022330
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=1, time=0.023942
NOTICE: [inlined] size=8MB, order=decreasing, cmp=inline, test=2, time=0.024963
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=0, time=0.036423
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=1, time=0.034867
NOTICE: [branchless] size=8MB, order=decreasing, cmp=branchless, test=2, time=0.035467
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=0, time=0.166501
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=1, time=0.165822
NOTICE: [SQL arg] size=8MB, order=decreasing, cmp=SQL-arg, test=2, time=0.165749
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=0, time=0.125182
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=1, time=0.126536
NOTICE: [SQL inlined] size=8MB, order=decreasing, cmp=SQL-inline, test=2, time=0.122951
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=0, time=0.005721
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=1, time=0.005725
NOTICE: [SQL arg reverse] size=8MB, order=decreasing, cmp=SQL-arg-rev, test=2, time=0.006157
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=0, time=0.004404
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=1, time=0.004415
NOTICE: [SQL inlined reverse] size=8MB, order=decreasing, cmp=SQL-inline-rev, test=2, time=0.006027
[text/plain] jcn-addendum-test-branchless-techniques.txt (11.4K, ../../CAFBsxsHxy4LuJZVaFD7n-197qoCWZAvXgCxVkWV=_b_9MDnmPA@mail.gmail.com/3-jcn-addendum-test-branchless-techniques.txt)
download | inline diff:
diff --git a/src/test/modules/test_sort_perf/Makefile b/src/test/modules/test_sort_perf/Makefile
index ab7f8e24b0..e70187f3a6 100644
--- a/src/test/modules/test_sort_perf/Makefile
+++ b/src/test/modules/test_sort_perf/Makefile
@@ -6,12 +6,15 @@ DATA = test_sort_perf--1.0.sql
first: all
-test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c
+#test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c test_sort_int64_include.c
+test_sort_perf.o: test_sort_int64_include.c
-test_sort_object_include.c: make-object-tests.sh
- ./make-object-tests.sh > test_sort_object_include.c
-test_sort_itemptr_include.c: make-itemptr-tests.sh
- ./make-itemptr-tests.sh > test_sort_itemptr_include.c
+# test_sort_object_include.c: make-object-tests.sh
+# ./make-object-tests.sh > test_sort_object_include.c
+# test_sort_itemptr_include.c: make-itemptr-tests.sh
+# ./make-itemptr-tests.sh > test_sort_itemptr_include.c
+test_sort_int64_include.c: make-int32-tests.sh
+ ./make-int32-tests.sh > test_sort_int32_include.c
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/src/test/modules/test_sort_perf/make-int32-tests.sh b/src/test/modules/test_sort_perf/make-int32-tests.sh
new file mode 100755
index 0000000000..a861ef608a
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-int32-tests.sh
@@ -0,0 +1,151 @@
+#!/bin/sh
+
+cat <<EOF
+#include "utils/builtins.h"
+
+EOF
+
+# generate the function that runs all the tests
+echo "static void"
+echo "do_sort_int32(int nmegs)"
+echo "{"
+echo " size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);"
+echo " Datum *unsorted = malloc(sizeof(Datum) * nobjects);"
+echo " Datum *sorted = malloc(sizeof(Datum) * nobjects);"
+echo
+
+# for btree
+cat <<EOF
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ // we set cxt.reverse later
+
+EOF
+
+for order in random increasing decreasing ; do
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 16;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = INT_MAX - i;"
+ fi
+ echo " unsorted[i] = Int32GetDatum(v);"
+echo " }"
+echo
+
+# traditional qsort
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort(sorted, nobjects, sizeof(Datum), btint4fastcmp);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[traditional qsort] size=%dMB, order=$order, cmp=arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[inlined] size=%dMB, order=$order, cmp=inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined and branchless
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32_branchless(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[branchless] size=%dMB, order=$order, cmp=branchless, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+### B-tree forward
+
+echo "cxt.reverse = false;"
+
+# B-tree SQL-callable qsort arg
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg] size=%dMB, order=$order, cmp=SQL-arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, cmp=SQL-inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+### Btree reversed
+
+echo "cxt.reverse = true;"
+
+# B-tree SQL-callable qsort arg (same as above, but with reversed comparator)
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg reverse] size=%dMB, order=$order, cmp=SQL-arg-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined reversed
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements_reverse(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined reverse] size=%dMB, order=$order, cmp=SQL-inline-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+
+
+done;
+
+echo " free(sorted);"
+echo " free(unsorted);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
index 953717f8ba..15203d9382 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
+++ b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
@@ -1,2 +1,3 @@
-CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
-CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+--CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+--CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_int32(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
diff --git a/src/test/modules/test_sort_perf/test_sort_perf.c b/src/test/modules/test_sort_perf/test_sort_perf.c
index 05a10924f3..177d2b1c35 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf.c
+++ b/src/test/modules/test_sort_perf/test_sort_perf.c
@@ -2,12 +2,18 @@
#include "funcapi.h"
#include "catalog/index.h"
+#include "catalog/pg_collation.h"
+#include "catalog/pg_type_d.h"
+#include "catalog/pg_opfamily_d.h"
#include "miscadmin.h"
#include "portability/instr_time.h"
#include "storage/itemptr.h"
+#include "utils/lsyscache.h"
#include <stdlib.h>
+
+/*
static int
itemptr_comparator(const void *a, const void *b)
{
@@ -27,14 +33,106 @@ itemptr_comparator(const void *a, const void *b)
if (oa > ob)
return 1;
return 0;
+}*/
+
+
+// standard comparators
+
+// comparator for qsort_arg()
+// XXX rewritten from the version in nbtutils.c
+static int
+btint4fastcmp(const void * x, const void * y)
+{
+ int32 *a = (int32 *) x;
+ int32 *b = (int32 *) y;
+
+ if (*a > *b)
+ return 1;
+ else if (*a == *b)
+ return 0;
+ else
+ return -1;
}
+// qsort with inlined comparator
+#define ST_SORT qsort_int32
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+// qsort with branchless comparator
+#define ST_SORT qsort_int32_branchless
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) ((int64) *(a) - (int64) *(b))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+
+// SQL-callable comparators
+
+typedef struct BTSortArrayContext
+{
+ FmgrInfo flinfo;
+ Oid collation;
+ bool reverse;
+} BTSortArrayContext;
+
+// comparator for qsort arg
+static int
+_bt_compare_array_elements(const void *a, const void *b, void *arg)
+{
+ Datum da = *((const Datum *) a);
+ Datum db = *((const Datum *) b);
+ BTSortArrayContext *cxt = (BTSortArrayContext *) arg;
+ int32 compare;
+
+ compare = DatumGetInt32(FunctionCall2Coll(&cxt->flinfo,
+ cxt->collation,
+ da, db));
+ if (cxt->reverse)
+ INVERT_COMPARE_RESULT(compare);
+ return compare;
+}
+
+
+/* Define a specialized sort function for _bt_sort_array_elements. */
+#define ST_SORT qsort_bt_array_elements
+//#define ST_UNIQUE unique_bt_array_elements
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+// inline the reversal
+#define ST_SORT qsort_bt_array_elements_reverse
+//#define ST_UNIQUE unique_bt_array_elements_reverse
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ (0 - (DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+
PG_MODULE_MAGIC;
/* include the generated code */
-#include "test_sort_object_include.c"
-#include "test_sort_itemptr_include.c"
+// #include "test_sort_object_include.c"
+// #include "test_sort_itemptr_include.c"
+#include "test_sort_int32_include.c"
+/*
PG_FUNCTION_INFO_V1(test_sort_object);
PG_FUNCTION_INFO_V1(test_sort_itemptr);
@@ -53,3 +151,15 @@ test_sort_itemptr(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
}
+*/
+
+
+PG_FUNCTION_INFO_V1(test_sort_int32);
+Datum
+test_sort_int32(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_int32(nmegs);
+ PG_RETURN_NULL();
+}
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-02-01 02:37 John Naylor <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-02-01 02:37 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
I wrote:
> 0010 - Thresholds on my TODO list.
I did some basic tests on the insertion sort thresholds, and it looks
like we could safely and profitably increase the current value from 7
to 20 or so, in line with other more recent implementations. I've
attached an addendum on top of 0012 and the full test results on an
Intel Coffee Lake machine with gcc 11.1. I found that the object test
setup in 0012 had some kind of bug that was comparing the pointer of
the object array. Rather than fix that, I decided to use Datums, but
with the two extremes in comparator: simple branching with machine
instructions vs. a SQL-callable function. The papers I've read
indicate the results for Datum sizes would not be much different for
small structs. The largest existing sort element is SortTuple, but
that's only 24 bytes and has a bulky comparator as well.
The first thing to note is that I rejected outright any testing of a
"middle value" where the pivot is simply the middle of the array. Even
the Bently and McIlroy paper which is the reference for our
implementation says "The range that consists of the single integer 7
could be eliminated, but has been left adjustable because on some
machines larger ranges are a few percent better".
I tested thresholds up to 64, which is where I guessed results to get
worse (most implementations are smaller than that). Here are the best
thresholds at a quick glance:
- elementary comparator:
random: 16 or greater
decreasing, rotate: get noticeably better all the way up to 64
organ: little difference, but seems to get better all the way up to 64
0/1: seems to get worse above 20
- SQL-callable comparator:
random: between 12 and 20, but slight differences until 32
decreasing, rotate: get noticeably better all the way up to 64
organ: seems best at 12, but slight differences until 32
0/1: slight differences
Based on these tests and this machine, it seems 20 is a good default
value. I'll repeat this test on one older Intel and one non-Intel
platform with older compilers.
--
Running tally of patchset:
0001 - bsearch and unique is good to have, and we can keep the return
type pending further tests -- if none happen this cycle, suggest
committing this without the return type symbol.
0002/3 - I've yet to see a case where branchless comparators win, but
other than that, these are good. Notational improvement and not
performance sensitive.
0004/5 - Computing the arguments slows it down, but accessing the
underlying int16s gives an improvement. [1] Haven't done an in-situ
test on VACUUM. Could be worth it for pg15, since I imagine the
proposals for dead tuple storage won't be ready this cycle.
0006 - I expect this to be slower too. I also wonder if this could
also use the global function in 0004 once it's improved.
0007 - untested
0008 - Good performance in microbenchmarks, no in-situ testing.
Inlined reversal is not worth the binary space or notational overhead.
0009 - Based on 0004, I would guess that computing the arguments is
too slow. Not sure how to test in-situ to see if specializing helps.
0010 - Suggest leaving out the middle threshold and setting the
insertion sort threshold to ~20. Might also name them
ST_INSERTION_SORT_THRESHOLD and ST_NINTHER_THRESHOLD. (TODO: test on
other platforms)
0011 - Committed.
v3-0001 comparators for abbreviated keys - Clearly a win in this state
already, especially
for the "unsigned" case [2]. (gist untested) There are additional
possible improvements mentioned,
but they seem like a PG16 project(s).
[1] https://www.postgresql.org/message-id/CA%2BhUKG%2BS5SMoG8Z2PHj0bsK70CxVLgqQR1orQJq6Cjgibu26vA%40mail...
[2] https://www.postgresql.org/message-id/CAFBsxsEFGAJ9eBpQVb5a86BE93WER3497zn2OT5wbjm1HHcqgA%40mail.gma...
(TODO: refine test)
--
John Naylor
EDB: http://www.enterprisedb.com
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.084503
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.087980
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.084299
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.081893
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.081907
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.081943
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.080810
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.080793
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.080922
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.080399
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.080433
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.080413
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.080342
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.080446
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.080339
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.080168
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.080215
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.080134
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.079902
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.080090
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.080099
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.080887
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.080847
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.080806
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.026983
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.027058
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.027052
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.024109
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.024440
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.024165
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.023262
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.023237
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.023260
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.022600
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.022614
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.022609
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.024397
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.020750
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.020817
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.018351
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.018369
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.018357
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.016055
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.016049
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.016084
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.013842
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.013862
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.013839
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.033074
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.033080
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.033043
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.032984
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.032922
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.032658
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.032258
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.032123
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.031859
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.031229
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.031656
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.031333
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.031113
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.031015
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.031010
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.031000
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.031003
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.031086
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.030584
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.030645
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.030505
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.030736
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.030655
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.030575
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.036208
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.036199
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.036066
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.034699
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.034268
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.034179
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.033336
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.033413
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.033532
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.032425
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.032118
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.032819
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.026697
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.026226
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.026693
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.023723
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.023759
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.023900
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.021496
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.021579
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.021648
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.019228
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.019275
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.019456
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.004430
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.004445
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.004439
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.004465
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.004493
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.004500
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.004462
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.004480
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.004507
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.004491
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.004467
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.004442
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.004447
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.004803
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.005271
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.005306
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.005252
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.005264
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.005273
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.005278
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.005268
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.005260
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.005257
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.005264
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.000729
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.000731
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.000731
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.000728
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.000752
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.000738
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.000730
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.000728
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.000730
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.000739
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.000762
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.000758
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.168111
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.159677
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.155916
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.152520
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.152567
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.152824
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.153694
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.153925
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.153429
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.152774
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.152820
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.152595
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.154290
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.154215
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.154039
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.157061
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.153073
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.153240
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.156380
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.156445
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.156319
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.168079
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.167869
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.167722
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.100694
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.100685
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.100688
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.095798
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.095959
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.095818
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.096971
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.096709
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.100766
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.088509
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.088457
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.088391
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.085213
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.085320
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.085160
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.074377
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.074210
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.076532
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.070267
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.070133
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.070070
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.065675
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.065708
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.065403
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.104277
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.104239
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.104218
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.102053
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.102026
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.102196
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.104658
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.106226
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.106289
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.108680
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.104593
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.104575
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.106359
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.106307
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.106543
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.105146
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.105170
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.105120
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.108710
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.108658
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.108695
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.122257
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.122182
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.122325
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.179572
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.179514
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.179475
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.174136
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.170401
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.170497
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.168404
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.168415
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.168518
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.156971
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.156866
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.156613
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.148548
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.148574
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.149027
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.132972
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.136334
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.132893
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.123577
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.123669
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.121909
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.113562
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.113854
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.113732
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.010306
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.010328
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.010335
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.010329
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.010323
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.010340
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.010488
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.010485
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.010505
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.010319
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.010352
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.010361
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.010502
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.010510
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.010487
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.010336
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.010313
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.010312
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.010492
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.010486
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.010499
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.010674
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.010691
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.010668
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.003661
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.003657
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.003655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.003656
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.003655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.003661
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.003657
diff --git a/src/test/modules/test_sort_perf/Makefile b/src/test/modules/test_sort_perf/Makefile
index ab7f8e24b0..c99fac0845 100644
--- a/src/test/modules/test_sort_perf/Makefile
+++ b/src/test/modules/test_sort_perf/Makefile
@@ -6,12 +6,17 @@ DATA = test_sort_perf--1.0.sql
first: all
-test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c
+test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c test_sort_datum_include.c test_sort_threshold_include.c
test_sort_object_include.c: make-object-tests.sh
./make-object-tests.sh > test_sort_object_include.c
test_sort_itemptr_include.c: make-itemptr-tests.sh
./make-itemptr-tests.sh > test_sort_itemptr_include.c
+test_sort_datum_include.c: make-datum-tests.sh
+ ./make-datum-tests.sh > test_sort_datum_include.c
+test_sort_threshold_include.c: make-threshold-tests.sh
+ ./make-threshold-tests.sh > test_sort_threshold_include.c
+
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/src/test/modules/test_sort_perf/make-datum-tests.sh b/src/test/modules/test_sort_perf/make-datum-tests.sh
new file mode 100755
index 0000000000..69a04b18ab
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-datum-tests.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+# generate the function that runs all the tests
+echo "static void"
+echo "do_sort_datum(int nmegs)"
+echo "{"
+echo " size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);"
+echo " Datum *unsorted = malloc(sizeof(Datum) * nobjects);"
+echo " Datum *sorted = malloc(sizeof(Datum) * nobjects);"
+echo
+
+# for btree
+cat <<EOF
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ // we set cxt.reverse later
+
+EOF
+
+for order in random increasing decreasing ; do
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 16;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = INT_MAX - i;"
+ fi
+ echo " unsorted[i] = Int32GetDatum(v);"
+echo " }"
+echo
+
+# traditional qsort
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort(sorted, nobjects, sizeof(Datum), btint4fastcmp);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[traditional qsort] size=%dMB, order=$order, cmp=arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[inlined] size=%dMB, order=$order, cmp=inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined and branchless
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32_branchless(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[branchless] size=%dMB, order=$order, cmp=branchless, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+### B-tree forward
+
+echo "cxt.reverse = false;"
+
+# B-tree SQL-callable qsort arg
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg] size=%dMB, order=$order, cmp=SQL-arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, cmp=SQL-inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+### Btree reversed
+
+echo "cxt.reverse = true;"
+
+# B-tree SQL-callable qsort arg (same as above, but with reversed comparator)
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg reverse] size=%dMB, order=$order, cmp=SQL-arg-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined reversed
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements_reverse(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined reverse] size=%dMB, order=$order, cmp=SQL-inline-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+
+
+done;
+
+echo " free(sorted);"
+echo " free(unsorted);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/make-threshold-tests.sh b/src/test/modules/test_sort_perf/make-threshold-tests.sh
new file mode 100755
index 0000000000..633ab239d3
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-threshold-tests.sh
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+# different values to test for insertion sorts
+#THRESHOLDS="7 12"
+THRESHOLDS="7 12 16 20 24 28 32 64"
+
+ORDERS="random decreasing organ rotate 0_1 increasing"
+
+
+for threshold in $THRESHOLDS ; do
+ cat << EOF
+
+#define ST_SORT qsort_int4direct_$threshold
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SORT_SMALL_THRESHOLD $threshold
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+#define ST_SORT qsort_bt_array_elements_$threshold
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SORT_SMALL_THRESHOLD $threshold
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+EOF
+done
+
+
+# generate the function that runs all the tests
+
+cat <<EOF
+static void
+do_sort_threshold(int nmegs)
+{
+ size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);
+ Datum *sorted = malloc(sizeof(Datum) * nobjects);
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ cxt.reverse = false;
+
+EOF
+
+# hard-code these
+for order in increasing random decreasing; do
+ echo " Datum *arr_$order = malloc(sizeof(Datum) * nobjects);"
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 1;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = nobjects - i;"
+ fi
+ echo " arr_$order[i] = Int32GetDatum(v);"
+ echo " }"
+ echo
+done;
+
+# more complex orders
+cat <<EOF
+ /* organ pipe: first half increasing, second half decreasing */
+ Datum *arr_organ = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects / 2; ++i)
+ arr_organ[i] = Int32GetDatum(i + 1);
+ for (size_t i = nobjects / 2; i < nobjects; ++i)
+ arr_organ[i] = Int32GetDatum(nobjects - i);
+
+ /* rotate: increasing, then last element is the smallest */
+ Datum *arr_rotate = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects; ++i)
+ arr_rotate[i] = Int32GetDatum(i + 1);
+
+ arr_rotate[nobjects - 1] = Int32GetDatum(0);
+
+ /* random 0/1 */
+ Datum *arr_0_1 = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects; ++i)
+ arr_0_1[i] = arr_random[i] % 2;
+
+
+EOF
+
+# direct comp
+for order in $ORDERS ; do
+ for threshold in $THRESHOLDS ; do
+
+ echo " for (int i = 0; i < 3; ++i)"
+ echo " {"
+ echo " instr_time start_time, end_time;"
+ echo " memcpy(sorted, arr_$order, sizeof(Datum) * nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(start_time);"
+ echo " qsort_int4direct_$threshold(sorted, nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(end_time);"
+ echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+ echo " elog(NOTICE, \"[direct] size=%dMB, order=$order, threshold=$threshold, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+ echo " }"
+
+ done;
+done;
+
+# SQL-callable comp
+for order in $ORDERS ; do
+ for threshold in $THRESHOLDS ; do
+
+ echo " for (int i = 0; i < 3; ++i)"
+ echo " {"
+ echo " instr_time start_time, end_time;"
+ echo " memcpy(sorted, arr_$order, sizeof(Datum) * nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(start_time);"
+ echo " qsort_bt_array_elements_$threshold(sorted, nobjects, &cxt);"
+ echo " INSTR_TIME_SET_CURRENT(end_time);"
+ echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+ echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, threshold=$threshold, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+ echo " }"
+ echo
+
+ done;
+done;
+
+echo " free(sorted);"
+echo " free(arr_$order);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
index 953717f8ba..9363eaac31 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
+++ b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
@@ -1,2 +1,4 @@
CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_datum(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_threshold(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
diff --git a/src/test/modules/test_sort_perf/test_sort_perf.c b/src/test/modules/test_sort_perf/test_sort_perf.c
index 05a10924f3..c3c0c5be61 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf.c
+++ b/src/test/modules/test_sort_perf/test_sort_perf.c
@@ -2,9 +2,13 @@
#include "funcapi.h"
#include "catalog/index.h"
+#include "catalog/pg_collation_d.h"
+#include "catalog/pg_type_d.h"
+#include "catalog/pg_opfamily_d.h"
#include "miscadmin.h"
#include "portability/instr_time.h"
#include "storage/itemptr.h"
+#include "utils/lsyscache.h"
#include <stdlib.h>
@@ -29,11 +33,104 @@ itemptr_comparator(const void *a, const void *b)
return 0;
}
+
+// standard comparators
+
+// comparator for qsort_arg()
+// XXX rewritten from the version in nbtutils.c
+static int
+btint4fastcmp(const void * x, const void * y)
+{
+ int32 *a = (int32 *) x;
+ int32 *b = (int32 *) y;
+
+ if (*a > *b)
+ return 1;
+ else if (*a == *b)
+ return 0;
+ else
+ return -1;
+}
+
+// qsort with inlined comparator
+#define ST_SORT qsort_int32
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+// qsort with branchless comparator
+#define ST_SORT qsort_int32_branchless
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) ((int64) *(a) - (int64) *(b))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+
+// SQL-callable comparators
+
+typedef struct BTSortArrayContext
+{
+ FmgrInfo flinfo;
+ Oid collation;
+ bool reverse;
+} BTSortArrayContext;
+
+// comparator for qsort arg
+static int
+_bt_compare_array_elements(const void *a, const void *b, void *arg)
+{
+ Datum da = *((const Datum *) a);
+ Datum db = *((const Datum *) b);
+ BTSortArrayContext *cxt = (BTSortArrayContext *) arg;
+ int32 compare;
+
+ compare = DatumGetInt32(FunctionCall2Coll(&cxt->flinfo,
+ cxt->collation,
+ da, db));
+ if (cxt->reverse)
+ INVERT_COMPARE_RESULT(compare);
+ return compare;
+}
+
+
+/* Define a specialized sort function for _bt_sort_array_elements. */
+#define ST_SORT qsort_bt_array_elements
+//#define ST_UNIQUE unique_bt_array_elements
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+// inline the reversal
+#define ST_SORT qsort_bt_array_elements_reverse
+//#define ST_UNIQUE unique_bt_array_elements_reverse
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ (0 - (DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+
PG_MODULE_MAGIC;
/* include the generated code */
#include "test_sort_object_include.c"
#include "test_sort_itemptr_include.c"
+#include "test_sort_datum_include.c"
+#include "test_sort_threshold_include.c"
+
PG_FUNCTION_INFO_V1(test_sort_object);
PG_FUNCTION_INFO_V1(test_sort_itemptr);
@@ -53,3 +150,24 @@ test_sort_itemptr(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
}
+
+
+PG_FUNCTION_INFO_V1(test_sort_datum);
+Datum
+test_sort_datum(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_datum(nmegs);
+ PG_RETURN_NULL();
+}
+
+PG_FUNCTION_INFO_V1(test_sort_threshold);
+Datum
+test_sort_threshold(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_threshold(nmegs);
+ PG_RETURN_NULL();
+}
Attachments:
[text/plain] test-results-insert-threshold-20220131.txt (22.8K, ../../CAFBsxsHr-C1xqjUMjeUN3-FvNzKiAt3gcfBKt8PFN2mov7z2gQ@mail.gmail.com/2-test-results-insert-threshold-20220131.txt)
download | inline:
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.084503
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.087980
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.084299
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.081893
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.081907
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.081943
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.080810
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.080793
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.080922
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.080399
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.080433
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.080413
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.080342
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.080446
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.080339
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.080168
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.080215
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.080134
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.079902
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.080090
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.080099
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.080887
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.080847
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.080806
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.026983
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.027058
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.027052
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.024109
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.024440
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.024165
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.023262
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.023237
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.023260
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.022600
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.022614
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.022609
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.024397
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.020750
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.020817
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.018351
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.018369
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.018357
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.016055
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.016049
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.016084
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.013842
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.013862
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.013839
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.033074
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.033080
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.033043
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.032984
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.032922
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.032658
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.032258
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.032123
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.031859
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.031229
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.031656
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.031333
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.031113
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.031015
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.031010
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.031000
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.031003
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.031086
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.030584
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.030645
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.030505
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.030736
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.030655
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.030575
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.036208
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.036199
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.036066
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.034699
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.034268
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.034179
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.033336
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.033413
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.033532
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.032425
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.032118
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.032819
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.026697
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.026226
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.026693
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.023723
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.023759
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.023900
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.021496
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.021579
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.021648
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.019228
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.019275
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.019456
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.004430
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.004445
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.004439
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.004465
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.004493
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.004500
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.004462
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.004480
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.004507
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.004491
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.004467
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.004442
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.004447
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.004803
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.005271
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.005306
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.005252
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.005264
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.005273
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.005278
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.005268
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.005260
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.005257
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.005264
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.000729
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.000731
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.000731
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.000728
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.000752
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.000738
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.000730
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.000728
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.000734
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.000730
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.000739
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.000732
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.000762
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.000735
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.000758
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.168111
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.159677
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.155916
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.152520
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.152567
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.152824
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.153694
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.153925
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.153429
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.152774
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.152820
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.152595
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.154290
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.154215
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.154039
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.157061
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.153073
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.153240
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.156380
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.156445
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.156319
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.168079
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.167869
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.167722
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.100694
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.100685
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.100688
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.095798
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.095959
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.095818
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.096971
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.096709
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.100766
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.088509
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.088457
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.088391
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.085213
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.085320
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.085160
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.074377
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.074210
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.076532
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.070267
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.070133
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.070070
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.065675
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.065708
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.065403
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.104277
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.104239
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.104218
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.102053
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.102026
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.102196
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.104658
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.106226
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.106289
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.108680
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.104593
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.104575
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.106359
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.106307
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.106543
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.105146
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.105170
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.105120
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.108710
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.108658
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.108695
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.122257
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.122182
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.122325
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.179572
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.179514
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.179475
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.174136
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.170401
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.170497
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.168404
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.168415
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.168518
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.156971
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.156866
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.156613
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.148548
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.148574
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.149027
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.132972
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.136334
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.132893
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.123577
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.123669
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.121909
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.113562
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.113854
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.113732
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.010306
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.010328
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.010335
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.010329
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.010323
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.010340
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.010488
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.010485
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.010505
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.010319
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.010352
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.010361
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.010502
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.010510
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.010487
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.010336
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.010313
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.010312
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.010492
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.010486
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.010499
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.010674
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.010691
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.010668
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.003661
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.003657
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.003655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.003656
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.003655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.003661
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.003660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.003658
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.003659
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.003657
[text/plain] jcn-0012-addendum-20220131.txt (15.6K, ../../CAFBsxsHr-C1xqjUMjeUN3-FvNzKiAt3gcfBKt8PFN2mov7z2gQ@mail.gmail.com/3-jcn-0012-addendum-20220131.txt)
download | inline diff:
diff --git a/src/test/modules/test_sort_perf/Makefile b/src/test/modules/test_sort_perf/Makefile
index ab7f8e24b0..c99fac0845 100644
--- a/src/test/modules/test_sort_perf/Makefile
+++ b/src/test/modules/test_sort_perf/Makefile
@@ -6,12 +6,17 @@ DATA = test_sort_perf--1.0.sql
first: all
-test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c
+test_sort_perf.o: test_sort_object_include.c test_sort_itemptr_include.c test_sort_datum_include.c test_sort_threshold_include.c
test_sort_object_include.c: make-object-tests.sh
./make-object-tests.sh > test_sort_object_include.c
test_sort_itemptr_include.c: make-itemptr-tests.sh
./make-itemptr-tests.sh > test_sort_itemptr_include.c
+test_sort_datum_include.c: make-datum-tests.sh
+ ./make-datum-tests.sh > test_sort_datum_include.c
+test_sort_threshold_include.c: make-threshold-tests.sh
+ ./make-threshold-tests.sh > test_sort_threshold_include.c
+
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/src/test/modules/test_sort_perf/make-datum-tests.sh b/src/test/modules/test_sort_perf/make-datum-tests.sh
new file mode 100755
index 0000000000..69a04b18ab
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-datum-tests.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+# generate the function that runs all the tests
+echo "static void"
+echo "do_sort_datum(int nmegs)"
+echo "{"
+echo " size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);"
+echo " Datum *unsorted = malloc(sizeof(Datum) * nobjects);"
+echo " Datum *sorted = malloc(sizeof(Datum) * nobjects);"
+echo
+
+# for btree
+cat <<EOF
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ // we set cxt.reverse later
+
+EOF
+
+for order in random increasing decreasing ; do
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 16;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = INT_MAX - i;"
+ fi
+ echo " unsorted[i] = Int32GetDatum(v);"
+echo " }"
+echo
+
+# traditional qsort
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort(sorted, nobjects, sizeof(Datum), btint4fastcmp);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[traditional qsort] size=%dMB, order=$order, cmp=arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[inlined] size=%dMB, order=$order, cmp=inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# inlined and branchless
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_int32_branchless(sorted, nobjects);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[branchless] size=%dMB, order=$order, cmp=branchless, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+### B-tree forward
+
+echo "cxt.reverse = false;"
+
+# B-tree SQL-callable qsort arg
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg] size=%dMB, order=$order, cmp=SQL-arg, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, cmp=SQL-inline, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+### Btree reversed
+
+echo "cxt.reverse = true;"
+
+# B-tree SQL-callable qsort arg (same as above, but with reversed comparator)
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_arg((void *) sorted, nobjects, sizeof(Datum), _bt_compare_array_elements, (void *) &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL arg reverse] size=%dMB, order=$order, cmp=SQL-arg-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+
+# B-tree SQL-callable inlined reversed
+echo " for (int i = 0; i < 3; ++i)"
+echo " {"
+echo " instr_time start_time, end_time;"
+echo " memcpy(sorted, unsorted, sizeof(Datum) * nobjects);"
+echo " INSTR_TIME_SET_CURRENT(start_time);"
+echo " qsort_bt_array_elements_reverse(sorted, nobjects, &cxt);"
+echo " INSTR_TIME_SET_CURRENT(end_time);"
+echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+echo " elog(NOTICE, \"[SQL inlined reverse] size=%dMB, order=$order, cmp=SQL-inline-rev, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+echo " }"
+echo
+
+
+
+done;
+
+echo " free(sorted);"
+echo " free(unsorted);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/make-threshold-tests.sh b/src/test/modules/test_sort_perf/make-threshold-tests.sh
new file mode 100755
index 0000000000..633ab239d3
--- /dev/null
+++ b/src/test/modules/test_sort_perf/make-threshold-tests.sh
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+# different values to test for insertion sorts
+#THRESHOLDS="7 12"
+THRESHOLDS="7 12 16 20 24 28 32 64"
+
+ORDERS="random decreasing organ rotate 0_1 increasing"
+
+
+for threshold in $THRESHOLDS ; do
+ cat << EOF
+
+#define ST_SORT qsort_int4direct_$threshold
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SORT_SMALL_THRESHOLD $threshold
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+#define ST_SORT qsort_bt_array_elements_$threshold
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SORT_SMALL_THRESHOLD $threshold
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+EOF
+done
+
+
+# generate the function that runs all the tests
+
+cat <<EOF
+static void
+do_sort_threshold(int nmegs)
+{
+ size_t nobjects = (nmegs * 1024 * 1024) / sizeof(Datum);
+ Datum *sorted = malloc(sizeof(Datum) * nobjects);
+
+ BTSortArrayContext cxt;
+ RegProcedure cmp_proc ;
+
+ // to keep from pulling in nbtree.h
+#define BTORDER_PROC 1
+
+ cmp_proc = get_opfamily_proc(INTEGER_BTREE_FAM_OID,
+ INT4OID,
+ INT4OID,
+ BTORDER_PROC);
+
+ fmgr_info(cmp_proc, &cxt.flinfo);
+ cxt.collation = DEFAULT_COLLATION_OID;
+ cxt.reverse = false;
+
+EOF
+
+# hard-code these
+for order in increasing random decreasing; do
+ echo " Datum *arr_$order = malloc(sizeof(Datum) * nobjects);"
+ echo " for (size_t i = 0; i < nobjects; ++i)"
+ echo " {"
+ if [ "$order" = "random" ] ; then
+ echo " int v = random();"
+ elif [ "$order" = "increasing" ] ; then
+ echo " int v = i + 1;"
+ elif [ "$order" = "decreasing" ] ; then
+ echo " int v = nobjects - i;"
+ fi
+ echo " arr_$order[i] = Int32GetDatum(v);"
+ echo " }"
+ echo
+done;
+
+# more complex orders
+cat <<EOF
+ /* organ pipe: first half increasing, second half decreasing */
+ Datum *arr_organ = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects / 2; ++i)
+ arr_organ[i] = Int32GetDatum(i + 1);
+ for (size_t i = nobjects / 2; i < nobjects; ++i)
+ arr_organ[i] = Int32GetDatum(nobjects - i);
+
+ /* rotate: increasing, then last element is the smallest */
+ Datum *arr_rotate = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects; ++i)
+ arr_rotate[i] = Int32GetDatum(i + 1);
+
+ arr_rotate[nobjects - 1] = Int32GetDatum(0);
+
+ /* random 0/1 */
+ Datum *arr_0_1 = malloc(sizeof(Datum) * nobjects);
+ for (size_t i = 0; i < nobjects; ++i)
+ arr_0_1[i] = arr_random[i] % 2;
+
+
+EOF
+
+# direct comp
+for order in $ORDERS ; do
+ for threshold in $THRESHOLDS ; do
+
+ echo " for (int i = 0; i < 3; ++i)"
+ echo " {"
+ echo " instr_time start_time, end_time;"
+ echo " memcpy(sorted, arr_$order, sizeof(Datum) * nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(start_time);"
+ echo " qsort_int4direct_$threshold(sorted, nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(end_time);"
+ echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+ echo " elog(NOTICE, \"[direct] size=%dMB, order=$order, threshold=$threshold, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+ echo " }"
+
+ done;
+done;
+
+# SQL-callable comp
+for order in $ORDERS ; do
+ for threshold in $THRESHOLDS ; do
+
+ echo " for (int i = 0; i < 3; ++i)"
+ echo " {"
+ echo " instr_time start_time, end_time;"
+ echo " memcpy(sorted, arr_$order, sizeof(Datum) * nobjects);"
+ echo " INSTR_TIME_SET_CURRENT(start_time);"
+ echo " qsort_bt_array_elements_$threshold(sorted, nobjects, &cxt);"
+ echo " INSTR_TIME_SET_CURRENT(end_time);"
+ echo " INSTR_TIME_SUBTRACT(end_time, start_time);"
+ echo " elog(NOTICE, \"[SQL inlined] size=%dMB, order=$order, threshold=$threshold, test=%d, time=%f\", nmegs, i, INSTR_TIME_GET_DOUBLE(end_time));"
+ echo " }"
+ echo
+
+ done;
+done;
+
+echo " free(sorted);"
+echo " free(arr_$order);"
+echo "}"
diff --git a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
index 953717f8ba..9363eaac31 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
+++ b/src/test/modules/test_sort_perf/test_sort_perf--1.0.sql
@@ -1,2 +1,4 @@
CREATE FUNCTION test_sort_object() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION test_sort_itemptr() RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_datum(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
+CREATE FUNCTION test_sort_threshold(int4) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C;
diff --git a/src/test/modules/test_sort_perf/test_sort_perf.c b/src/test/modules/test_sort_perf/test_sort_perf.c
index 05a10924f3..c3c0c5be61 100644
--- a/src/test/modules/test_sort_perf/test_sort_perf.c
+++ b/src/test/modules/test_sort_perf/test_sort_perf.c
@@ -2,9 +2,13 @@
#include "funcapi.h"
#include "catalog/index.h"
+#include "catalog/pg_collation_d.h"
+#include "catalog/pg_type_d.h"
+#include "catalog/pg_opfamily_d.h"
#include "miscadmin.h"
#include "portability/instr_time.h"
#include "storage/itemptr.h"
+#include "utils/lsyscache.h"
#include <stdlib.h>
@@ -29,11 +33,104 @@ itemptr_comparator(const void *a, const void *b)
return 0;
}
+
+// standard comparators
+
+// comparator for qsort_arg()
+// XXX rewritten from the version in nbtutils.c
+static int
+btint4fastcmp(const void * x, const void * y)
+{
+ int32 *a = (int32 *) x;
+ int32 *b = (int32 *) y;
+
+ if (*a > *b)
+ return 1;
+ else if (*a == *b)
+ return 0;
+ else
+ return -1;
+}
+
+// qsort with inlined comparator
+#define ST_SORT qsort_int32
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) (btint4fastcmp(a, b))
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+// qsort with branchless comparator
+#define ST_SORT qsort_int32_branchless
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b) ((int64) *(a) - (int64) *(b))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_SCOPE static
+#define ST_DEFINE
+#define ST_DECLARE
+#include "lib/sort_template.h"
+
+
+// SQL-callable comparators
+
+typedef struct BTSortArrayContext
+{
+ FmgrInfo flinfo;
+ Oid collation;
+ bool reverse;
+} BTSortArrayContext;
+
+// comparator for qsort arg
+static int
+_bt_compare_array_elements(const void *a, const void *b, void *arg)
+{
+ Datum da = *((const Datum *) a);
+ Datum db = *((const Datum *) b);
+ BTSortArrayContext *cxt = (BTSortArrayContext *) arg;
+ int32 compare;
+
+ compare = DatumGetInt32(FunctionCall2Coll(&cxt->flinfo,
+ cxt->collation,
+ da, db));
+ if (cxt->reverse)
+ INVERT_COMPARE_RESULT(compare);
+ return compare;
+}
+
+
+/* Define a specialized sort function for _bt_sort_array_elements. */
+#define ST_SORT qsort_bt_array_elements
+//#define ST_UNIQUE unique_bt_array_elements
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+// inline the reversal
+#define ST_SORT qsort_bt_array_elements_reverse
+//#define ST_UNIQUE unique_bt_array_elements_reverse
+#define ST_ELEMENT_TYPE Datum
+#define ST_COMPARE(a, b, cxt) \
+ (0 - (DatumGetInt32(FunctionCall2Coll(&cxt->flinfo, cxt->collation, *a, *b))))
+#define ST_COMPARE_RET_TYPE int64
+#define ST_COMPARE_ARG_TYPE BTSortArrayContext
+#define ST_SCOPE static
+#define ST_DEFINE
+#include "lib/sort_template.h"
+
+
PG_MODULE_MAGIC;
/* include the generated code */
#include "test_sort_object_include.c"
#include "test_sort_itemptr_include.c"
+#include "test_sort_datum_include.c"
+#include "test_sort_threshold_include.c"
+
PG_FUNCTION_INFO_V1(test_sort_object);
PG_FUNCTION_INFO_V1(test_sort_itemptr);
@@ -53,3 +150,24 @@ test_sort_itemptr(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
}
+
+
+PG_FUNCTION_INFO_V1(test_sort_datum);
+Datum
+test_sort_datum(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_datum(nmegs);
+ PG_RETURN_NULL();
+}
+
+PG_FUNCTION_INFO_V1(test_sort_threshold);
+Datum
+test_sort_threshold(PG_FUNCTION_ARGS)
+{
+ const int32 nmegs = PG_GETARG_INT32(0);
+
+ do_sort_threshold(nmegs);
+ PG_RETURN_NULL();
+}
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-02-02 18:40 John Naylor <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-02-02 18:40 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
I wrote:
> > 0010 - Thresholds on my TODO list.
>
> I did some basic tests on the insertion sort thresholds, and it looks
> like we could safely and profitably increase the current value from 7
> to 20 or so, in line with other more recent implementations. I've
> attached an addendum on top of 0012 and the full test results on an
> Intel Coffee Lake machine with gcc 11.1. I found that the object test
> setup in 0012 had some kind of bug that was comparing the pointer of
> the object array. Rather than fix that, I decided to use Datums, but
> with the two extremes in comparator: simple branching with machine
> instructions vs. a SQL-callable function. The papers I've read
> indicate the results for Datum sizes would not be much different for
> small structs. The largest existing sort element is SortTuple, but
> that's only 24 bytes and has a bulky comparator as well.
>
> The first thing to note is that I rejected outright any testing of a
> "middle value" where the pivot is simply the middle of the array. Even
> the Bently and McIlroy paper which is the reference for our
> implementation says "The range that consists of the single integer 7
> could be eliminated, but has been left adjustable because on some
> machines larger ranges are a few percent better".
>
> I tested thresholds up to 64, which is where I guessed results to get
> worse (most implementations are smaller than that). Here are the best
> thresholds at a quick glance:
>
> - elementary comparator:
>
> random: 16 or greater
> decreasing, rotate: get noticeably better all the way up to 64
> organ: little difference, but seems to get better all the way up to 64
> 0/1: seems to get worse above 20
>
> - SQL-callable comparator:
>
> random: between 12 and 20, but slight differences until 32
> decreasing, rotate: get noticeably better all the way up to 64
> organ: seems best at 12, but slight differences until 32
> 0/1: slight differences
>
> Based on these tests and this machine, it seems 20 is a good default
> value. I'll repeat this test on one older Intel and one non-Intel
> platform with older compilers.
The above was an Intel Comet Lake / gcc 11, and I've run the same test
on a Haswell-era Xeon / gcc 8 and a Power8 machine / gcc 4.8. The
results on those machines are pretty close to the above (full results
attached). The noticeable exception is the Power8 on random input with
a slow comparator -- those measurements there are more random than
others so we can't draw conclusions from them, but the deviations are
small in any case. I'm still thinking 20 or so is about right.
I've put a lot out here recently, so I'll take a break now and come
back in a few weeks.
(no running tally here because the conclusions haven't changed since
last message)
--
John Naylor
EDB: http://www.enterprisedb.com
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.130188
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.124503
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.124557
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.119103
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.119035
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.086948
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.082710
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.082771
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.083004
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.080768
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.080764
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.080635
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.080678
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.080555
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.080604
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.079002
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.078901
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.082200
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.079317
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.079164
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.079308
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.078604
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.078718
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.078689
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.025097
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.025078
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.025095
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.028298
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.028600
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.028688
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.023474
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.022533
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.022542
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.021052
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.021067
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.021094
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.021183
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.019644
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.021944
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.020768
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.020800
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.020818
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.016608
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.016694
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.014228
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.012651
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.012691
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.012657
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.031979
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.032628
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.034789
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.033848
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.034084
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.034066
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.033714
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.031153
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.030619
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.029174
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.029080
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.029134
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.029543
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.031115
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.029267
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.031434
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.030909
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.031286
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.030325
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.031663
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.029483
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.029878
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.027732
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.027810
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.039798
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.041404
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.041448
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.041109
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.039040
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.040159
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.039888
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.033059
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.033026
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.034844
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.036850
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.034298
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.035277
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.031883
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.027935
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.028481
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.030083
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.028839
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.027836
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.020969
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.020947
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.020864
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.021864
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.021107
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.005454
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.005434
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.005445
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.005482
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.005465
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.005498
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.005494
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.005510
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.005496
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.005484
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.005472
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.005484
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.005514
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.005519
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.005596
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.005488
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.005471
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.005479
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.005520
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.005508
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.005527
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.005453
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.005443
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.005437
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.000979
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.000985
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.000977
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.000984
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.000979
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.000984
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.000978
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.000982
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.208315
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.209714
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.210758
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.202144
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.202061
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.201736
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.198315
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.198396
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.198130
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.197979
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.197816
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.197861
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.198134
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.198119
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.198246
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.199407
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.199488
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.199439
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.201207
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.201077
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.200801
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.226759
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.226719
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.226747
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.155162
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.155236
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.154983
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.144055
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.142436
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.142224
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.128516
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.128373
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.128428
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.121263
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.121262
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.121271
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.113071
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.113082
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.113139
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.103668
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.103569
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.103516
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.091925
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.091926
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.091930
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.098095
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.098131
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.098185
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.146850
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.147078
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.146970
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.138570
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.138620
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.138630
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.135585
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.135834
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.135702
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.137001
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.135744
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.135733
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.136145
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.136117
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.136056
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.137421
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.137360
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.137347
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.139029
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.138865
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.138763
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.171138
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.171431
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.171247
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.255147
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.255173
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.254916
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.234074
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.234053
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.234080
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.220700
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.225915
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.220645
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.208890
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.208830
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.208906
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.195011
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.194661
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.194555
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.178136
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.178086
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.178177
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.160916
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.160867
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.177536
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.189746
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.192101
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.192363
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.015848
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.015293
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.013484
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.012652
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.012572
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.015349
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.015498
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.015538
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.015209
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.015378
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.015127
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.014118
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.015498
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.013113
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.012596
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.012589
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.014931
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.015270
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.015852
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.015677
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.015190
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.015729
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.013846
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.012660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.004575
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.004647
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.005002
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.005673
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.005789
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.005438
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.005694
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.005730
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.005329
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.005701
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.005646
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.005715
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.005568
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.005624
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.005655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.005129
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.005760
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.005698
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.005672
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.005636
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.005030
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.004773
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.004719
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.004764
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.171681
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.171542
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.171553
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.166650
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.166576
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.167606
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.163613
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.163577
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.163560
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.162284
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.162177
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.162194
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.162262
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.162254
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.162261
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.162574
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.162561
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.163105
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.160633
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.160611
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.169342
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.163429
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.163418
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.163436
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.098568
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.098736
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.098731
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.094295
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.098204
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.094158
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.089945
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.090141
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.090148
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.084398
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.083994
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.084104
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.077245
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.077405
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.077337
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.069377
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.069409
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.069563
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.059311
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.059506
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.059356
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.054791
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.054762
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.054810
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.095815
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.095858
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.095847
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.094097
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.094105
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.094000
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.090621
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.090557
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.090570
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.089353
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.089734
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.089247
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.090642
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.090542
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.090546
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.090770
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.090699
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.090706
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.088122
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.088066
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.088021
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.093248
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.093177
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.093175
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.130503
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.130910
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.130844
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.120236
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.120220
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.120352
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.114728
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.114699
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.114705
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.107819
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.108353
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.107872
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.101091
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.101045
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.101020
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.092126
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.092232
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.092124
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.083511
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.083553
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.083513
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.077736
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.077656
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.077941
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.009737
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.009788
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.009791
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.009781
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.009797
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.009780
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.009805
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.009803
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.009799
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.009811
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.009806
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.009819
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.009779
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.009782
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.009779
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.009807
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.009767
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.009797
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.009804
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.009802
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.009795
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.009813
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.009807
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.009833
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.001731
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.001826
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.001820
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.001810
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.001832
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.001819
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.001809
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.001835
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.001833
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.001813
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.001963
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.001813
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.001837
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.001812
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.395326
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.370237
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.369997
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.366812
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.366649
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.366801
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.365210
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.365016
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.365144
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.401241
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.401259
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.401179
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.373316
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.373020
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.373082
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.379247
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.379217
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.379495
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.385313
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.385051
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.385238
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.443364
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.443444
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.443095
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.296520
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.296260
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.296200
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.287378
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.287673
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.287395
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.274579
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.274521
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.274706
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.270940
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.270837
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.270920
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.242524
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.242749
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.242530
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.222845
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.222004
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.222050
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.196404
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.196410
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.196755
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.184679
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.184813
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.184699
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.313411
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.313823
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.313726
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.302651
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.302799
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.302742
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.308603
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.309211
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.308911
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.311303
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.311311
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.311673
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.315066
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.314541
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.315119
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.312660
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.312468
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.312560
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.325323
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.325709
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.325741
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.379399
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.379343
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.380079
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.611102
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.611574
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.610787
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.555359
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.555576
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.554815
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.570888
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.570357
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.570449
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.551491
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.551279
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.552095
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.508074
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.508384
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.508151
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.435767
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.435918
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.436199
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.423809
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.423085
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.422633
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.398309
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.398443
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.397198
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.023994
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.024015
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.023991
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.022991
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.023048
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.023003
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.024020
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.024036
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.023998
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.024025
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.024026
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.024040
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.023956
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.023950
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.023983
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.022963
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.022980
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.022969
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.024064
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.023996
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.024060
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.024098
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.023841
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.023815
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.014581
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.014624
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.014548
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.012959
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.012967
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.012979
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.014590
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.014561
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.014608
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.014594
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.014540
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.014527
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.014616
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.014558
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.014586
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.012759
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.012775
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.012866
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.014545
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.014608
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.014475
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.014519
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.014643
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.014531
Attachments:
[text/plain] test-results-insert-threshold-haswell-20220201.txt (22.8K, ../../CAFBsxsHzECMg460Y08KqZqqMEks-c9YQGz7Se2CLJVGj+t3Nfg@mail.gmail.com/2-test-results-insert-threshold-haswell-20220201.txt)
download | inline:
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.130188
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.124503
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.124557
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.119103
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.119035
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.086948
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.082710
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.082771
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.083004
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.080768
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.080764
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.080635
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.080678
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.080555
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.080604
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.079002
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.078901
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.082200
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.079317
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.079164
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.079308
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.078604
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.078718
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.078689
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.025097
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.025078
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.025095
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.028298
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.028600
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.028688
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.023474
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.022533
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.022542
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.021052
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.021067
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.021094
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.021183
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.019644
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.021944
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.020768
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.020800
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.020818
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.016608
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.016694
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.014228
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.012651
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.012691
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.012657
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.031979
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.032628
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.034789
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.033848
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.034084
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.034066
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.033714
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.031153
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.030619
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.029174
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.029080
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.029134
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.029543
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.031115
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.029267
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.031434
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.030909
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.031286
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.030325
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.031663
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.029483
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.029878
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.027732
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.027810
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.039798
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.041404
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.041448
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.041109
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.039040
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.040159
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.039888
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.033059
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.033026
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.034844
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.036850
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.034298
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.035277
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.031883
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.027935
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.028481
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.030083
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.028839
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.027836
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.020969
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.020947
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.020864
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.021864
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.021107
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.005454
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.005434
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.005445
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.005482
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.005465
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.005498
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.005494
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.005510
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.005496
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.005484
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.005472
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.005484
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.005514
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.005519
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.005596
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.005488
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.005471
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.005479
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.005520
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.005508
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.005527
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.005453
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.005443
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.005437
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.000979
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.000985
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.000977
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.000984
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.000980
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.000979
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.000986
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.000984
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.000978
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.000976
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.000981
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.000982
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.000982
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.208315
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.209714
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.210758
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.202144
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.202061
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.201736
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.198315
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.198396
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.198130
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.197979
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.197816
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.197861
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.198134
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.198119
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.198246
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.199407
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.199488
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.199439
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.201207
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.201077
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.200801
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.226759
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.226719
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.226747
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.155162
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.155236
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.154983
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.144055
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.142436
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.142224
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.128516
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.128373
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.128428
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.121263
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.121262
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.121271
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.113071
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.113082
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.113139
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.103668
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.103569
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.103516
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.091925
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.091926
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.091930
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.098095
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.098131
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.098185
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.146850
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.147078
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.146970
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.138570
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.138620
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.138630
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.135585
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.135834
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.135702
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.137001
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.135744
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.135733
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.136145
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.136117
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.136056
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.137421
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.137360
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.137347
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.139029
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.138865
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.138763
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.171138
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.171431
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.171247
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.255147
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.255173
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.254916
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.234074
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.234053
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.234080
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.220700
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.225915
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.220645
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.208890
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.208830
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.208906
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.195011
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.194661
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.194555
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.178136
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.178086
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.178177
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.160916
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.160867
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.177536
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.189746
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.192101
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.192363
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.015848
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.015293
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.013484
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.012652
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.012572
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.015349
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.015498
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.015538
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.015209
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.015378
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.015127
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.014118
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.015498
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.013113
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.012596
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.012589
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.014931
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.015270
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.015852
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.015677
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.015190
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.015729
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.013846
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.012660
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.004575
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.004647
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.005002
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.005673
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.005789
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.005438
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.005694
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.005730
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.005329
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.005701
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.005646
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.005715
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.005568
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.005624
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.005655
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.005129
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.005760
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.005698
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.005672
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.005636
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.005030
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.004773
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.004719
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.004764
[text/plain] test-results-insert-threshold-power8-20220201.txt (22.8K, ../../CAFBsxsHzECMg460Y08KqZqqMEks-c9YQGz7Se2CLJVGj+t3Nfg@mail.gmail.com/3-test-results-insert-threshold-power8-20220201.txt)
download | inline:
NOTICE: [direct] size=8MB, order=random, threshold=7, test=0, time=0.171681
NOTICE: [direct] size=8MB, order=random, threshold=7, test=1, time=0.171542
NOTICE: [direct] size=8MB, order=random, threshold=7, test=2, time=0.171553
NOTICE: [direct] size=8MB, order=random, threshold=12, test=0, time=0.166650
NOTICE: [direct] size=8MB, order=random, threshold=12, test=1, time=0.166576
NOTICE: [direct] size=8MB, order=random, threshold=12, test=2, time=0.167606
NOTICE: [direct] size=8MB, order=random, threshold=16, test=0, time=0.163613
NOTICE: [direct] size=8MB, order=random, threshold=16, test=1, time=0.163577
NOTICE: [direct] size=8MB, order=random, threshold=16, test=2, time=0.163560
NOTICE: [direct] size=8MB, order=random, threshold=20, test=0, time=0.162284
NOTICE: [direct] size=8MB, order=random, threshold=20, test=1, time=0.162177
NOTICE: [direct] size=8MB, order=random, threshold=20, test=2, time=0.162194
NOTICE: [direct] size=8MB, order=random, threshold=24, test=0, time=0.162262
NOTICE: [direct] size=8MB, order=random, threshold=24, test=1, time=0.162254
NOTICE: [direct] size=8MB, order=random, threshold=24, test=2, time=0.162261
NOTICE: [direct] size=8MB, order=random, threshold=28, test=0, time=0.162574
NOTICE: [direct] size=8MB, order=random, threshold=28, test=1, time=0.162561
NOTICE: [direct] size=8MB, order=random, threshold=28, test=2, time=0.163105
NOTICE: [direct] size=8MB, order=random, threshold=32, test=0, time=0.160633
NOTICE: [direct] size=8MB, order=random, threshold=32, test=1, time=0.160611
NOTICE: [direct] size=8MB, order=random, threshold=32, test=2, time=0.169342
NOTICE: [direct] size=8MB, order=random, threshold=64, test=0, time=0.163429
NOTICE: [direct] size=8MB, order=random, threshold=64, test=1, time=0.163418
NOTICE: [direct] size=8MB, order=random, threshold=64, test=2, time=0.163436
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=0, time=0.098568
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=1, time=0.098736
NOTICE: [direct] size=8MB, order=decreasing, threshold=7, test=2, time=0.098731
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=0, time=0.094295
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=1, time=0.098204
NOTICE: [direct] size=8MB, order=decreasing, threshold=12, test=2, time=0.094158
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=0, time=0.089945
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=1, time=0.090141
NOTICE: [direct] size=8MB, order=decreasing, threshold=16, test=2, time=0.090148
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=0, time=0.084398
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=1, time=0.083994
NOTICE: [direct] size=8MB, order=decreasing, threshold=20, test=2, time=0.084104
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=0, time=0.077245
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=1, time=0.077405
NOTICE: [direct] size=8MB, order=decreasing, threshold=24, test=2, time=0.077337
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=0, time=0.069377
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=1, time=0.069409
NOTICE: [direct] size=8MB, order=decreasing, threshold=28, test=2, time=0.069563
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=0, time=0.059311
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=1, time=0.059506
NOTICE: [direct] size=8MB, order=decreasing, threshold=32, test=2, time=0.059356
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=0, time=0.054791
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=1, time=0.054762
NOTICE: [direct] size=8MB, order=decreasing, threshold=64, test=2, time=0.054810
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=0, time=0.095815
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=1, time=0.095858
NOTICE: [direct] size=8MB, order=organ, threshold=7, test=2, time=0.095847
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=0, time=0.094097
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=1, time=0.094105
NOTICE: [direct] size=8MB, order=organ, threshold=12, test=2, time=0.094000
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=0, time=0.090621
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=1, time=0.090557
NOTICE: [direct] size=8MB, order=organ, threshold=16, test=2, time=0.090570
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=0, time=0.089353
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=1, time=0.089734
NOTICE: [direct] size=8MB, order=organ, threshold=20, test=2, time=0.089247
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=0, time=0.090642
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=1, time=0.090542
NOTICE: [direct] size=8MB, order=organ, threshold=24, test=2, time=0.090546
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=0, time=0.090770
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=1, time=0.090699
NOTICE: [direct] size=8MB, order=organ, threshold=28, test=2, time=0.090706
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=0, time=0.088122
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=1, time=0.088066
NOTICE: [direct] size=8MB, order=organ, threshold=32, test=2, time=0.088021
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=0, time=0.093248
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=1, time=0.093177
NOTICE: [direct] size=8MB, order=organ, threshold=64, test=2, time=0.093175
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=0, time=0.130503
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=1, time=0.130910
NOTICE: [direct] size=8MB, order=rotate, threshold=7, test=2, time=0.130844
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=0, time=0.120236
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=1, time=0.120220
NOTICE: [direct] size=8MB, order=rotate, threshold=12, test=2, time=0.120352
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=0, time=0.114728
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=1, time=0.114699
NOTICE: [direct] size=8MB, order=rotate, threshold=16, test=2, time=0.114705
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=0, time=0.107819
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=1, time=0.108353
NOTICE: [direct] size=8MB, order=rotate, threshold=20, test=2, time=0.107872
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=0, time=0.101091
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=1, time=0.101045
NOTICE: [direct] size=8MB, order=rotate, threshold=24, test=2, time=0.101020
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=0, time=0.092126
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=1, time=0.092232
NOTICE: [direct] size=8MB, order=rotate, threshold=28, test=2, time=0.092124
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=0, time=0.083511
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=1, time=0.083553
NOTICE: [direct] size=8MB, order=rotate, threshold=32, test=2, time=0.083513
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=0, time=0.077736
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=1, time=0.077656
NOTICE: [direct] size=8MB, order=rotate, threshold=64, test=2, time=0.077941
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=0, time=0.009737
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=1, time=0.009788
NOTICE: [direct] size=8MB, order=0_1, threshold=7, test=2, time=0.009791
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=0, time=0.009781
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=1, time=0.009797
NOTICE: [direct] size=8MB, order=0_1, threshold=12, test=2, time=0.009780
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=0, time=0.009805
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=1, time=0.009803
NOTICE: [direct] size=8MB, order=0_1, threshold=16, test=2, time=0.009799
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=0, time=0.009811
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=1, time=0.009806
NOTICE: [direct] size=8MB, order=0_1, threshold=20, test=2, time=0.009819
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=0, time=0.009779
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=1, time=0.009782
NOTICE: [direct] size=8MB, order=0_1, threshold=24, test=2, time=0.009779
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=0, time=0.009807
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=1, time=0.009767
NOTICE: [direct] size=8MB, order=0_1, threshold=28, test=2, time=0.009797
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=0, time=0.009804
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=1, time=0.009802
NOTICE: [direct] size=8MB, order=0_1, threshold=32, test=2, time=0.009795
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=0, time=0.009813
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=1, time=0.009807
NOTICE: [direct] size=8MB, order=0_1, threshold=64, test=2, time=0.009833
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=0, time=0.001731
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=1, time=0.001826
NOTICE: [direct] size=8MB, order=increasing, threshold=7, test=2, time=0.001820
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=0, time=0.001810
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=12, test=2, time=0.001832
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=0, time=0.001819
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=1, time=0.001809
NOTICE: [direct] size=8MB, order=increasing, threshold=16, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=0, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=20, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=0, time=0.001835
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=24, test=2, time=0.001833
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=0, time=0.001813
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=1, time=0.001963
NOTICE: [direct] size=8MB, order=increasing, threshold=28, test=2, time=0.001812
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=0, time=0.001813
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=32, test=2, time=0.001837
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=0, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=1, time=0.001811
NOTICE: [direct] size=8MB, order=increasing, threshold=64, test=2, time=0.001812
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=0, time=0.395326
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=1, time=0.370237
NOTICE: [SQL inlined] size=8MB, order=random, threshold=7, test=2, time=0.369997
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=0, time=0.366812
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=1, time=0.366649
NOTICE: [SQL inlined] size=8MB, order=random, threshold=12, test=2, time=0.366801
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=0, time=0.365210
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=1, time=0.365016
NOTICE: [SQL inlined] size=8MB, order=random, threshold=16, test=2, time=0.365144
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=0, time=0.401241
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=1, time=0.401259
NOTICE: [SQL inlined] size=8MB, order=random, threshold=20, test=2, time=0.401179
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=0, time=0.373316
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=1, time=0.373020
NOTICE: [SQL inlined] size=8MB, order=random, threshold=24, test=2, time=0.373082
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=0, time=0.379247
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=1, time=0.379217
NOTICE: [SQL inlined] size=8MB, order=random, threshold=28, test=2, time=0.379495
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=0, time=0.385313
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=1, time=0.385051
NOTICE: [SQL inlined] size=8MB, order=random, threshold=32, test=2, time=0.385238
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=0, time=0.443364
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=1, time=0.443444
NOTICE: [SQL inlined] size=8MB, order=random, threshold=64, test=2, time=0.443095
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=0, time=0.296520
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=1, time=0.296260
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=7, test=2, time=0.296200
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=0, time=0.287378
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=1, time=0.287673
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=12, test=2, time=0.287395
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=0, time=0.274579
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=1, time=0.274521
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=16, test=2, time=0.274706
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=0, time=0.270940
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=1, time=0.270837
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=20, test=2, time=0.270920
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=0, time=0.242524
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=1, time=0.242749
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=24, test=2, time=0.242530
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=0, time=0.222845
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=1, time=0.222004
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=28, test=2, time=0.222050
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=0, time=0.196404
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=1, time=0.196410
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=32, test=2, time=0.196755
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=0, time=0.184679
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=1, time=0.184813
NOTICE: [SQL inlined] size=8MB, order=decreasing, threshold=64, test=2, time=0.184699
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=0, time=0.313411
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=1, time=0.313823
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=7, test=2, time=0.313726
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=0, time=0.302651
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=1, time=0.302799
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=12, test=2, time=0.302742
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=0, time=0.308603
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=1, time=0.309211
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=16, test=2, time=0.308911
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=0, time=0.311303
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=1, time=0.311311
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=20, test=2, time=0.311673
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=0, time=0.315066
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=1, time=0.314541
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=24, test=2, time=0.315119
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=0, time=0.312660
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=1, time=0.312468
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=28, test=2, time=0.312560
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=0, time=0.325323
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=1, time=0.325709
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=32, test=2, time=0.325741
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=0, time=0.379399
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=1, time=0.379343
NOTICE: [SQL inlined] size=8MB, order=organ, threshold=64, test=2, time=0.380079
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=0, time=0.611102
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=1, time=0.611574
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=7, test=2, time=0.610787
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=0, time=0.555359
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=1, time=0.555576
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=12, test=2, time=0.554815
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=0, time=0.570888
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=1, time=0.570357
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=16, test=2, time=0.570449
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=0, time=0.551491
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=1, time=0.551279
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=20, test=2, time=0.552095
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=0, time=0.508074
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=1, time=0.508384
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=24, test=2, time=0.508151
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=0, time=0.435767
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=1, time=0.435918
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=28, test=2, time=0.436199
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=0, time=0.423809
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=1, time=0.423085
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=32, test=2, time=0.422633
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=0, time=0.398309
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=1, time=0.398443
NOTICE: [SQL inlined] size=8MB, order=rotate, threshold=64, test=2, time=0.397198
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=0, time=0.023994
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=1, time=0.024015
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=7, test=2, time=0.023991
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=0, time=0.022991
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=1, time=0.023048
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=12, test=2, time=0.023003
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=0, time=0.024020
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=1, time=0.024036
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=16, test=2, time=0.023998
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=0, time=0.024025
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=1, time=0.024026
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=20, test=2, time=0.024040
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=0, time=0.023956
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=1, time=0.023950
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=24, test=2, time=0.023983
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=0, time=0.022963
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=1, time=0.022980
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=28, test=2, time=0.022969
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=0, time=0.024064
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=1, time=0.023996
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=32, test=2, time=0.024060
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=0, time=0.024098
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=1, time=0.023841
NOTICE: [SQL inlined] size=8MB, order=0_1, threshold=64, test=2, time=0.023815
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=0, time=0.014581
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=1, time=0.014624
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=7, test=2, time=0.014548
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=0, time=0.012959
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=1, time=0.012967
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=12, test=2, time=0.012979
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=0, time=0.014590
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=1, time=0.014561
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=16, test=2, time=0.014608
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=0, time=0.014594
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=1, time=0.014540
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=20, test=2, time=0.014527
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=0, time=0.014616
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=1, time=0.014558
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=24, test=2, time=0.014586
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=0, time=0.012759
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=1, time=0.012775
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=28, test=2, time=0.012866
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=0, time=0.014545
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=1, time=0.014608
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=32, test=2, time=0.014475
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=0, time=0.014519
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=1, time=0.014643
NOTICE: [SQL inlined] size=8MB, order=increasing, threshold=64, test=2, time=0.014531
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-03-31 10:09 John Naylor <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 2 replies; 15+ messages in thread
From: John Naylor @ 2022-03-31 10:09 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
In a couple days I'm going to commit the v3 patch "accelerate tuple
sorting for common types" as-is after giving it one more look, barring
objections.
I started towards incorporating the change in insertion sort threshold
(part of 0010), but that caused regression test failures, so that will
have to wait for a bit of analysis and retesting. (My earlier tests
were done in a separate module.)
The rest in this series that I looked at closely were either
refactoring or could use some minor tweaks so likely v16 material.
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-03-31 21:42 Thomas Munro <[email protected]>
parent: John Naylor <[email protected]>
1 sibling, 1 reply; 15+ messages in thread
From: Thomas Munro @ 2022-03-31 21:42 UTC (permalink / raw)
To: John Naylor <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Thu, Mar 31, 2022 at 11:09 PM John Naylor
<[email protected]> wrote:
> In a couple days I'm going to commit the v3 patch "accelerate tuple
> sorting for common types" as-is after giving it one more look, barring
> objections.
Hi John,
Thanks so much for all the work you've done here! I feel bad that I
lobbed so many experimental patches in here and then ran away due to
lack of cycles. That particular patch (the one cfbot has been chewing
on all this time) does indeed seem committable, despite the
deficiencies/opportunities listed in comments. It's nice to reduce
code duplication, it gives the right answers, and it goes faster.
> I started towards incorporating the change in insertion sort threshold
> (part of 0010), but that caused regression test failures, so that will
> have to wait for a bit of analysis and retesting. (My earlier tests
> were done in a separate module.)
>
> The rest in this series that I looked at closely were either
> refactoring or could use some minor tweaks so likely v16 material.
Looking forward to it.
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 08:38 John Naylor <[email protected]>
parent: Thomas Munro <[email protected]>
0 siblings, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-04-02 08:38 UTC (permalink / raw)
To: Thomas Munro <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Fri, Apr 1, 2022 at 4:43 AM Thomas Munro <[email protected]> wrote:
>
> On Thu, Mar 31, 2022 at 11:09 PM John Naylor
> <[email protected]> wrote:
> > In a couple days I'm going to commit the v3 patch "accelerate tuple
> > sorting for common types" as-is after giving it one more look, barring
> > objections.
Pushed.
> Hi John,
>
> Thanks so much for all the work you've done here! I feel bad that I
> lobbed so many experimental patches in here and then ran away due to
> lack of cycles. That particular patch (the one cfbot has been chewing
> on all this time) does indeed seem committable, despite the
> deficiencies/opportunities listed in comments. It's nice to reduce
> code duplication, it gives the right answers, and it goes faster.
Thanks for chiming in! It gives me more confidence that there wasn't
anything amiss that may have gone unnoticed. And no worries -- my own
review efforts here have been sporadic. ;-)
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 08:50 John Naylor <[email protected]>
parent: John Naylor <[email protected]>
1 sibling, 0 replies; 15+ messages in thread
From: John Naylor @ 2022-04-02 08:50 UTC (permalink / raw)
To: Peter Geoghegan <[email protected]>; +Cc: Thomas Munro <[email protected]>; pgsql-hackers
I wrote:
> I started towards incorporating the change in insertion sort threshold
> (part of 0010), but that caused regression test failures, so that will
> have to wait for a bit of analysis and retesting. (My earlier tests
> were done in a separate module.)
The failures seem to be where sort order is partially specified. E.g.
ORDER BY col_a, where there are duplicates there and other columns are
different. Insertion sort is stable IIRC, so moving the threshold
caused different orders in these cases. Some cases can be conveniently
fixed with additional columns in the ORDER BY clause. I'll go through
the failures and see how much can be cleaned up as a preparatory
refactoring.
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 10:26 Thomas Munro <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 2 replies; 15+ messages in thread
From: Thomas Munro @ 2022-04-02 10:26 UTC (permalink / raw)
To: John Naylor <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Sat, Apr 2, 2022 at 9:38 PM John Naylor <[email protected]> wrote:
> On Fri, Apr 1, 2022 at 4:43 AM Thomas Munro <[email protected]> wrote:
> > On Thu, Mar 31, 2022 at 11:09 PM John Naylor
> > <[email protected]> wrote:
> > > In a couple days I'm going to commit the v3 patch "accelerate tuple
> > > sorting for common types" as-is after giving it one more look, barring
> > > objections.
>
> Pushed.
It looks like UBsan sees a problem, per BF animal kestrel:
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/utils/sort/tuplesort.c:722:51:
runtime error: load of value 96, which is not a valid value for type
'bool'
#5 0x0000000000eb65d4 in qsort_tuple_int32_compare (a=0x4292ce0,
b=0x4292cf8, state=0x4280130) at
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/utils/sort/tuplesort.c:722
#6 qsort_tuple_int32 (data=<optimized out>, n=133,
arg=arg@entry=0x4280130) at
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/include/lib/sort_template.h:313
#7 0x0000000000eaf747 in tuplesort_sort_memtuples
(state=state@entry=0x4280130) at
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/utils/sort/tuplesort.c:3613
#8 0x0000000000eaedcb in tuplesort_performsort
(state=state@entry=0x4280130) at
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/utils/sort/tuplesort.c:2154
#9 0x0000000000573d60 in heapam_relation_copy_for_cluster
(OldHeap=<optimized out>, NewHeap=<optimized out>, OldIndex=<optimized
out>, use_sort=<optimized out>, OldestXmin=11681,
xid_cutoff=<optimized out>, multi_cutoff=0x7ffecb0cfa70,
num_tuples=0x7ffecb0cfa38, tups_vacuumed=0x7ffecb0cfa20,
tups_recently_dead=0x7ffecb0cfa28) at
/mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/access/heap/heapam_handler.c:955
Reproduced locally, using the same few lines from the cluster.sql
test. I'll try to dig more tomorrow...
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 10:56 John Naylor <[email protected]>
parent: Thomas Munro <[email protected]>
1 sibling, 0 replies; 15+ messages in thread
From: John Naylor @ 2022-04-02 10:56 UTC (permalink / raw)
To: Thomas Munro <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Sat, Apr 2, 2022 at 5:27 PM Thomas Munro <[email protected]> wrote:
> It looks like UBsan sees a problem, per BF animal kestrel:
>
> /mnt/resource/bf/build/kestrel/HEAD/pgsql.build/../pgsql/src/backend/utils/sort/tuplesort.c:722:51:
> runtime error: load of value 96, which is not a valid value for type
> 'bool'
Yeah, same with tamandua. Then, skink (a Valgrind animal) shows:
==1940791== VALGRINDERROR-BEGIN
==1940791== Conditional jump or move depends on uninitialised value(s)
==1940791== at 0x73D394: ApplyInt32SortComparator (sortsupport.h:311)
==1940791== by 0x73D394: qsort_tuple_int32_compare (tuplesort.c:722)
==1940791== by 0x73D394: qsort_tuple_int32 (sort_template.h:313)
==1940791== by 0x7409BC: tuplesort_sort_memtuples (tuplesort.c:3613)
==1940791== by 0x742806: tuplesort_performsort (tuplesort.c:2154)
==1940791== by 0x23C109: heapam_relation_copy_for_cluster
(heapam_handler.c:955)
==1940791== by 0x35799A: table_relation_copy_for_cluster (tableam.h:1658)
==1940791== by 0x35799A: copy_table_data (cluster.c:913)
==1940791== by 0x359016: rebuild_relation (cluster.c:606)
==1940791== by 0x35914E: cluster_rel (cluster.c:427)
==1940791== by 0x3594EB: cluster (cluster.c:195)
==1940791== by 0x5C73FF: standard_ProcessUtility (utility.c:862)
==1940791== by 0x5C78D0: ProcessUtility (utility.c:530)
==1940791== by 0x5C4C7B: PortalRunUtility (pquery.c:1158)
==1940791== by 0x5C4F78: PortalRunMulti (pquery.c:1315)
==1940791== Uninitialised value was created by a stack allocation
==1940791== at 0x74224E: tuplesort_putheaptuple (tuplesort.c:1800)
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 11:41 John Naylor <[email protected]>
parent: Thomas Munro <[email protected]>
1 sibling, 1 reply; 15+ messages in thread
From: John Naylor @ 2022-04-02 11:41 UTC (permalink / raw)
To: Thomas Munro <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Sat, Apr 2, 2022 at 5:27 PM Thomas Munro <[email protected]> wrote:
> Reproduced locally, using the same few lines from the cluster.sql
> test. I'll try to dig more tomorrow...
Thanks! Unfortunately I can't reproduce locally with clang 13/gcc 11,
with -Og or -O2 with CFLAGS="-fsanitize=undefined,alignment" ...
--
John Naylor
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: A qsort template
@ 2022-04-02 20:07 Thomas Munro <[email protected]>
parent: John Naylor <[email protected]>
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Munro @ 2022-04-02 20:07 UTC (permalink / raw)
To: John Naylor <[email protected]>; +Cc: Peter Geoghegan <[email protected]>; pgsql-hackers
On Sun, Apr 3, 2022 at 12:41 AM John Naylor
<[email protected]> wrote:
> On Sat, Apr 2, 2022 at 5:27 PM Thomas Munro <[email protected]> wrote:
> > Reproduced locally, using the same few lines from the cluster.sql
> > test. I'll try to dig more tomorrow...
>
> Thanks! Unfortunately I can't reproduce locally with clang 13/gcc 11,
> with -Og or -O2 with CFLAGS="-fsanitize=undefined,alignment" ...
Maybe you need to add -fno-sanitize-recover=all to make it crash,
otherwise it just prints the warning and keeps going.
^ permalink raw reply [nested|flat] 15+ messages in thread
end of thread, other threads:[~2022-04-02 20:07 UTC | newest]
Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 21:35 [PATCH 08/10] Default to zstd.. Justin Pryzby <[email protected]>
2022-01-19 02:39 Re: A qsort template John Naylor <[email protected]>
2022-01-19 02:57 ` Re: A qsort template Peter Geoghegan <[email protected]>
2022-01-19 16:08 ` Re: A qsort template John Naylor <[email protected]>
2022-01-27 23:25 ` Re: A qsort template John Naylor <[email protected]>
2022-02-01 02:37 ` Re: A qsort template John Naylor <[email protected]>
2022-02-02 18:40 ` Re: A qsort template John Naylor <[email protected]>
2022-03-31 10:09 ` Re: A qsort template John Naylor <[email protected]>
2022-03-31 21:42 ` Re: A qsort template Thomas Munro <[email protected]>
2022-04-02 08:38 ` Re: A qsort template John Naylor <[email protected]>
2022-04-02 10:26 ` Re: A qsort template Thomas Munro <[email protected]>
2022-04-02 10:56 ` Re: A qsort template John Naylor <[email protected]>
2022-04-02 11:41 ` Re: A qsort template John Naylor <[email protected]>
2022-04-02 20:07 ` Re: A qsort template Thomas Munro <[email protected]>
2022-04-02 08:50 ` Re: A qsort template John Naylor <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox