diff --git a/opengauss-column/README.md b/opengauss-column/README.md new file mode 100644 index 0000000000..3e05f21447 --- /dev/null +++ b/opengauss-column/README.md @@ -0,0 +1,123 @@ +This is the `opengauss` entry with one change: `hits` is created +`WITH (ORIENTATION = COLUMN)`, so it lives in openGauss's column store and is +read by its vectorized executor instead of the row-at-a-time one. openGauss +documents the column store as the storage for "data warehouse services with a +large amount of aggregation computing", which is what ClickBench is. + +Read `../opengauss/README.md` first: installation from the openEuler tarball, +the two bridged sonames, the `omm` user, `DBCOMPATIBILITY = 'PG'`, the way +files reach `gsql` on stdin, and the `query_dop` / `max_connections` +relationship are all identical here and are only described there. + +To run the benchmark: + +``` +./benchmark.sh +``` + +## What differs from the row-store entry + +- `create.sql` ends in `) WITH (ORIENTATION = COLUMN);`. openGauss accepts + every type the portable ClickBench schema uses in a column-store table, so + the schema is otherwise byte-for-byte the `postgresql` one. Compression is + left at the column store's default of `low`; `middle` and `high` exist and + would trade CPU for space. +- Nothing else. `install` is byte-for-byte the row-store entry's, including + `shared_buffers`: `cstore_buffers`, the CU cache the column store reads + through, is deliberately left at its default, because the driver restarts + the server and drops the page cache before every query, so a large CU cache + is never warm when it matters. An earlier revision of this entry gave it a + quarter of RAM and the c6a.4xlarge run spent about 30 minutes in each cold + cycle -- 18 queries in ten hours, against 156 seconds of actual query time. +- `./load` finishes with `ANALYZE` rather than `VACUUM ANALYZE`: there are no + heap pages to freeze and no visibility map to build. + +## What the column store is worth + +Loaded with the same 99,997,497 rows through the same scripts, the column +store takes 16 GB for the table and 31.3 GB for the whole data directory, +against 86.6 GB for the row store, and it loads in a little over half the +time. + +Per query it is not uniformly better, which is the interesting part. It is +two to three orders of magnitude faster on the selective tail of the workload +— Q37 to Q43, which filter on `CounterID` and an `EventDate` range, drop from +229-303 s each to between 0.16 s and 1.8 s, because those queries read five or +six of the 105 columns where the row store has to walk every one of them. Q1 +and Q20 finish in 65 ms. + +It is *slower* than the row engine on `COUNT(DISTINCT ...)`. The scan is not +the problem: on a 1% slice, `SELECT COUNT(DISTINCT UserID)` spends 6 ms in +`CStore Scan` and 1.27 s in `Vector Aggregate`, where the row plan does the +whole thing in 0.38 s. Eight of the 43 queries use `COUNT(DISTINCT ...)` and +all eight pay this. + +## A constant in the GROUP BY costs an order of magnitude + +Q34 and Q35 differ only in that Q35 adds a constant to the grouping list: + +```sql +SELECT URL, COUNT(*) AS c FROM hits GROUP BY URL ORDER BY c DESC LIMIT 10; -- Q34 +SELECT 1, URL, COUNT(*) AS c FROM hits GROUP BY 1, URL ORDER BY c DESC LIMIT 10; -- Q35 +``` + +The plans are structurally identical — `CStore Scan`, `Vector Sonic Hash +Aggregate`, `Vector Streaming(LOCAL REDISTRIBUTE)`, a second aggregate, sort, +limit — and differ in exactly one line, which `EXPLAIN VERBOSE` shows on the +redistribution: + +``` +Q34: Distribute Key: url +Q35: Distribute Key: (1) +``` + +The planner keys the redistribution on the leading grouping column, and for +Q35 that column is the constant, so every row hashes to the same worker and +the other 47 have nothing to do. Measured back to back on the full 100M rows +with `query_dop = 48`: + +| query | `query_dop = 48` | `query_dop = 1` | +| --- | --- | --- | +| Q34, `GROUP BY URL` | 50.9 s | 456.1 s | +| Q35, `GROUP BY 1, URL` | 636.6 s | 397.6 s | +| Q35 rewritten, `GROUP BY URL, 2` | 22.5 s | | + +Parallelism is worth 9x to Q34 and nothing at all to Q35 — at `query_dop = 48` +Q35 is in fact slower than at `query_dop = 1`, since it pays for the +redistribution and gets no distribution out of it. Moving the constant to the +end of the grouping list restores `Distribute Key: url` and, with it, the +runtime. + +The query is left exactly as ClickBench specifies it. This is worth reporting +to the openGauss community; it has not been filed yet. + +## An aggregate `FILTER` clause takes the instance down + +Not a ClickBench query — none of the 43 uses `FILTER` — but found while +measuring this dataset, and worth knowing about before anyone else spends an +evening on it. On a column-store table, an aggregate with a `FILTER` clause +kills the whole `gaussdb` instance, silently: no log entry, no core, every +session gets `connection to server was lost`, and the next start does redo +recovery. 1000 rows are enough: + +```sql +CREATE TABLE t_col (a int, b int) WITH (ORIENTATION = COLUMN); +INSERT INTO t_col SELECT i, i % 7 FROM generate_series(1, 1000) i; +SELECT count(*) FILTER (WHERE b = 1) FROM t_col; -- instance gone +``` + +The same statement against a row-store table answers normally, so it is the +vectorized path. Also unfiled. + +## Verification + +These scripts were run end to end on the full dataset: `./load` gets exactly +99,997,497 rows in and all 43 queries return a result, none erroring or timing +out. Every one of the 43 was then compared against the row-store entry's +answers for the same 100M rows — the two execution engines agree on 34 of them +exactly, and the 9 that differ are all queries where a `LIMIT` cuts through a +run of tied sort keys (Q18 has no `ORDER BY` at all). Correctness against +`clickhouse-local` was checked query by query on a 1% slice, as described in +`../opengauss/README.md`. + +No results yet — those need runs on the benchmark's own EC2 machines. diff --git a/opengauss-column/benchmark.sh b/opengauss-column/benchmark.sh new file mode 100755 index 0000000000..124a77209b --- /dev/null +++ b/opengauss-column/benchmark.sh @@ -0,0 +1,3 @@ +#!/bin/bash +export BENCH_DOWNLOAD_SCRIPT="download-hits-tsv" +exec ../lib/benchmark-common.sh diff --git a/opengauss-column/check b/opengauss-column/check new file mode 100755 index 0000000000..7787ab7d11 --- /dev/null +++ b/opengauss-column/check @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# gsql exits 0 even when it cannot connect, so match on the output instead. +out=$(sudo -u "$OG_USER" "$OG_ROOT/run" gsql -d postgres -t -A -c 'SELECT 1' 2>&1) +[ "$out" = "1" ] diff --git a/opengauss-column/create.sql b/opengauss-column/create.sql new file mode 100644 index 0000000000..e67f3d3690 --- /dev/null +++ b/opengauss-column/create.sql @@ -0,0 +1,108 @@ +CREATE TABLE hits +( + WatchID BIGINT NOT NULL, + JavaEnable SMALLINT NOT NULL, + Title TEXT NOT NULL, + GoodEvent SMALLINT NOT NULL, + EventTime TIMESTAMP NOT NULL, + EventDate Date NOT NULL, + CounterID INTEGER NOT NULL, + ClientIP INTEGER NOT NULL, + RegionID INTEGER NOT NULL, + UserID BIGINT NOT NULL, + CounterClass SMALLINT NOT NULL, + OS SMALLINT NOT NULL, + UserAgent SMALLINT NOT NULL, + URL TEXT NOT NULL, + Referer TEXT NOT NULL, + IsRefresh SMALLINT NOT NULL, + RefererCategoryID SMALLINT NOT NULL, + RefererRegionID INTEGER NOT NULL, + URLCategoryID SMALLINT NOT NULL, + URLRegionID INTEGER NOT NULL, + ResolutionWidth SMALLINT NOT NULL, + ResolutionHeight SMALLINT NOT NULL, + ResolutionDepth SMALLINT NOT NULL, + FlashMajor SMALLINT NOT NULL, + FlashMinor SMALLINT NOT NULL, + FlashMinor2 TEXT NOT NULL, + NetMajor SMALLINT NOT NULL, + NetMinor SMALLINT NOT NULL, + UserAgentMajor SMALLINT NOT NULL, + UserAgentMinor VARCHAR(255) NOT NULL, + CookieEnable SMALLINT NOT NULL, + JavascriptEnable SMALLINT NOT NULL, + IsMobile SMALLINT NOT NULL, + MobilePhone SMALLINT NOT NULL, + MobilePhoneModel TEXT NOT NULL, + Params TEXT NOT NULL, + IPNetworkID INTEGER NOT NULL, + TraficSourceID SMALLINT NOT NULL, + SearchEngineID SMALLINT NOT NULL, + SearchPhrase TEXT NOT NULL, + AdvEngineID SMALLINT NOT NULL, + IsArtifical SMALLINT NOT NULL, + WindowClientWidth SMALLINT NOT NULL, + WindowClientHeight SMALLINT NOT NULL, + ClientTimeZone SMALLINT NOT NULL, + ClientEventTime TIMESTAMP NOT NULL, + SilverlightVersion1 SMALLINT NOT NULL, + SilverlightVersion2 SMALLINT NOT NULL, + SilverlightVersion3 INTEGER NOT NULL, + SilverlightVersion4 SMALLINT NOT NULL, + PageCharset TEXT NOT NULL, + CodeVersion INTEGER NOT NULL, + IsLink SMALLINT NOT NULL, + IsDownload SMALLINT NOT NULL, + IsNotBounce SMALLINT NOT NULL, + FUniqID BIGINT NOT NULL, + OriginalURL TEXT NOT NULL, + HID INTEGER NOT NULL, + IsOldCounter SMALLINT NOT NULL, + IsEvent SMALLINT NOT NULL, + IsParameter SMALLINT NOT NULL, + DontCountHits SMALLINT NOT NULL, + WithHash SMALLINT NOT NULL, + HitColor CHAR NOT NULL, + LocalEventTime TIMESTAMP NOT NULL, + Age SMALLINT NOT NULL, + Sex SMALLINT NOT NULL, + Income SMALLINT NOT NULL, + Interests SMALLINT NOT NULL, + Robotness SMALLINT NOT NULL, + RemoteIP INTEGER NOT NULL, + WindowName INTEGER NOT NULL, + OpenerName INTEGER NOT NULL, + HistoryLength SMALLINT NOT NULL, + BrowserLanguage TEXT NOT NULL, + BrowserCountry TEXT NOT NULL, + SocialNetwork TEXT NOT NULL, + SocialAction TEXT NOT NULL, + HTTPError SMALLINT NOT NULL, + SendTiming INTEGER NOT NULL, + DNSTiming INTEGER NOT NULL, + ConnectTiming INTEGER NOT NULL, + ResponseStartTiming INTEGER NOT NULL, + ResponseEndTiming INTEGER NOT NULL, + FetchTiming INTEGER NOT NULL, + SocialSourceNetworkID SMALLINT NOT NULL, + SocialSourcePage TEXT NOT NULL, + ParamPrice BIGINT NOT NULL, + ParamOrderID TEXT NOT NULL, + ParamCurrency TEXT NOT NULL, + ParamCurrencyID SMALLINT NOT NULL, + OpenstatServiceName TEXT NOT NULL, + OpenstatCampaignID TEXT NOT NULL, + OpenstatAdID TEXT NOT NULL, + OpenstatSourceID TEXT NOT NULL, + UTMSource TEXT NOT NULL, + UTMMedium TEXT NOT NULL, + UTMCampaign TEXT NOT NULL, + UTMContent TEXT NOT NULL, + UTMTerm TEXT NOT NULL, + FromTag TEXT NOT NULL, + HasGCLID SMALLINT NOT NULL, + RefererHash BIGINT NOT NULL, + URLHash BIGINT NOT NULL, + CLID INTEGER NOT NULL +) WITH (ORIENTATION = COLUMN); diff --git a/opengauss-column/data-size b/opengauss-column/data-size new file mode 100755 index 0000000000..9f7409f6a0 --- /dev/null +++ b/opengauss-column/data-size @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu + +OG_ROOT=${OG_ROOT:-/opt/opengauss} + +sudo du -bcs "$OG_ROOT/data" | grep total | awk '{print $1}' diff --git a/opengauss-column/install b/opengauss-column/install new file mode 100755 index 0000000000..fa374b2d06 --- /dev/null +++ b/opengauss-column/install @@ -0,0 +1,139 @@ +#!/bin/bash +# openGauss publishes binaries for openEuler and CentOS only, so there is no +# apt repository to add. The openEuler 20.03 server tarball is glibc 2.28 and +# runs unmodified on Ubuntu once two sonames are bridged: libaio.so.1 (Ubuntu +# renamed it libaio.so.1t64 in the 64-bit time_t transition, an ABI no-op on +# 64-bit) and libreadline.so.7 (Ubuntu ships readline 8, which gsql only uses +# for line editing). Both symlinks live in a private directory that is added +# to LD_LIBRARY_PATH, so nothing outside $OG_ROOT is touched. +set -eu + +OG_VERSION=${OG_VERSION:-6.0.5} +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} +OG_PORT=${OG_PORT:-5432} + +# Nothing to do if a previous run already initialized the cluster. +if [ -f "$OG_ROOT/data/postgresql.conf" ]; then + echo "opengauss: cluster already initialized in $OG_ROOT/data" >&2 + exit 0 +fi + +case "$(uname -m)" in + x86_64) og_arch=x86; og_suffix=x86_64 ;; + aarch64) og_arch=arm; og_suffix=aarch64 ;; + *) echo "opengauss: unsupported architecture $(uname -m)" >&2; exit 1 ;; +esac +og_file="openGauss-Server-${OG_VERSION}-openEuler20.03-${og_suffix}.tar.bz2" +og_url="https://opengauss.obs.cn-south-1.myhuaweicloud.com/${OG_VERSION}/openEuler20.03/${og_arch}/${og_file}" + +sudo apt-get update -y +sudo apt-get install -y wget bzip2 libreadline8 libncurses6 libncursesw6 libtinfo6 libcrypt1 +# libaio1t64 on Ubuntu 24.04+, libaio1 on older releases. +sudo apt-get install -y libaio1t64 || sudo apt-get install -y libaio1 + +# A dedicated OS user: openGauss refuses to start as root. +if ! id "$OG_USER" >/dev/null 2>&1; then + sudo useradd -m -s /bin/bash "$OG_USER" +fi + +sudo mkdir -p "$OG_ROOT/app" "$OG_ROOT/data" "$OG_ROOT/log" "$OG_ROOT/compat" "$OG_ROOT/tmp" + +wget --continue --progress=dot:giga -O "/tmp/$og_file" "$og_url" +sudo tar xjf "/tmp/$og_file" -C "$OG_ROOT/app" +rm -f "/tmp/$og_file" + +libdir="/usr/lib/$(uname -m)-linux-gnu" +sudo ln -sf "$(ls "$libdir"/libaio.so.1* | head -n1)" "$OG_ROOT/compat/libaio.so.1" +sudo ln -sf "$(ls "$libdir"/libreadline.so.8* | head -n1)" "$OG_ROOT/compat/libreadline.so.7" + +# Every other script runs commands through $OG_ROOT/run, which sources this +# environment and drops the caller into the openGauss toolchain. +sudo tee "$OG_ROOT/env.sh" >/dev/null </dev/null </dev/null || ulimit -n "\$(ulimit -Hn)" 2>/dev/null || true +source $OG_ROOT/env.sh +exec "\$@" +EOF +sudo chmod 755 "$OG_ROOT/run" +sudo chown -R "$OG_USER:$OG_USER" "$OG_ROOT" + +# Initialize the cluster. -A trust keeps the benchmark scripts free of +# password handling; the instance only listens on a Unix socket anyway. +sudo -u "$OG_USER" "$OG_ROOT/run" gs_initdb -D "$OG_ROOT/data" \ + --nodename=clickbench -w 'Clickbench@123' -E UTF8 --locale=C -A trust + +memory_kb=$(awk '/MemTotal/ {print $2}' /proc/meminfo) +threads=$(nproc) + +# openGauss parallelizes a query only when query_dop is raised above its +# default of 1; without it a 16-core machine runs every scan on one core. +# Half the threads is the same share the postgresql entry hands to +# max_parallel_workers_per_gather, and 64 is the ceiling the GUC accepts. +query_dop=$((threads / 2)) +[ "$query_dop" -lt 1 ] && query_dop=1 +[ "$query_dop" -gt 64 ] && query_dop=64 + +# Every thread of a parallel plan takes a connection slot, so the driver's +# 10-connection throughput test needs roughly 10 x query_dop of them at +# once; with the default 200 it dies with "No free proc is available to +# create a new connection". 30 slots per unit of query_dop leaves room for +# the producer/consumer pairs a stream plan adds on top. +max_connections=$((query_dop * 30 + 200)) + +# openGauss caps the whole instance with max_process_memory (default 12 GB +# regardless of the machine): too small and big GROUP BYs fail with "memory +# is temporarily unavailable", too large and the OOM killer arrives first. +# 80% of RAM, floored at the 2 GB the GUC accepts as a minimum. +max_process_memory=$((memory_kb * 4 / 5)) +[ "$max_process_memory" -lt 2097152 ] && max_process_memory=2097152 + +# Same 25%-of-RAM rule as the row-store entry. cstore_buffers, the CU cache +# the column store reads through, is deliberately left at its default: the +# driver restarts the server and drops the page cache before every query, so +# a large CU cache is never warm when it matters and only costs memory on the +# 32 GB machines. +shared_buffers=$((memory_kb / 4)) +effective_cache_size=$((memory_kb - memory_kb / 4)) + +# An eighth of RAM for the post-load ANALYZE, but never more than 2 GB -- +# t3a.small only has 2 GB in total. +maintenance_work_mem=$((memory_kb / 8)) +[ "$maintenance_work_mem" -gt 2097152 ] && maintenance_work_mem=2097152 + +# 16 MB per segment; 2048 segments is the 32 GB the postgresql entry gives +# max_wal_size, which keeps checkpoints out of the middle of the load. +sudo -u "$OG_USER" tee -a "$OG_ROOT/data/postgresql.conf" >/dev/null < ''` +# would stop meaning what it means in every other entry. +og gsql -d postgres -c "DROP DATABASE IF EXISTS test" +og gsql -d postgres -c "CREATE DATABASE test DBCOMPATIBILITY = 'PG'" + +og gsql -v ON_ERROR_STOP=1 -d test -t < create.sql + +# TRUNCATE and COPY FREEZE in one transaction, as in the postgresql entry: +# openGauss only allows COPY FREEZE when the table was created or truncated +# in the current subtransaction. +{ + echo 'BEGIN;' + echo 'TRUNCATE TABLE hits;' + echo "COPY hits FROM STDIN WITH (FREEZE);" + cat hits.tsv + echo '\.' + echo 'COMMIT;' +} | og gsql -v ON_ERROR_STOP=1 -d test -t + +og gsql -v ON_ERROR_STOP=1 -d test -t -c 'ANALYZE hits' + +# Only remove inputs once load completes successfully. +rm -f hits.tsv +sync diff --git a/opengauss-column/queries.sql b/opengauss-column/queries.sql new file mode 100644 index 0000000000..31f65fc898 --- /dev/null +++ b/opengauss-column/queries.sql @@ -0,0 +1,43 @@ +SELECT COUNT(*) FROM hits; +SELECT COUNT(*) FROM hits WHERE AdvEngineID <> 0; +SELECT SUM(AdvEngineID), COUNT(*), AVG(ResolutionWidth) FROM hits; +SELECT AVG(UserID) FROM hits; +SELECT COUNT(DISTINCT UserID) FROM hits; +SELECT COUNT(DISTINCT SearchPhrase) FROM hits; +SELECT MIN(EventDate), MAX(EventDate) FROM hits; +SELECT AdvEngineID, COUNT(*) FROM hits WHERE AdvEngineID <> 0 GROUP BY AdvEngineID ORDER BY COUNT(*) DESC; +SELECT RegionID, COUNT(DISTINCT UserID) AS u FROM hits GROUP BY RegionID ORDER BY u DESC LIMIT 10; +SELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID) FROM hits GROUP BY RegionID ORDER BY c DESC LIMIT 10; +SELECT MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhoneModel ORDER BY u DESC LIMIT 10; +SELECT MobilePhone, MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhone, MobilePhoneModel ORDER BY u DESC LIMIT 10; +SELECT SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT SearchPhrase, COUNT(DISTINCT UserID) AS u FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY u DESC LIMIT 10; +SELECT SearchEngineID, SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT UserID, COUNT(*) FROM hits GROUP BY UserID ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase LIMIT 10; +SELECT UserID, extract(minute FROM EventTime) AS m, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, m, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID FROM hits WHERE UserID = 435090932899640449; +SELECT COUNT(*) FROM hits WHERE URL LIKE '%google%'; +SELECT SearchPhrase, MIN(URL), COUNT(*) AS c FROM hits WHERE URL LIKE '%google%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT SearchPhrase, MIN(URL), MIN(Title), COUNT(*) AS c, COUNT(DISTINCT UserID) FROM hits WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT * FROM hits WHERE URL LIKE '%google%' ORDER BY EventTime LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY SearchPhrase LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime, SearchPhrase LIMIT 10; +SELECT CounterID, AVG(length(URL)) AS l, COUNT(*) AS c FROM hits WHERE URL <> '' GROUP BY CounterID HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25; +SELECT REGEXP_REPLACE(Referer, '^https?://(?:www\.)?([^/]+)/.*$', '\1') AS k, AVG(length(Referer)) AS l, COUNT(*) AS c, MIN(Referer) FROM hits WHERE Referer <> '' GROUP BY k HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25; +SELECT SUM(ResolutionWidth), SUM(ResolutionWidth + 1), SUM(ResolutionWidth + 2), SUM(ResolutionWidth + 3), SUM(ResolutionWidth + 4), SUM(ResolutionWidth + 5), SUM(ResolutionWidth + 6), SUM(ResolutionWidth + 7), SUM(ResolutionWidth + 8), SUM(ResolutionWidth + 9), SUM(ResolutionWidth + 10), SUM(ResolutionWidth + 11), SUM(ResolutionWidth + 12), SUM(ResolutionWidth + 13), SUM(ResolutionWidth + 14), SUM(ResolutionWidth + 15), SUM(ResolutionWidth + 16), SUM(ResolutionWidth + 17), SUM(ResolutionWidth + 18), SUM(ResolutionWidth + 19), SUM(ResolutionWidth + 20), SUM(ResolutionWidth + 21), SUM(ResolutionWidth + 22), SUM(ResolutionWidth + 23), SUM(ResolutionWidth + 24), SUM(ResolutionWidth + 25), SUM(ResolutionWidth + 26), SUM(ResolutionWidth + 27), SUM(ResolutionWidth + 28), SUM(ResolutionWidth + 29), SUM(ResolutionWidth + 30), SUM(ResolutionWidth + 31), SUM(ResolutionWidth + 32), SUM(ResolutionWidth + 33), SUM(ResolutionWidth + 34), SUM(ResolutionWidth + 35), SUM(ResolutionWidth + 36), SUM(ResolutionWidth + 37), SUM(ResolutionWidth + 38), SUM(ResolutionWidth + 39), SUM(ResolutionWidth + 40), SUM(ResolutionWidth + 41), SUM(ResolutionWidth + 42), SUM(ResolutionWidth + 43), SUM(ResolutionWidth + 44), SUM(ResolutionWidth + 45), SUM(ResolutionWidth + 46), SUM(ResolutionWidth + 47), SUM(ResolutionWidth + 48), SUM(ResolutionWidth + 49), SUM(ResolutionWidth + 50), SUM(ResolutionWidth + 51), SUM(ResolutionWidth + 52), SUM(ResolutionWidth + 53), SUM(ResolutionWidth + 54), SUM(ResolutionWidth + 55), SUM(ResolutionWidth + 56), SUM(ResolutionWidth + 57), SUM(ResolutionWidth + 58), SUM(ResolutionWidth + 59), SUM(ResolutionWidth + 60), SUM(ResolutionWidth + 61), SUM(ResolutionWidth + 62), SUM(ResolutionWidth + 63), SUM(ResolutionWidth + 64), SUM(ResolutionWidth + 65), SUM(ResolutionWidth + 66), SUM(ResolutionWidth + 67), SUM(ResolutionWidth + 68), SUM(ResolutionWidth + 69), SUM(ResolutionWidth + 70), SUM(ResolutionWidth + 71), SUM(ResolutionWidth + 72), SUM(ResolutionWidth + 73), SUM(ResolutionWidth + 74), SUM(ResolutionWidth + 75), SUM(ResolutionWidth + 76), SUM(ResolutionWidth + 77), SUM(ResolutionWidth + 78), SUM(ResolutionWidth + 79), SUM(ResolutionWidth + 80), SUM(ResolutionWidth + 81), SUM(ResolutionWidth + 82), SUM(ResolutionWidth + 83), SUM(ResolutionWidth + 84), SUM(ResolutionWidth + 85), SUM(ResolutionWidth + 86), SUM(ResolutionWidth + 87), SUM(ResolutionWidth + 88), SUM(ResolutionWidth + 89) FROM hits; +SELECT SearchEngineID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT URL, COUNT(*) AS c FROM hits GROUP BY URL ORDER BY c DESC LIMIT 10; +SELECT 1, URL, COUNT(*) AS c FROM hits GROUP BY 1, URL ORDER BY c DESC LIMIT 10; +SELECT ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3, COUNT(*) AS c FROM hits GROUP BY ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3 ORDER BY c DESC LIMIT 10; +SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND URL <> '' GROUP BY URL ORDER BY PageViews DESC LIMIT 10; +SELECT Title, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND Title <> '' GROUP BY Title ORDER BY PageViews DESC LIMIT 10; +SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND IsLink <> 0 AND IsDownload = 0 GROUP BY URL ORDER BY PageViews DESC LIMIT 10 OFFSET 1000; +SELECT TraficSourceID, SearchEngineID, AdvEngineID, CASE WHEN (SearchEngineID = 0 AND AdvEngineID = 0) THEN Referer ELSE '' END AS Src, URL AS Dst, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 GROUP BY TraficSourceID, SearchEngineID, AdvEngineID, Src, Dst ORDER BY PageViews DESC LIMIT 10 OFFSET 1000; +SELECT URLHash, EventDate, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND TraficSourceID IN (-1, 6) AND RefererHash = 3594120000172545465 GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 10 OFFSET 100; +SELECT WindowClientWidth, WindowClientHeight, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND DontCountHits = 0 AND URLHash = 2868770270353813622 GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10 OFFSET 10000; +SELECT DATE_TRUNC('minute', EventTime) AS M, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-14' AND EventDate <= '2013-07-15' AND IsRefresh = 0 AND DontCountHits = 0 GROUP BY DATE_TRUNC('minute', EventTime) ORDER BY DATE_TRUNC('minute', EventTime) LIMIT 10 OFFSET 1000; diff --git a/opengauss-column/query b/opengauss-column/query new file mode 100755 index 0000000000..a600743c85 --- /dev/null +++ b/opengauss-column/query @@ -0,0 +1,30 @@ +#!/bin/bash +# Reads a SQL query from stdin, runs it via gsql against the `test` DB. +# Stdout: query result. +# Stderr: query runtime in fractional seconds on the last line (parsed from +# gsql's `\timing` output). +# Exit non-zero on error. +set -e + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +query=$(cat) + +out=$(printf '\\timing\n%s\n' "$query" | + sudo -u "$OG_USER" "$OG_ROOT/run" gsql -d test -t 2>&1) || true + +# gsql prints "ERROR:"/"FATAL:" on a failed query but still exits 0. +if printf '%s\n' "$out" | grep -q '^ERROR\|^FATAL\|^gsql: '; then + printf '%s\n' "$out" >&2 + exit 1 +fi + +printf '%s\n' "$out" | grep -v '^Time:' || true + +time_ms=$(printf '%s\n' "$out" | grep -oP 'Time:\s+\K[0-9]+\.[0-9]+' | tail -n1) +if [ -z "$time_ms" ]; then + echo "no timing in gsql output" >&2 + exit 1 +fi +awk -v ms="$time_ms" 'BEGIN { printf "%.3f\n", ms / 1000 }' >&2 diff --git a/opengauss-column/results/20260901/c6a.4xlarge.json b/opengauss-column/results/20260901/c6a.4xlarge.json new file mode 100644 index 0000000000..ae84fd1687 --- /dev/null +++ b/opengauss-column/results/20260901/c6a.4xlarge.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-01", + "machine": "c6a.4xlarge", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1464, + "data_size": 19794241971, + "concurrent_qps": 0.23, + "concurrent_error_ratio": 0, + "result": [ + [0.204, 0.057, 0.056], + [0.385, 0.206, 0.201], + [0.494, 0.233, 0.21], + [0.875, 0.461, 0.425], + [5.418, 5.027, 5.074], + [3.712, 3.388, 3.332], + [0.136, 0.011, 0.01], + [0.383, 0.238, 0.252], + [7.957, 7.603, 7.479], + [13.698, 13.519, 13.711], + [1.512, 1.063, 1.047], + [1.854, 1.574, 1.595], + [3.365, 2.938, 2.915], + [3.784, 3.237, 3.212], + [7.957, 7.25, 7.288], + [5.224, 4.783, 4.822], + [7.681, 7.44, 7.423], + [5.822, 5.503, 5.525], + [11.594, 11.304, 11.539], + [0.348, 0.066, 0.052], + [8.751, 2.823, 2.832], + [10.07, 2.967, 2.963], + [19.113, 4.222, 4.161], + [49.492, 12.422, 12.379], + [2.567, 0.856, 0.846], + [1.219, 0.855, 0.838], + [2.612, 0.993, 0.866], + [8.735, 3.495, 3.52], + [60.628, 70.368, 69.748], + [20.099, 21.648, 19.889], + [5.998, 5.283, 5.188], + [5.417, 2.477, 2.476], + [14.773, 14.624, 14.734], + [15.826, 14.227, 14.212], + [54.514, 53.088, 53.335], + [9.275, 9.034, 9.037], + [0.333, 0.142, 0.14], + [0.267, 0.08, 0.074], + [0.258, 0.04, 0.038], + [0.884, 0.635, 0.653], + [0.238, 0.052, 0.051], + [0.236, 0.04, 0.041], + [0.247, 0.075, 0.082] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c6a.2xlarge.json b/opengauss-column/results/20260902/c6a.2xlarge.json new file mode 100644 index 0000000000..244c9eb6ed --- /dev/null +++ b/opengauss-column/results/20260902/c6a.2xlarge.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c6a.2xlarge", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1501, + "data_size": 19811017472, + "concurrent_qps": 0.128, + "concurrent_error_ratio": 0, + "result": [ + [0.229, 0.103, 0.102], + [0.553, 0.388, 0.397], + [0.731, 0.399, 0.388], + [1.415, 0.832, 0.832], + [9.587, 9.159, 8.966], + [6.483, 5.772, 5.667], + [0.136, 0.011, 0.01], + [0.574, 0.417, 0.4], + [11.798, 11.431, 11.487], + [19.897, 19.67, 19.693], + [2.615, 1.788, 1.891], + [2.281, 1.589, 1.555], + [6.389, 5.651, 5.669], + [7.09, 6.109, 6.229], + [10.28, 9.551, 9.469], + [11.524, 10.916, 10.84], + [13.461, 13.146, 13.093], + [9.72, 9.262, 9.371], + [20.515, 20.513, 20.244], + [0.575, 0.117, 0.095], + [8.636, 5.414, 5.412], + [10.093, 5.655, 5.668], + [19.184, 7.848, 7.758], + [50.163, 12.475, 12.695], + [2.837, 1.713, 1.697], + [2.218, 1.5, 1.531], + [2.946, 1.615, 1.654], + [9.215, 6.848, 6.759], + [121.653, 119.135, 118.716], + [39.875, 39.524, 39.515], + [8.105, 6.969, 6.978], + [6.129, 4.55, 4.506], + [25.379, 24.278, 24.101], + [30.762, 26.855, 27.256], + [64.115, 60.014, 60.203], + [12.232, 11.571, 11.748], + [0.366, 0.146, 0.153], + [0.295, 0.08, 0.094], + [0.271, 0.038, 0.045], + [0.967, 0.703, 0.698], + [0.266, 0.054, 0.053], + [0.264, 0.048, 0.041], + [0.307, 0.083, 0.071] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c6a.4xlarge.json b/opengauss-column/results/20260902/c6a.4xlarge.json new file mode 100644 index 0000000000..55575734e8 --- /dev/null +++ b/opengauss-column/results/20260902/c6a.4xlarge.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c6a.4xlarge", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1471, + "data_size": 19794250163, + "concurrent_qps": 0.24, + "concurrent_error_ratio": 0, + "result": [ + [0.2, 0.058, 0.057], + [0.382, 0.205, 0.227], + [0.542, 0.204, 0.203], + [0.882, 0.439, 0.431], + [4.768, 4.376, 4.368], + [3.425, 2.988, 2.944], + [0.14, 0.014, 0.011], + [0.367, 0.212, 0.238], + [7.978, 7.722, 7.735], + [13.986, 13.786, 13.657], + [1.616, 1.123, 1.136], + [1.946, 1.614, 1.637], + [3.914, 3.442, 3.463], + [4.041, 3.542, 3.514], + [7.685, 7.174, 7.308], + [5.51, 5.027, 4.999], + [7.939, 7.489, 7.55], + [5.981, 5.689, 5.591], + [11.926, 11.554, 11.496], + [0.366, 0.085, 0.065], + [8.661, 2.854, 2.855], + [10.042, 3.009, 3.006], + [19.113, 4.308, 4.316], + [49.502, 12.674, 13.153], + [2.572, 1.074, 0.888], + [1.281, 0.8, 0.955], + [2.617, 0.924, 0.905], + [8.709, 3.583, 3.56], + [61.443, 59.655, 59.963], + [19.991, 19.632, 19.74], + [6.484, 5.553, 5.521], + [5.441, 2.56, 2.595], + [14.97, 14.873, 14.804], + [15.958, 14.516, 14.586], + [55.073, 54.398, 54.33], + [9.162, 8.953, 8.931], + [0.339, 0.136, 0.143], + [0.271, 0.08, 0.08], + [0.266, 0.037, 0.035], + [0.879, 0.648, 0.636], + [0.245, 0.045, 0.051], + [0.244, 0.041, 0.04], + [0.264, 0.071, 0.068] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c6a.large.json b/opengauss-column/results/20260902/c6a.large.json new file mode 100644 index 0000000000..6a367e442f --- /dev/null +++ b/opengauss-column/results/20260902/c6a.large.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c6a.large", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1617, + "data_size": 19609581681, + "concurrent_qps": 0.042, + "concurrent_error_ratio": 0, + "result": [ + [0.49, 0.38, 0.376], + [1.804, 1.483, 1.545], + [2.214, 1.647, 1.623], + [3.835, 3.247, 3.2], + [227.058, 224.254, 223.769], + [185.619, 184.447, 185.43], + [0.134, 0.012, 0.013], + [1.817, 1.464, 1.464], + [279.143, 280.515, 284.959], + [301.879, 301.671, 302.299], + [21.144, 20.323, 20.376], + [22.354, 22.182, 21.959], + [17.909, 17.418, 17.657], + [95.548, 93.652, 92.559], + [17.936, 16.194, 16.612], + [31.223, 30.403, 30.245], + [38.121, 36.91, 37.024], + [23.243, 22.006, 22.132], + [68.041, 67.922, 67.655], + [1.358, 0.393, 0.381], + [27.965, 26.265, 21.839], + [29.294, 29.105, 29.074], + [43.301, 43.076, 42.917], + [83.757, 81.399, 81.512], + [7.877, 6.083, 6.071], + [6.952, 5.878, 5.904], + [8.169, 6.555, 6.638], + [33.344, 30.231, 29.355], + [467.549, 461.174, 462.902], + [161.136, 158.953, 158.584], + [16.309, 14.57, 14.686], + [19.485, 16.065, 16.076], + [87.807, 82.856, 84.583], + [86.966, 85.24, 85.741], + [100.248, 99.294, 98.679], + [35.955, 35.191, 34.55], + [0.71, 0.368, 0.372], + [0.452, 0.215, 0.219], + [0.408, 0.071, 0.07], + [1.355, 0.862, 0.861], + [0.366, 0.124, 0.12], + [0.321, 0.081, 0.081], + [0.419, 0.207, 0.206] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c6a.metal.json b/opengauss-column/results/20260902/c6a.metal.json new file mode 100644 index 0000000000..7b51202279 --- /dev/null +++ b/opengauss-column/results/20260902/c6a.metal.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c6a.metal", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1418, + "data_size": 19610194641, + "concurrent_qps": 0.727, + "concurrent_error_ratio": 0.16, + "result": [ + [0.138, 0.057, 0.051], + [0.212, 0.108, 0.11], + [0.272, 0.116, 0.114], + [1.371, 0.168, 0.201], + [3.258, 3.19, 3.117], + [1.174, 1.011, 1.235], + [0.125, 0.059, 0.038], + [0.234, 0.122, 0.12], + [10.702, 10.291, 10.477], + [21.471, 20.368, 21.164], + [1.319, 1.115, 1.116], + [2.026, 1.943, 1.975], + [1.36, 1.202, 1.181], + [2.533, 1.444, 1.455], + [9.466, 9.382, 9.721], + [3.833, 4.069, 3.912], + [7.336, 7.905, 7.203], + [7.504, 5.837, 6.118], + [10.781, 10.127, 10.265], + [0.255, 0.079, 0.056], + [8.605, null, null], + [10.068, null, null], + [19.135, null, null], + [48.091, 14.387, null], + [2.601, 0.317, 0.334], + [0.571, 0.295, 0.287], + [2.597, 0.376, 0.365], + [8.664, null, null], + [12.402, 12.702, 12.811], + [5.031, 5.187, 5.33], + [7.601, 7.582, 7.622], + [4.928, 1.647, 1.659], + [14.337, 12.528, 13.083], + [null, null, null], + [72.498, null, 72.699], + [12.55, 12.69, 13.112], + [0.257, 0.153, 0.15], + [0.247, 0.116, 0.174], + [0.24, 0.088, 0.087], + [1.263, 1.068, 1.073], + [0.233, 0.094, 0.093], + [0.239, 0.096, 0.144], + [0.251, 0.117, 0.113] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c6a.xlarge.json b/opengauss-column/results/20260902/c6a.xlarge.json new file mode 100644 index 0000000000..f858f8f94e --- /dev/null +++ b/opengauss-column/results/20260902/c6a.xlarge.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c6a.xlarge", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1555, + "data_size": 19626229418, + "concurrent_qps": 0.093, + "concurrent_error_ratio": 0, + "result": [ + [0.309, 0.193, 0.194], + [0.965, 0.765, 0.75], + [1.162, 0.772, 0.761], + [2.2, 1.644, 1.62], + [16.788, 16.139, 16.213], + [13.623, 12.8, 12.82], + [0.139, 0.012, 0.012], + [0.999, 0.771, 0.772], + [18.532, 18.113, 17.971], + [30.516, 30.448, 29.971], + [3.664, 3.088, 2.971], + [3.23, 2.593, 2.516], + [14.805, 13.032, 13.227], + [14.843, 13.625, 13.968], + [15.878, 15.698, 15.071], + [22.739, 21.388, 21.393], + [24.581, 24.034, 23.945], + [16.524, 16.109, 16.028], + [38.595, 38.342, 38.345], + [0.983, 0.223, 0.172], + [14.941, 11.089, 11.146], + [15.636, 11.58, 11.478], + [23.024, 15.962, 15.76], + [51.21, 44.537, 44.56], + [4.732, 3.343, 3.392], + [3.839, 3.107, 3.056], + [4.729, 3.321, 3.382], + [17.563, 13.73, 13.695], + [242.735, 241.085, 238.681], + [79.016, 79.114, 79.365], + [12.754, 12.141, 12.162], + [9.878, 8.052, 8.038], + [46.594, 46.221, 45.907], + [66.829, 61.63, 61.024], + [100.018, 96.021, 99.83], + [24.232, 23.813, 23.642], + [0.524, 0.277, 0.263], + [0.366, 0.137, 0.138], + [0.335, 0.054, 0.055], + [1.035, 0.744, 0.776], + [0.309, 0.082, 0.088], + [0.317, 0.059, 0.06], + [0.341, 0.121, 0.115] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c7a.metal-48xl.json b/opengauss-column/results/20260902/c7a.metal-48xl.json new file mode 100644 index 0000000000..61a1b577df --- /dev/null +++ b/opengauss-column/results/20260902/c7a.metal-48xl.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c7a.metal-48xl", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1320, + "data_size": 19811516832, + "concurrent_qps": 1.133, + "concurrent_error_ratio": 0.192, + "result": [ + [0.124, 0.037, 0.035], + [0.163, 0.094, 0.058], + [0.206, 0.059, 0.059], + [0.338, 0.089, 0.089], + [4.659, 4.401, 4.157], + [1.126, 0.969, 0.95], + [0.129, 0.03, 0.029], + [0.184, 0.093, 0.086], + [10.685, 10.873, 10.811], + [21.2, 18.63, 20.501], + [1.148, 0.87, 0.873], + [1.822, 1.71, 1.71], + [1.702, 1.461, 1.519], + [2.601, 1.596, 1.583], + [15.511, 15.449, 15.439], + [4.746, 4.975, 4.619], + [6.197, 6.182, 6.096], + [6.116, 6.02, 5.976], + [8.994, 8.827, 8.787], + [0.262, 0.039, 0.035], + [8.613, null, null], + [10.069, null, null], + [19.158, null, null], + [48.194, null, null], + [2.617, 0.167, 0.168], + [0.579, 0.167, 0.163], + [2.608, 0.18, 0.174], + [8.688, null, null], + [9.032, 8.547, 8.83], + [2.742, 2.719, 2.569], + [7.895, 7.001, 7.061], + [4.834, 1.26, 1.282], + [10.167, 10.104, 9.449], + [9.663, null, null], + [72.006, null, null], + [10.396, 10.251, 10.483], + [0.332, 0.172, 0.174], + [0.219, 0.083, 0.081], + [0.23, 0.074, 0.07], + [1.193, 1.02, 1.017], + [0.216, 0.077, 0.078], + [0.217, 0.075, 0.077], + [0.217, 0.085, 0.088] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c8g.4xlarge.json b/opengauss-column/results/20260902/c8g.4xlarge.json new file mode 100644 index 0000000000..36c3858d92 --- /dev/null +++ b/opengauss-column/results/20260902/c8g.4xlarge.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c8g.4xlarge", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1200, + "data_size": 19995559761, + "concurrent_qps": 0.368, + "concurrent_error_ratio": 0, + "result": [ + [0.185, 0.083, 0.083], + [0.33, 0.2, 0.205], + [0.54, 0.313, 0.313], + [0.71, 0.345, 0.347], + [5.446, 5.208, 5.25], + [3.089, 2.742, 2.721], + [0.123, 0.01, 0.01], + [0.335, 0.204, 0.203], + [8.574, 8.329, 8.8], + [14.72, 15, 14.842], + [1.968, 1.188, 1.163], + [1.402, 1.052, 1.047], + [2.983, 2.621, 2.651], + [3.292, 2.804, 2.809], + [7.393, 6.951, 6.905], + [5.718, 5.496, 5.483], + [9.346, 9.083, 9.214], + [7.391, 7.164, 7.139], + [13.306, 13.347, 13.348], + [0.343, 0.058, 0.045], + [8.633, 2.313, 2.307], + [10.049, 2.421, 2.414], + [19.121, 3.085, 3.08], + [49.543, 8.746, 8.697], + [2.581, 0.819, 0.816], + [1.071, 0.758, 0.766], + [2.606, 0.827, 0.821], + [8.667, 2.762, 2.768], + [56.276, 55.464, 55.507], + [18.434, 18.09, 18.401], + [6.176, 5.53, 5.475], + [5.314, 2.274, 2.306], + [15.888, 15.646, 15.261], + [14.162, 12.045, 12.07], + [54.6, 53.713, 53.68], + [8.904, 8.602, 8.699], + [0.282, 0.108, 0.108], + [0.22, 0.059, 0.058], + [0.222, 0.032, 0.032], + [0.819, 0.629, 0.624], + [0.216, 0.044, 0.045], + [0.211, 0.031, 0.032], + [0.211, 0.055, 0.055] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/c8g.metal-48xl.json b/opengauss-column/results/20260902/c8g.metal-48xl.json new file mode 100644 index 0000000000..d17387b260 --- /dev/null +++ b/opengauss-column/results/20260902/c8g.metal-48xl.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "c8g.metal-48xl", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 1251, + "data_size": 20096741487, + "concurrent_qps": 0.762, + "concurrent_error_ratio": 0.264, + "result": [ + [0.138, 0.112, 0.105], + [0.163, 0.124, 0.115], + [0.189, 0.126, 0.129], + [0.306, 0.144, 0.131], + [5.052, 4.982, 4.975], + [1.072, 1.102, 1.032], + [0.114, 0.102, 0.104], + [0.315, 0.267, 0.265], + [10.306, 8.896, 10.905], + [20.894, 20.423, 18.207], + [1.35, 1.152, 1.156], + [1.029, 0.928, 0.927], + [1.192, 1.161, 1.19], + [2.248, 1.424, 1.352], + [10.345, 10.436, 10.398], + [5.386, 6.77, 5.313], + [8.305, 8.233, 8.317], + [7.546, 7.641, 7.695], + [11.426, 11.167, 11.299], + [0.276, 0.113, 0.119], + [8.581, null, null], + [10.043, null, null], + [19.163, null, null], + [48.042, null, null], + [2.58, 0.263, 0.234], + [0.548, 0.212, 0.209], + [2.585, 0.235, 0.246], + [8.638, null, null], + [10.027, 8.8, 8.839], + [2.626, 2.52, 2.569], + [7.44, 7.583, 7.514], + [4.803, 1.983, 1.946], + [13.881, 14.536, 16.376], + [9.516, null, null], + [null, null, null], + [15.904, 13.117, 13.193], + [0.351, 0.296, 0.298], + [0.343, 0.285, 0.284], + [0.314, 0.244, 0.25], + [1.232, 1.167, 1.17], + [0.28, 0.252, 0.24], + [0.322, 0.27, 0.263], + [0.338, 0.29, 0.287] +] + } + \ No newline at end of file diff --git a/opengauss-column/results/20260902/t3a.small.json b/opengauss-column/results/20260902/t3a.small.json new file mode 100644 index 0000000000..574c30b29e --- /dev/null +++ b/opengauss-column/results/20260902/t3a.small.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss (column store)", + "date": "2026-09-02", + "machine": "t3a.small", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 3212, + "data_size": 19073005513, + "concurrent_qps": 0.033, + "concurrent_error_ratio": 0, + "result": [ + [1.492, 1.411, 1.212], + [3.651, 3.332, 3.322], + [6.005, 5.132, 5.123], + [8.215, 7.493, 7.459], + [491.984, 487.055, 483.622], + [477.374, 472.494, 472.203], + [0.159, 0.029, 0.029], + [3.699, 3.33, 3.322], + [619.884, 615.828, 609.594], + [626.11, 627.519, 632.78], + [42.878, 42.144, 42.13], + [46.795, 46.228, 46.205], + [29.577, 29.435, 28.92], + [214.633, 215.922, 212.643], + [32.82, 31.683, 31.648], + [51.528, 50.188, 51.325], + [74.511, 74.423, 74.484], + [41.766, 41.106, 41.009], + [128.956, 131.293, 136.395], + [1.839, 0.817, 0.818], + [48.629, 48.048, 47.662], + [50.927, 50.315, 50.158], + [74.444, 75.441, 75.886], + [124.851, 124.592, 122.255], + [15.329, 15.281, 15.078], + [13.847, 12.681, 14.254], + [15.608, 15.419, 15.218], + [68.952, 69.995, 81.205], + [1249.275, 1230.164, 1217.014], + [456.486, 453.442, 462.752], + [35.74, 34.017, 35.747], + [40.463, 40.348, 40.843], + [191.842, 188.868, 195.356], + [183.097, 182.026, 188.622], + [217.564, 211.959, 215.512], + [71.65, 72.279, 72.442], + [1.254, 0.839, 0.844], + [0.835, 0.518, 0.517], + [0.594, 0.162, 0.156], + [2.4, 1.795, 1.781], + [0.569, 0.277, 0.279], + [0.46, 0.173, 0.19], + [0.748, 0.522, 0.532] +] + } + \ No newline at end of file diff --git a/opengauss-column/start b/opengauss-column/start new file mode 100755 index 0000000000..a226506a8b --- /dev/null +++ b/opengauss-column/start @@ -0,0 +1,14 @@ +#!/bin/bash +set -eu + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# setsid: gs_ctl forks the server but leaves it in the caller's process +# group and session, so anything that later signals that group -- a +# `timeout` around the driver, a killed shell -- takes the database down +# with it. Detaching here keeps the server alive for the next ./query. +# -t bounds the wait: the driver's own check loop is the authoritative +# readiness signal, so there is no reason for gs_ctl to sit here longer. +sudo -u "$OG_USER" setsid "$OG_ROOT/run" gs_ctl start -D "$OG_ROOT/data" \ + -Z single_node -t 300 -l "$OG_ROOT/log/gs_ctl.log" diff --git a/opengauss-column/stop b/opengauss-column/stop new file mode 100755 index 0000000000..6019bc5cb0 --- /dev/null +++ b/opengauss-column/stop @@ -0,0 +1,9 @@ +#!/bin/bash + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# Bounded so a stuck shutdown cannot eat a cold cycle; the driver waits for +# ./check to start failing afterwards either way. +sudo -u "$OG_USER" "$OG_ROOT/run" gs_ctl stop -D "$OG_ROOT/data" \ + -Z single_node -m fast -t 120 || true diff --git a/opengauss-column/template.json b/opengauss-column/template.json new file mode 100644 index 0000000000..2989e6724f --- /dev/null +++ b/opengauss-column/template.json @@ -0,0 +1,11 @@ +{ + "system": "openGauss (column store)", + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": [ + "C++", + "column-oriented", + "PostgreSQL compatible" + ] +} diff --git a/opengauss/README.md b/opengauss/README.md new file mode 100644 index 0000000000..4339493e55 --- /dev/null +++ b/opengauss/README.md @@ -0,0 +1,173 @@ +openGauss is an open-source (Mulan PSL v2) relational DBMS released by Huawei +in 2020 and now developed in the openGauss community. Its kernel is a fork of +PostgreSQL 9.2.4 — `SHOW server_version` still answers `9.2.4` — rewritten in +C++ and extended with a thread-per-session model, a vectorized executor, a +column store, and the in-memory MOT engine. + +This entry uses the row store, which is what a plain `CREATE TABLE` gives you. +`opengauss-column` is the same setup with `ORIENTATION = COLUMN` tables, which +is what the vendor documentation prescribes for OLAP; see the numbers in that +directory's README. + +To run the benchmark: + +``` +./benchmark.sh +``` + +## Installation + +openGauss publishes binaries for openEuler and CentOS only, so there is no apt +repository to point Ubuntu at. `install` downloads the 6.0.5 LTS *openEuler +20.03* server tarball — published for both `x86_64` and `aarch64` — which is +built against glibc 2.28 and runs unmodified on Ubuntu once two sonames are +bridged: + +- `libaio.so.1`, which Ubuntu renamed to `libaio.so.1t64` in the 64-bit + `time_t` transition. That transition is an ABI no-op on a 64-bit machine, so + the symlink is safe. +- `libreadline.so.7`, where Ubuntu ships readline 8. Only `gsql` links it, and + only for interactive line editing, which the benchmark never does. + +Both symlinks live in `/opt/opengauss/compat`, which is on `LD_LIBRARY_PATH`; +nothing outside `/opt/opengauss` is touched. Everything else the binaries need +that isn't glibc — OpenSSL 1.1, libxml2, libcurl, libstdc++, Kerberos — is +bundled in the tarball's own `lib/`. + +The server refuses to run as root, so `install` creates the conventional `omm` +user, and every other script reaches the database through +`sudo -u omm /opt/opengauss/run`, a wrapper written at install time that +sources `GAUSSHOME`, `LD_LIBRARY_PATH`, `PGDATA`, `PGPORT` and `PGHOST`. + +## `DBCOMPATIBILITY = 'PG'` + +`./load` creates the database with `DBCOMPATIBILITY = 'PG'`, and that is not +cosmetic. openGauss defaults to `'A'` (Oracle) compatibility, in which the +empty string *is* NULL. Under the default the load stops on the first row of +`hits.tsv`: + +``` +ERROR: null value in column "referer" violates not-null constraint +``` + +and had the schema not been `NOT NULL` throughout, the loss would have been +silent instead: the 16 queries that filter on `<> ''` would have been +comparing against NULL and matching nothing, and the affected columns are not +marginal — 94.4% of `MobilePhoneModel`, 86.8% of `SearchPhrase`, 19.0% of +`Referer` and 14.9% of `Title` are the empty string in this dataset. `'PG'` +mode restores PostgreSQL's semantics, which is what the rest of this benchmark +assumes. + +## Loading + +The benchmark VMs check the repository out under root's home directory, which +`omm` cannot traverse, so `./load` hands `create.sql` and `hits.tsv` to `gsql` +on stdin instead of by path. Server-side `COPY FROM ''` and client-side +`\copy` load at the same speed here, so nothing is lost by doing it this way. + +As in the `postgresql` entry, the `TRUNCATE` and the `COPY ... WITH (FREEZE)` +share one transaction — openGauss keeps PostgreSQL's rule that a table has to +have been created or truncated in the current subtransaction for `FREEZE` to +be accepted. + +## Configuration + +`install` sets the same knobs as the `postgresql` entry, sized from +`MemTotal`: `shared_buffers` at a quarter of RAM, `effective_cache_size` at +three quarters, `work_mem` at 64 MB. Two of them are openGauss-specific: + +- `max_process_memory` is a hard ceiling on everything the instance allocates, + and it defaults to 12 GB no matter how large the machine is. Left alone it + would cap a `c7a.metal-48xl` at a twelfth of its RAM; set too high it invites + the OOM killer instead. `install` uses 80% of RAM, floored at the 2 GB the + GUC accepts as its minimum. +- openGauss has no `max_wal_size`; the pre-9.5 `checkpoint_segments` is still + the knob, and 2048 segments is the same 32 GB the `postgresql` entry + allocates. +- The open-file budget has to be raised in two places or hash aggregations + that spill die with `could not create temporary file ...: Too many open + files`. openGauss derives `max_safe_fds` from the shell's `ulimit -n`, which + cloud-init leaves at 1024, so the `run` wrapper raises it to the 1000000 + openGauss's own installation guide asks for; and `max_files_per_process` + caps the budget again at 1000 on top of that, independently of the OS, so + `install` raises it too. A machine with a generous default `ulimit` hides + this completely, which is how it survived local testing and failed on the + first c6a.4xlarge run. + +## Parallelism + +openGauss runs a query on one thread unless `query_dop` is raised above its +default of 1, and the difference is not marginal. Measured back to back on a +1% slice of the dataset, moving from `query_dop = 1` to `query_dop = 8` took +Q34 (`GROUP BY URL`) from 20.5 s to 0.87 s, Q30 (90 `SUM`s over one column) +from 5.4 s to 0.70 s, and Q21 (`URL LIKE '%google%'`) from 0.35 s to 0.05 s. +`install` therefore sets `query_dop` to half the thread count, the same share +of the machine the `postgresql` entry gives `max_parallel_workers_per_gather`. + +Raising it has a consequence the stock configuration does not survive: every +thread of a parallel plan occupies a connection slot, so the driver's +10-connection throughput test wants roughly `10 x query_dop` of them at once +and, against the default `max_connections = 200`, every worker gets + +``` +FATAL: No free proc is available to create a new connection +``` + +`install` sizes `max_connections` from `query_dop` for that reason. + +## Queries + +The 43 queries are the `postgresql` entry's queries, unmodified — no rewrites, +no substituted functions. All 43 produce results, and every one of them was +compared against `clickhouse-local` reading the same rows: they agree +everywhere except where a `LIMIT` cuts through a run of tied sort keys, and on +`SELECT AVG(UserID)`, where openGauss accumulates the numerator in `numeric` +and returns the exact mean while ClickHouse wraps it in an `Int64`. + +`LIKE` is case-sensitive here, as in PostgreSQL, so Q21-Q24 match the same +rows as in the other PostgreSQL-family entries. + +## Verification + +These scripts were run end to end on the full dataset: `./load` gets exactly +99,997,497 rows in, `./data-size` reports 86.6 GB, and all 43 queries return a +result — none errors, none times out. The correctness comparison against +`clickhouse-local` above was done query by query on a 1% slice. + +As in the `postgresql` entry, every query is a full sequential scan of the +whole table, so on a machine whose RAM cannot hold it the runtimes collapse +onto one number: how fast openGauss can read the table. + +## That number is ~110 MB/s, and it is a problem on small machines + +On c6a.4xlarge every query, cold or warm, takes 670-720 s against a ~72 GB +table — about 103 MB/s. The `postgresql` entry answers the same queries on the +same instance type in ~258 s each against a *larger* table, about 287 MB/s. + +The gap is not the disk. Measured here on NVMe capable of gigabytes per +second, with the page cache dropped before each run, a full scan of a 10M-row +row-store table moves at: + +| `heap_bulk_read_size` | `query_dop` | rate | average read | +| --- | --- | --- | --- | +| 0 (default) | 1 | 107 MB/s | 45 KB | +| 64 | 1 | 112 MB/s | 56 KB | +| 64 | 8 | 120 MB/s | 55 KB | +| 16 | 8 | 123 MB/s | 54 KB | + +The scan sits at ~110 MB/s whatever the storage underneath and whatever +`heap_bulk_read_size`, the seqscan pre-read knob, is set to — and at +`query_dop = 1` a large pre-read makes it worse, reading 25 GB to scan a +6.7 GB table. It is a property of the engine, not of the hardware. + +43 queries x 3 runs x ~700 s is about 25 hours, so on a machine whose RAM +cannot hold the table this entry cannot finish inside the benchmark's 10-hour +cap: the first c6a.4xlarge run got through 23 of the 43 queries. On the +large-memory machines the picture changes, since only the cold run of each +query has to come off the disk and the two warm runs are served from RAM. +Expect results from the metal instances and a timeout from the small ones. + +The `opengauss-column` entry does not have this problem: it reads a sixth as +much data and answered its first 18 queries in a total of 156 seconds. + +No results yet — those need runs on the benchmark's own EC2 machines. diff --git a/opengauss/benchmark.sh b/opengauss/benchmark.sh new file mode 100755 index 0000000000..124a77209b --- /dev/null +++ b/opengauss/benchmark.sh @@ -0,0 +1,3 @@ +#!/bin/bash +export BENCH_DOWNLOAD_SCRIPT="download-hits-tsv" +exec ../lib/benchmark-common.sh diff --git a/opengauss/check b/opengauss/check new file mode 100755 index 0000000000..7787ab7d11 --- /dev/null +++ b/opengauss/check @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# gsql exits 0 even when it cannot connect, so match on the output instead. +out=$(sudo -u "$OG_USER" "$OG_ROOT/run" gsql -d postgres -t -A -c 'SELECT 1' 2>&1) +[ "$out" = "1" ] diff --git a/opengauss/create.sql b/opengauss/create.sql new file mode 100644 index 0000000000..41c961c00f --- /dev/null +++ b/opengauss/create.sql @@ -0,0 +1,108 @@ +CREATE TABLE hits +( + WatchID BIGINT NOT NULL, + JavaEnable SMALLINT NOT NULL, + Title TEXT NOT NULL, + GoodEvent SMALLINT NOT NULL, + EventTime TIMESTAMP NOT NULL, + EventDate Date NOT NULL, + CounterID INTEGER NOT NULL, + ClientIP INTEGER NOT NULL, + RegionID INTEGER NOT NULL, + UserID BIGINT NOT NULL, + CounterClass SMALLINT NOT NULL, + OS SMALLINT NOT NULL, + UserAgent SMALLINT NOT NULL, + URL TEXT NOT NULL, + Referer TEXT NOT NULL, + IsRefresh SMALLINT NOT NULL, + RefererCategoryID SMALLINT NOT NULL, + RefererRegionID INTEGER NOT NULL, + URLCategoryID SMALLINT NOT NULL, + URLRegionID INTEGER NOT NULL, + ResolutionWidth SMALLINT NOT NULL, + ResolutionHeight SMALLINT NOT NULL, + ResolutionDepth SMALLINT NOT NULL, + FlashMajor SMALLINT NOT NULL, + FlashMinor SMALLINT NOT NULL, + FlashMinor2 TEXT NOT NULL, + NetMajor SMALLINT NOT NULL, + NetMinor SMALLINT NOT NULL, + UserAgentMajor SMALLINT NOT NULL, + UserAgentMinor VARCHAR(255) NOT NULL, + CookieEnable SMALLINT NOT NULL, + JavascriptEnable SMALLINT NOT NULL, + IsMobile SMALLINT NOT NULL, + MobilePhone SMALLINT NOT NULL, + MobilePhoneModel TEXT NOT NULL, + Params TEXT NOT NULL, + IPNetworkID INTEGER NOT NULL, + TraficSourceID SMALLINT NOT NULL, + SearchEngineID SMALLINT NOT NULL, + SearchPhrase TEXT NOT NULL, + AdvEngineID SMALLINT NOT NULL, + IsArtifical SMALLINT NOT NULL, + WindowClientWidth SMALLINT NOT NULL, + WindowClientHeight SMALLINT NOT NULL, + ClientTimeZone SMALLINT NOT NULL, + ClientEventTime TIMESTAMP NOT NULL, + SilverlightVersion1 SMALLINT NOT NULL, + SilverlightVersion2 SMALLINT NOT NULL, + SilverlightVersion3 INTEGER NOT NULL, + SilverlightVersion4 SMALLINT NOT NULL, + PageCharset TEXT NOT NULL, + CodeVersion INTEGER NOT NULL, + IsLink SMALLINT NOT NULL, + IsDownload SMALLINT NOT NULL, + IsNotBounce SMALLINT NOT NULL, + FUniqID BIGINT NOT NULL, + OriginalURL TEXT NOT NULL, + HID INTEGER NOT NULL, + IsOldCounter SMALLINT NOT NULL, + IsEvent SMALLINT NOT NULL, + IsParameter SMALLINT NOT NULL, + DontCountHits SMALLINT NOT NULL, + WithHash SMALLINT NOT NULL, + HitColor CHAR NOT NULL, + LocalEventTime TIMESTAMP NOT NULL, + Age SMALLINT NOT NULL, + Sex SMALLINT NOT NULL, + Income SMALLINT NOT NULL, + Interests SMALLINT NOT NULL, + Robotness SMALLINT NOT NULL, + RemoteIP INTEGER NOT NULL, + WindowName INTEGER NOT NULL, + OpenerName INTEGER NOT NULL, + HistoryLength SMALLINT NOT NULL, + BrowserLanguage TEXT NOT NULL, + BrowserCountry TEXT NOT NULL, + SocialNetwork TEXT NOT NULL, + SocialAction TEXT NOT NULL, + HTTPError SMALLINT NOT NULL, + SendTiming INTEGER NOT NULL, + DNSTiming INTEGER NOT NULL, + ConnectTiming INTEGER NOT NULL, + ResponseStartTiming INTEGER NOT NULL, + ResponseEndTiming INTEGER NOT NULL, + FetchTiming INTEGER NOT NULL, + SocialSourceNetworkID SMALLINT NOT NULL, + SocialSourcePage TEXT NOT NULL, + ParamPrice BIGINT NOT NULL, + ParamOrderID TEXT NOT NULL, + ParamCurrency TEXT NOT NULL, + ParamCurrencyID SMALLINT NOT NULL, + OpenstatServiceName TEXT NOT NULL, + OpenstatCampaignID TEXT NOT NULL, + OpenstatAdID TEXT NOT NULL, + OpenstatSourceID TEXT NOT NULL, + UTMSource TEXT NOT NULL, + UTMMedium TEXT NOT NULL, + UTMCampaign TEXT NOT NULL, + UTMContent TEXT NOT NULL, + UTMTerm TEXT NOT NULL, + FromTag TEXT NOT NULL, + HasGCLID SMALLINT NOT NULL, + RefererHash BIGINT NOT NULL, + URLHash BIGINT NOT NULL, + CLID INTEGER NOT NULL +); diff --git a/opengauss/data-size b/opengauss/data-size new file mode 100755 index 0000000000..9f7409f6a0 --- /dev/null +++ b/opengauss/data-size @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu + +OG_ROOT=${OG_ROOT:-/opt/opengauss} + +sudo du -bcs "$OG_ROOT/data" | grep total | awk '{print $1}' diff --git a/opengauss/install b/opengauss/install new file mode 100755 index 0000000000..86ca3718c1 --- /dev/null +++ b/opengauss/install @@ -0,0 +1,135 @@ +#!/bin/bash +# openGauss publishes binaries for openEuler and CentOS only, so there is no +# apt repository to add. The openEuler 20.03 server tarball is glibc 2.28 and +# runs unmodified on Ubuntu once two sonames are bridged: libaio.so.1 (Ubuntu +# renamed it libaio.so.1t64 in the 64-bit time_t transition, an ABI no-op on +# 64-bit) and libreadline.so.7 (Ubuntu ships readline 8, which gsql only uses +# for line editing). Both symlinks live in a private directory that is added +# to LD_LIBRARY_PATH, so nothing outside $OG_ROOT is touched. +set -eu + +OG_VERSION=${OG_VERSION:-6.0.5} +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} +OG_PORT=${OG_PORT:-5432} + +# Nothing to do if a previous run already initialized the cluster. +if [ -f "$OG_ROOT/data/postgresql.conf" ]; then + echo "opengauss: cluster already initialized in $OG_ROOT/data" >&2 + exit 0 +fi + +case "$(uname -m)" in + x86_64) og_arch=x86; og_suffix=x86_64 ;; + aarch64) og_arch=arm; og_suffix=aarch64 ;; + *) echo "opengauss: unsupported architecture $(uname -m)" >&2; exit 1 ;; +esac +og_file="openGauss-Server-${OG_VERSION}-openEuler20.03-${og_suffix}.tar.bz2" +og_url="https://opengauss.obs.cn-south-1.myhuaweicloud.com/${OG_VERSION}/openEuler20.03/${og_arch}/${og_file}" + +sudo apt-get update -y +sudo apt-get install -y wget bzip2 libreadline8 libncurses6 libncursesw6 libtinfo6 libcrypt1 +# libaio1t64 on Ubuntu 24.04+, libaio1 on older releases. +sudo apt-get install -y libaio1t64 || sudo apt-get install -y libaio1 + +# A dedicated OS user: openGauss refuses to start as root. +if ! id "$OG_USER" >/dev/null 2>&1; then + sudo useradd -m -s /bin/bash "$OG_USER" +fi + +sudo mkdir -p "$OG_ROOT/app" "$OG_ROOT/data" "$OG_ROOT/log" "$OG_ROOT/compat" "$OG_ROOT/tmp" + +wget --continue --progress=dot:giga -O "/tmp/$og_file" "$og_url" +sudo tar xjf "/tmp/$og_file" -C "$OG_ROOT/app" +rm -f "/tmp/$og_file" + +libdir="/usr/lib/$(uname -m)-linux-gnu" +sudo ln -sf "$(ls "$libdir"/libaio.so.1* | head -n1)" "$OG_ROOT/compat/libaio.so.1" +sudo ln -sf "$(ls "$libdir"/libreadline.so.8* | head -n1)" "$OG_ROOT/compat/libreadline.so.7" + +# Every other script runs commands through $OG_ROOT/run, which sources this +# environment and drops the caller into the openGauss toolchain. +sudo tee "$OG_ROOT/env.sh" >/dev/null </dev/null </dev/null || ulimit -n "\$(ulimit -Hn)" 2>/dev/null || true +source $OG_ROOT/env.sh +exec "\$@" +EOF +sudo chmod 755 "$OG_ROOT/run" +sudo chown -R "$OG_USER:$OG_USER" "$OG_ROOT" + +# Initialize the cluster. -A trust keeps the benchmark scripts free of +# password handling; the instance only listens on a Unix socket anyway. +sudo -u "$OG_USER" "$OG_ROOT/run" gs_initdb -D "$OG_ROOT/data" \ + --nodename=clickbench -w 'Clickbench@123' -E UTF8 --locale=C -A trust + +memory_kb=$(awk '/MemTotal/ {print $2}' /proc/meminfo) +threads=$(nproc) + +# openGauss parallelizes a query only when query_dop is raised above its +# default of 1; without it a 16-core machine runs every scan on one core. +# Half the threads is the same share the postgresql entry hands to +# max_parallel_workers_per_gather, and 64 is the ceiling the GUC accepts. +query_dop=$((threads / 2)) +[ "$query_dop" -lt 1 ] && query_dop=1 +[ "$query_dop" -gt 64 ] && query_dop=64 + +# Every thread of a parallel plan takes a connection slot, so the driver's +# 10-connection throughput test needs roughly 10 x query_dop of them at +# once; with the default 200 it dies with "No free proc is available to +# create a new connection". 30 slots per unit of query_dop leaves room for +# the producer/consumer pairs a stream plan adds on top. +max_connections=$((query_dop * 30 + 200)) + +# openGauss caps the whole instance with max_process_memory (default 12 GB +# regardless of the machine): too small and big GROUP BYs fail with "memory +# is temporarily unavailable", too large and the OOM killer arrives first. +# 80% of RAM, floored at the 2 GB the GUC accepts as a minimum. +max_process_memory=$((memory_kb * 4 / 5)) +[ "$max_process_memory" -lt 2097152 ] && max_process_memory=2097152 + +# The row-store buffer pool. Same 25%-of-RAM rule as the postgresql entry. +shared_buffers=$((memory_kb / 4)) +effective_cache_size=$((memory_kb - memory_kb / 4)) + +# An eighth of RAM for the post-load ANALYZE, but never more than 2 GB -- +# t3a.small only has 2 GB in total. +maintenance_work_mem=$((memory_kb / 8)) +[ "$maintenance_work_mem" -gt 2097152 ] && maintenance_work_mem=2097152 + +# 16 MB per segment; 2048 segments is the 32 GB the postgresql entry gives +# max_wal_size, which keeps checkpoints out of the middle of the load. +sudo -u "$OG_USER" tee -a "$OG_ROOT/data/postgresql.conf" >/dev/null < ''` +# would stop meaning what it means in every other entry. +og gsql -d postgres -c "DROP DATABASE IF EXISTS test" +og gsql -d postgres -c "CREATE DATABASE test DBCOMPATIBILITY = 'PG'" + +og gsql -v ON_ERROR_STOP=1 -d test -t < create.sql + +# TRUNCATE and COPY FREEZE in one transaction, as in the postgresql entry: +# openGauss only allows COPY FREEZE when the table was created or truncated +# in the current subtransaction. +{ + echo 'BEGIN;' + echo 'TRUNCATE TABLE hits;' + echo "COPY hits FROM STDIN WITH (FREEZE);" + cat hits.tsv + echo '\.' + echo 'COMMIT;' +} | og gsql -v ON_ERROR_STOP=1 -d test -t + +og gsql -v ON_ERROR_STOP=1 -d test -t -c 'VACUUM ANALYZE hits' + +# Only remove inputs once load completes successfully. +rm -f hits.tsv +sync diff --git a/opengauss/queries.sql b/opengauss/queries.sql new file mode 100644 index 0000000000..31f65fc898 --- /dev/null +++ b/opengauss/queries.sql @@ -0,0 +1,43 @@ +SELECT COUNT(*) FROM hits; +SELECT COUNT(*) FROM hits WHERE AdvEngineID <> 0; +SELECT SUM(AdvEngineID), COUNT(*), AVG(ResolutionWidth) FROM hits; +SELECT AVG(UserID) FROM hits; +SELECT COUNT(DISTINCT UserID) FROM hits; +SELECT COUNT(DISTINCT SearchPhrase) FROM hits; +SELECT MIN(EventDate), MAX(EventDate) FROM hits; +SELECT AdvEngineID, COUNT(*) FROM hits WHERE AdvEngineID <> 0 GROUP BY AdvEngineID ORDER BY COUNT(*) DESC; +SELECT RegionID, COUNT(DISTINCT UserID) AS u FROM hits GROUP BY RegionID ORDER BY u DESC LIMIT 10; +SELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID) FROM hits GROUP BY RegionID ORDER BY c DESC LIMIT 10; +SELECT MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhoneModel ORDER BY u DESC LIMIT 10; +SELECT MobilePhone, MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhone, MobilePhoneModel ORDER BY u DESC LIMIT 10; +SELECT SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT SearchPhrase, COUNT(DISTINCT UserID) AS u FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY u DESC LIMIT 10; +SELECT SearchEngineID, SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT UserID, COUNT(*) FROM hits GROUP BY UserID ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase LIMIT 10; +SELECT UserID, extract(minute FROM EventTime) AS m, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, m, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10; +SELECT UserID FROM hits WHERE UserID = 435090932899640449; +SELECT COUNT(*) FROM hits WHERE URL LIKE '%google%'; +SELECT SearchPhrase, MIN(URL), COUNT(*) AS c FROM hits WHERE URL LIKE '%google%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT SearchPhrase, MIN(URL), MIN(Title), COUNT(*) AS c, COUNT(DISTINCT UserID) FROM hits WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10; +SELECT * FROM hits WHERE URL LIKE '%google%' ORDER BY EventTime LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY SearchPhrase LIMIT 10; +SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime, SearchPhrase LIMIT 10; +SELECT CounterID, AVG(length(URL)) AS l, COUNT(*) AS c FROM hits WHERE URL <> '' GROUP BY CounterID HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25; +SELECT REGEXP_REPLACE(Referer, '^https?://(?:www\.)?([^/]+)/.*$', '\1') AS k, AVG(length(Referer)) AS l, COUNT(*) AS c, MIN(Referer) FROM hits WHERE Referer <> '' GROUP BY k HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25; +SELECT SUM(ResolutionWidth), SUM(ResolutionWidth + 1), SUM(ResolutionWidth + 2), SUM(ResolutionWidth + 3), SUM(ResolutionWidth + 4), SUM(ResolutionWidth + 5), SUM(ResolutionWidth + 6), SUM(ResolutionWidth + 7), SUM(ResolutionWidth + 8), SUM(ResolutionWidth + 9), SUM(ResolutionWidth + 10), SUM(ResolutionWidth + 11), SUM(ResolutionWidth + 12), SUM(ResolutionWidth + 13), SUM(ResolutionWidth + 14), SUM(ResolutionWidth + 15), SUM(ResolutionWidth + 16), SUM(ResolutionWidth + 17), SUM(ResolutionWidth + 18), SUM(ResolutionWidth + 19), SUM(ResolutionWidth + 20), SUM(ResolutionWidth + 21), SUM(ResolutionWidth + 22), SUM(ResolutionWidth + 23), SUM(ResolutionWidth + 24), SUM(ResolutionWidth + 25), SUM(ResolutionWidth + 26), SUM(ResolutionWidth + 27), SUM(ResolutionWidth + 28), SUM(ResolutionWidth + 29), SUM(ResolutionWidth + 30), SUM(ResolutionWidth + 31), SUM(ResolutionWidth + 32), SUM(ResolutionWidth + 33), SUM(ResolutionWidth + 34), SUM(ResolutionWidth + 35), SUM(ResolutionWidth + 36), SUM(ResolutionWidth + 37), SUM(ResolutionWidth + 38), SUM(ResolutionWidth + 39), SUM(ResolutionWidth + 40), SUM(ResolutionWidth + 41), SUM(ResolutionWidth + 42), SUM(ResolutionWidth + 43), SUM(ResolutionWidth + 44), SUM(ResolutionWidth + 45), SUM(ResolutionWidth + 46), SUM(ResolutionWidth + 47), SUM(ResolutionWidth + 48), SUM(ResolutionWidth + 49), SUM(ResolutionWidth + 50), SUM(ResolutionWidth + 51), SUM(ResolutionWidth + 52), SUM(ResolutionWidth + 53), SUM(ResolutionWidth + 54), SUM(ResolutionWidth + 55), SUM(ResolutionWidth + 56), SUM(ResolutionWidth + 57), SUM(ResolutionWidth + 58), SUM(ResolutionWidth + 59), SUM(ResolutionWidth + 60), SUM(ResolutionWidth + 61), SUM(ResolutionWidth + 62), SUM(ResolutionWidth + 63), SUM(ResolutionWidth + 64), SUM(ResolutionWidth + 65), SUM(ResolutionWidth + 66), SUM(ResolutionWidth + 67), SUM(ResolutionWidth + 68), SUM(ResolutionWidth + 69), SUM(ResolutionWidth + 70), SUM(ResolutionWidth + 71), SUM(ResolutionWidth + 72), SUM(ResolutionWidth + 73), SUM(ResolutionWidth + 74), SUM(ResolutionWidth + 75), SUM(ResolutionWidth + 76), SUM(ResolutionWidth + 77), SUM(ResolutionWidth + 78), SUM(ResolutionWidth + 79), SUM(ResolutionWidth + 80), SUM(ResolutionWidth + 81), SUM(ResolutionWidth + 82), SUM(ResolutionWidth + 83), SUM(ResolutionWidth + 84), SUM(ResolutionWidth + 85), SUM(ResolutionWidth + 86), SUM(ResolutionWidth + 87), SUM(ResolutionWidth + 88), SUM(ResolutionWidth + 89) FROM hits; +SELECT SearchEngineID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10; +SELECT URL, COUNT(*) AS c FROM hits GROUP BY URL ORDER BY c DESC LIMIT 10; +SELECT 1, URL, COUNT(*) AS c FROM hits GROUP BY 1, URL ORDER BY c DESC LIMIT 10; +SELECT ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3, COUNT(*) AS c FROM hits GROUP BY ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3 ORDER BY c DESC LIMIT 10; +SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND URL <> '' GROUP BY URL ORDER BY PageViews DESC LIMIT 10; +SELECT Title, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND Title <> '' GROUP BY Title ORDER BY PageViews DESC LIMIT 10; +SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND IsLink <> 0 AND IsDownload = 0 GROUP BY URL ORDER BY PageViews DESC LIMIT 10 OFFSET 1000; +SELECT TraficSourceID, SearchEngineID, AdvEngineID, CASE WHEN (SearchEngineID = 0 AND AdvEngineID = 0) THEN Referer ELSE '' END AS Src, URL AS Dst, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 GROUP BY TraficSourceID, SearchEngineID, AdvEngineID, Src, Dst ORDER BY PageViews DESC LIMIT 10 OFFSET 1000; +SELECT URLHash, EventDate, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND TraficSourceID IN (-1, 6) AND RefererHash = 3594120000172545465 GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 10 OFFSET 100; +SELECT WindowClientWidth, WindowClientHeight, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND DontCountHits = 0 AND URLHash = 2868770270353813622 GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10 OFFSET 10000; +SELECT DATE_TRUNC('minute', EventTime) AS M, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-14' AND EventDate <= '2013-07-15' AND IsRefresh = 0 AND DontCountHits = 0 GROUP BY DATE_TRUNC('minute', EventTime) ORDER BY DATE_TRUNC('minute', EventTime) LIMIT 10 OFFSET 1000; diff --git a/opengauss/query b/opengauss/query new file mode 100755 index 0000000000..a600743c85 --- /dev/null +++ b/opengauss/query @@ -0,0 +1,30 @@ +#!/bin/bash +# Reads a SQL query from stdin, runs it via gsql against the `test` DB. +# Stdout: query result. +# Stderr: query runtime in fractional seconds on the last line (parsed from +# gsql's `\timing` output). +# Exit non-zero on error. +set -e + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +query=$(cat) + +out=$(printf '\\timing\n%s\n' "$query" | + sudo -u "$OG_USER" "$OG_ROOT/run" gsql -d test -t 2>&1) || true + +# gsql prints "ERROR:"/"FATAL:" on a failed query but still exits 0. +if printf '%s\n' "$out" | grep -q '^ERROR\|^FATAL\|^gsql: '; then + printf '%s\n' "$out" >&2 + exit 1 +fi + +printf '%s\n' "$out" | grep -v '^Time:' || true + +time_ms=$(printf '%s\n' "$out" | grep -oP 'Time:\s+\K[0-9]+\.[0-9]+' | tail -n1) +if [ -z "$time_ms" ]; then + echo "no timing in gsql output" >&2 + exit 1 +fi +awk -v ms="$time_ms" 'BEGIN { printf "%.3f\n", ms / 1000 }' >&2 diff --git a/opengauss/results/20260902/c6a.metal.json b/opengauss/results/20260902/c6a.metal.json new file mode 100644 index 0000000000..6e79432358 --- /dev/null +++ b/opengauss/results/20260902/c6a.metal.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss", + "date": "2026-09-02", + "machine": "c6a.metal", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","row-oriented","PostgreSQL compatible"], + "load_time": 1405, + "data_size": 81230303104, + "concurrent_qps": 0.017, + "concurrent_error_ratio": 0, + "result": [ + [402.506, 3.239, 2.995], + [355.146, 3.193, 3.171], + [402.239, 3.231, 3.044], + [404.05, 3.363, 3.143], + [359.105, 7.257, 7.144], + [370.413, 3.796, 3.813], + [402.415, 3.289, 3.26], + [402.758, 2.933, 3.214], + [402.219, 18.156, 18.387], + [548.349, 25.57, 24.911], + [742.196, 4.207, 3.755], + [794.023, 5.121, 4.794], + [717.203, 5.657, 5.487], + [798.042, 6.478, 5.992], + [802.128, 12.128, 12.196], + [699.967, 6.508, 7.269], + [703.169, 8.445, 7.858], + [691.969, 7.953, 7.329], + [784.652, 8.287, 8.244], + [779.349, 3.372, 3.132], + [829.983, 3.275, 3.036], + [823.436, 3.236, 3.119], + [671.43, 2.901, 2.956], + [829.4, 3.379, 3.276], + [784.261, 3.364, 3.114], + [790.754, 3.245, 3], + [787.605, 3.452, 3.403], + [828.463, 3.421, 3.291], + [726.421, 13.981, 12.98], + [675.357, 15.569, 16.962], + [776.896, 12.495, 12.669], + [676.245, 4.736, 4.548], + [821.923, 8.655, 8.91], + [731.398, 9.201, 9.419], + [780.751, 73.281, 74.798], + [582.293, 7.311, 7.459], + [776.927, 3.416, 3.168], + [787.361, 3.373, 3.405], + [787.223, 3.137, 3.144], + [699.747, 3.875, 3.569], + [784.444, 3.281, 3.347], + [785.197, 3.002, 2.862], + [728.306, 3.291, 3.003] +] + } + \ No newline at end of file diff --git a/opengauss/results/20260902/c7a.metal-48xl.json b/opengauss/results/20260902/c7a.metal-48xl.json new file mode 100644 index 0000000000..2c4caa3805 --- /dev/null +++ b/opengauss/results/20260902/c7a.metal-48xl.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss", + "date": "2026-09-02", + "machine": "c7a.metal-48xl", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","row-oriented","PostgreSQL compatible"], + "load_time": 1327, + "data_size": 81543850800, + "concurrent_qps": 0.017, + "concurrent_error_ratio": 0, + "result": [ + [403.55, 1.308, 1.349], + [402.979, 1.516, 1.5], + [404.206, 1.564, 1.582], + [402.462, 1.745, 1.731], + [369.673, 5.721, 6.026], + [405.515, 2.286, 2.28], + [401.496, 1.375, 1.367], + [402.266, 1.523, 1.507], + [413.822, 15.845, 15.463], + [696.639, 22.848, 22.951], + [744.088, 2.498, 2.489], + [786.407, 3.303, 3.299], + [801.978, 3.401, 3.353], + [799.419, 4.361, 4.498], + [806.568, 11.585, 10.589], + [781.303, 6.052, 6.17], + [794.248, 8.261, 7.99], + [803.722, 7.999, 7.841], + [791.195, 9.139, 9.296], + [775.538, 1.378, 1.372], + [728.77, 1.617, 1.619], + [831.825, 1.723, 1.597], + [792.913, 1.566, 1.539], + [833.098, 1.626, 1.588], + [795.177, 1.571, 1.564], + [710.762, 1.604, 1.647], + [796.369, 1.559, 1.559], + [824.744, 2.087, 2.091], + [739.003, 8.948, 9.337], + [716.474, 10.745, 10.725], + [793.931, 11.374, 11.197], + [762.479, 2.723, 2.789], + [833.98, 9.578, 9.282], + [728.669, 8.031, 8.862], + [895.438, 76.371, 75.527], + [645.766, 6.235, 5.997], + [785.8, 1.697, 1.631], + [790.301, 1.567, 1.551], + [789.801, 1.758, 1.718], + [792.181, 2.074, 1.956], + [789.635, 1.684, 1.674], + [792.7, 1.478, 1.518], + [792.136, 1.389, 1.426] +] + } + \ No newline at end of file diff --git a/opengauss/results/20260902/c8g.metal-48xl.json b/opengauss/results/20260902/c8g.metal-48xl.json new file mode 100644 index 0000000000..23fc3cc9b9 --- /dev/null +++ b/opengauss/results/20260902/c8g.metal-48xl.json @@ -0,0 +1,60 @@ +{ + "system": "openGauss", + "date": "2026-09-02", + "machine": "c8g.metal-48xl", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","row-oriented","PostgreSQL compatible"], + "load_time": 1319, + "data_size": 81697709153, + "concurrent_qps": 0.017, + "concurrent_error_ratio": 0, + "result": [ + [400.834, 0.95, 1.199], + [400.408, 1.213, 1.111], + [399.033, 1.311, 1.283], + [403.202, 1.371, 1.353], + [400.658, 6.11, 6.094], + [396.997, 1.895, 1.988], + [401.496, 1.046, 1.086], + [396.875, 1.264, 1.493], + [409.936, 12.811, 14.268], + [729.745, 18.78, 19.171], + [734.778, 2.005, 2.081], + [796.267, 3.34, 3.308], + [799.548, 2.472, 2.648], + [789.81, 2.705, 2.697], + [795.466, 9.242, 9.121], + [772.937, 8.361, 5.919], + [820.576, 6.007, 6.51], + [813.958, 5.59, 5.709], + [797.335, 6.081, 7.314], + [782.586, 1.018, 1.517], + [825.643, 1.299, 1.384], + [820.474, 1.433, 1.511], + [778.363, 1.403, 1.272], + [836.48, 1.283, 1.268], + [793.523, 1.212, 1.28], + [790.879, 1.254, 1.166], + [792.005, 1.308, 1.32], + [821.398, 1.896, 1.887], + [816.347, 9.203, 9.078], + [782.294, 9.78, 9.78], + [783.365, 9.953, 10.465], + [737.254, 2.174, 2.196], + [876.897, 6.785, 6.966], + [824.496, 7.003, 6.967], + [877.003, 65.772, 63.251], + [664.692, 6.082, 7.267], + [773.821, 1.376, 1.345], + [779.677, 1.269, 1.287], + [782.774, 1.5, 1.371], + [793.276, 1.765, 2.038], + [781.798, 1.578, 1.439], + [775.598, 1.206, 1.332], + [777.877, 1.186, 1.125] +] + } + \ No newline at end of file diff --git a/opengauss/start b/opengauss/start new file mode 100755 index 0000000000..a226506a8b --- /dev/null +++ b/opengauss/start @@ -0,0 +1,14 @@ +#!/bin/bash +set -eu + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# setsid: gs_ctl forks the server but leaves it in the caller's process +# group and session, so anything that later signals that group -- a +# `timeout` around the driver, a killed shell -- takes the database down +# with it. Detaching here keeps the server alive for the next ./query. +# -t bounds the wait: the driver's own check loop is the authoritative +# readiness signal, so there is no reason for gs_ctl to sit here longer. +sudo -u "$OG_USER" setsid "$OG_ROOT/run" gs_ctl start -D "$OG_ROOT/data" \ + -Z single_node -t 300 -l "$OG_ROOT/log/gs_ctl.log" diff --git a/opengauss/stop b/opengauss/stop new file mode 100755 index 0000000000..6019bc5cb0 --- /dev/null +++ b/opengauss/stop @@ -0,0 +1,9 @@ +#!/bin/bash + +OG_ROOT=${OG_ROOT:-/opt/opengauss} +OG_USER=${OG_USER:-omm} + +# Bounded so a stuck shutdown cannot eat a cold cycle; the driver waits for +# ./check to start failing afterwards either way. +sudo -u "$OG_USER" "$OG_ROOT/run" gs_ctl stop -D "$OG_ROOT/data" \ + -Z single_node -m fast -t 120 || true diff --git a/opengauss/template.json b/opengauss/template.json new file mode 100644 index 0000000000..b0de96d54b --- /dev/null +++ b/opengauss/template.json @@ -0,0 +1,11 @@ +{ + "system": "openGauss", + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": [ + "C++", + "row-oriented", + "PostgreSQL compatible" + ] +}