Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ Please help us add more systems and run the benchmarks on more types of VMs:
- [ ] LocustDB
- [ ] Manticore Search
- [ ] MS SQL Server with Column Store Index (without publishing)
- [ ] OceanBase
- [ ] Planetscale (without publishing)
- [ ] Redshift Spectrum
- [ ] Seafowl
Expand Down
51 changes: 51 additions & 0 deletions oceanbase-row/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
This is the `oceanbase` entry with one change: `hits` is created
`WITH COLUMN GROUP (all columns)` instead of `(each column)`, so it stays in
OceanBase's row store — the LSM-tree layout every table had before 4.3
introduced the columnstore engine, and still what a plain `CREATE TABLE` gives
you.

Read `../oceanbase/README.md` first: the RPM unpacking, the bootstrap that has
to happen inside `./install`, the resource unit sized from `GV$OB_SERVERS`, the
`olap` parameter template, the `VARCHAR` widths and the 1.5 MB row limit, the
direct load and the `secure_file_priv` Unix-socket rule are all identical here
and are only described there.

To run the benchmark:

```
./benchmark.sh
```

## What differs from the columnstore entry

- `create.sql` says `WITH COLUMN GROUP (all columns)` — one group holding every
column, which is what a row is. `SHOW CREATE TABLE` is otherwise identical to
the columnstore entry's, down to `COMPRESSION = 'zstd_1.3.8'`,
`SKIP_INDEX_LEVEL = 1`, `DELTA_FORMAT = 'encoding'`,
`MERGE_ENGINE = DELETE_INSERT` and `COLLATE = utf8mb4_bin`; the table is
still sorted by `(CounterID, EventDate, UserID, EventTime, WatchID)`. Only
the physical grouping of the columns changes.

Spelling the group out matters: with the `olap` template's
`default_table_store_format = 'column'` in force, simply *omitting* the
clause produces a columnstore table, not a rowstore one.
- `install` sets `default_table_store_format = 'row'` rather than `'column'`,
so the parameter and the schema say the same thing.

Everything else — the same 43 queries, the same load path, the same instance
and tenant sizing — is byte-for-byte the columnstore entry, so the difference
between the two result sets is the storage format and nothing else.

## Verification

Validated at 1% scale on the same instance as the columnstore entry: the DDL
produces `WITH COLUMN GROUP(all columns)` with every other table option
identical, the load gets all rows in, and all 43 queries return a result. The
comparison against `clickhouse-local` lands in the same place as the
columnstore entry's — 32 of 43 identical, the rest `LIMIT` ties plus the two
semantic differences (`AVG(UserID)` overflowing in ClickHouse, and
`utf8mb4_bin` being a `PAD SPACE` collation) that `../oceanbase/README.md`
describes.

The 100-million-row load has only been run for the columnstore entry. No
results yet — those need runs on the benchmark's own EC2 machines.
9 changes: 9 additions & 0 deletions oceanbase-row/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
export BENCH_DOWNLOAD_SCRIPT="download-hits-tsv"
# The observer's startup is not instant even when nothing has to be replayed:
# it re-reads its schema and tablet metadata, and after ./drop_caches all of
# that comes off the disk. Measured here at 27-45 s warm and a few minutes when
# the volume is busy, against the driver's 300 s default -- and a ./check that
# times out aborts the whole run, so give it room.
export BENCH_CHECK_TIMEOUT=900
exec ../lib/benchmark-common.sh
16 changes: 16 additions & 0 deletions oceanbase-row/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -eu

OB_HOME=${OB_HOME:-/opt/oceanbase}
source "$OB_HOME/bench.env"

# obclient talks to the server over TCP and needs no privileges of its own;
# only ./start, ./stop and ./install (which writes under $OB_HOME and has to
# reach the Unix socket) need root.
#
# Check the user tenant, not the sys tenant: after a restart the server accepts
# root@sys well before the tenant's log stream has replayed and its tablets are
# readable, and a query issued in that window fails.
out=$("$OB_HOME/obc" -h127.0.0.1 -P"$OB_MYSQL_PORT" -uroot@"$OB_TENANT" \
-A -N -e 'SELECT 1' 2>&1)
[ "$out" = "1" ]
111 changes: 111 additions & 0 deletions oceanbase-row/create.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
CREATE TABLE hits
(
WatchID BIGINT NOT NULL,
JavaEnable SMALLINT NOT NULL,
Title VARCHAR(16384) NOT NULL,
GoodEvent SMALLINT NOT NULL,
EventTime DATETIME 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 VARCHAR(32768) NOT NULL,
Referer VARCHAR(32768) 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 VARCHAR(512) 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 VARCHAR(512) NOT NULL,
Params VARCHAR(8192) NOT NULL,
IPNetworkID INTEGER NOT NULL,
TraficSourceID SMALLINT NOT NULL,
SearchEngineID SMALLINT NOT NULL,
SearchPhrase VARCHAR(8192) NOT NULL,
AdvEngineID SMALLINT NOT NULL,
IsArtifical SMALLINT NOT NULL,
WindowClientWidth SMALLINT NOT NULL,
WindowClientHeight SMALLINT NOT NULL,
ClientTimeZone SMALLINT NOT NULL,
ClientEventTime DATETIME NOT NULL,
SilverlightVersion1 SMALLINT NOT NULL,
SilverlightVersion2 SMALLINT NOT NULL,
SilverlightVersion3 INTEGER NOT NULL,
SilverlightVersion4 SMALLINT NOT NULL,
PageCharset VARCHAR(512) NOT NULL,
CodeVersion INTEGER NOT NULL,
IsLink SMALLINT NOT NULL,
IsDownload SMALLINT NOT NULL,
IsNotBounce SMALLINT NOT NULL,
FUniqID BIGINT NOT NULL,
OriginalURL VARCHAR(32768) 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 DATETIME 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 VARCHAR(512) NOT NULL,
BrowserCountry VARCHAR(512) NOT NULL,
SocialNetwork VARCHAR(512) NOT NULL,
SocialAction VARCHAR(512) 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 VARCHAR(2048) NOT NULL,
ParamPrice BIGINT NOT NULL,
ParamOrderID VARCHAR(512) NOT NULL,
ParamCurrency VARCHAR(512) NOT NULL,
ParamCurrencyID SMALLINT NOT NULL,
OpenstatServiceName VARCHAR(2048) NOT NULL,
OpenstatCampaignID VARCHAR(2048) NOT NULL,
OpenstatAdID VARCHAR(2048) NOT NULL,
OpenstatSourceID VARCHAR(2048) NOT NULL,
UTMSource VARCHAR(2048) NOT NULL,
UTMMedium VARCHAR(2048) NOT NULL,
UTMCampaign VARCHAR(2048) NOT NULL,
UTMContent VARCHAR(2048) NOT NULL,
UTMTerm VARCHAR(2048) NOT NULL,
FromTag VARCHAR(2048) NOT NULL,
HasGCLID SMALLINT NOT NULL,
RefererHash BIGINT NOT NULL,
URLHash BIGINT NOT NULL,
CLID INTEGER NOT NULL,
PRIMARY KEY (CounterID, EventDate, UserID, EventTime, WatchID)
)
ORGANIZATION INDEX
WITH COLUMN GROUP (all columns);
14 changes: 14 additions & 0 deletions oceanbase-row/data-size
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# The observer preallocates both its data file (datafile_size) and its redo log
# pool (log_disk_size) at startup, so `du` on the store directory reports the
# reservation rather than the dataset -- tens of gigabytes of untouched zeroes.
# DATA_DISK_IN_USE and LOG_DISK_IN_USE are the macroblocks and log blocks
# actually occupied, which is the number this benchmark asks for: user data,
# indexes, and transaction log.
set -eu

OB_HOME=${OB_HOME:-/opt/oceanbase}
source "$OB_HOME/bench.env"

"$OB_HOME/obc" -h127.0.0.1 -P"$OB_MYSQL_PORT" -uroot@sys -A -Doceanbase -N \
-e 'SELECT SUM(DATA_DISK_IN_USE) + SUM(LOG_DISK_IN_USE) FROM GV$OB_SERVERS'
Loading