Skip to content

Commit

Permalink
Data scope: complete, consistent, and tested (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-nichter authored Jan 10, 2024
1 parent e72f5b0 commit 6fb8c7f
Show file tree
Hide file tree
Showing 65 changed files with 5,630 additions and 568 deletions.
3,020 changes: 3,015 additions & 5 deletions aws/rds.go

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions aws/rds_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2024 Block, Inc.

package aws

import (
"testing"
)

func TestRDSCert(t *testing.T) {
var err any
f := func() {
defer func() {
err = recover()
}()
RegisterRDSCA() // panics on any error
}
f()
if err != nil {
t.Errorf("RegisterRDSCA paniced: %v", err)
}
}
2 changes: 2 additions & 0 deletions benchmarks/intro/read-only.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://square.github.io/finch/benchmark/examples/#intro

stage:
runtime: 10s
workload:
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/intro/row-lock.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://square.github.io/finch/benchmark/examples/#intro

stage:
runtime: 20s
workload:
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/intro/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE t1 (
id INT UNSIGNED NOT NULL PRIMARY KEY,
n INT NOT NULL,
c VARCHAR(100) NOT NULL,
INDEX (n)
)
3 changes: 3 additions & 0 deletions benchmarks/intro/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# https://square.github.io/finch/benchmark/examples/#intro

stage:
trx:
- file: schema.sql
- file: insert-rows.sql
data:
id:
Expand Down
17 changes: 17 additions & 0 deletions benchmarks/jcole-bug-97001/after.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://bugs.mysql.com/bug.php?id=97001
# https://blog.jcole.us/2019/09/30/reconsidering-access-paths-for-index-ordering-a-dangerous-optimization-and-a-fix/
# https://hackmysql.com/post/infamous-order-by-limit-query-optimizer-bug/

stage:
trx:
- file: shift-rows.sql # UPDATE t SET id=id+1000000 WHERE other_id = 555
- file: get-1-row.sql
workload:
- group: shift
trx: [shift-rows.sql]
iter: 1
disable-stats: true

- group: after
trx: [get-1-row.sql]
iter: 2
9 changes: 9 additions & 0 deletions benchmarks/jcole-bug-97001/before.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://bugs.mysql.com/bug.php?id=97001
# https://blog.jcole.us/2019/09/30/reconsidering-access-paths-for-index-ordering-a-dangerous-optimization-and-a-fix/
# https://hackmysql.com/post/infamous-order-by-limit-query-optimizer-bug/

stage:
trx:
- file: get-1-row.sql
workload:
- iter: 1000
1 change: 1 addition & 0 deletions benchmarks/jcole-bug-97001/get-1-row.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT non_covered_column FROM t WHERE other_id = 555 ORDER BY id ASC LIMIT 1
2 changes: 2 additions & 0 deletions benchmarks/jcole-bug-97001/insert-rows.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- prepare
INSERT INTO t (id, other_id, covered_column, non_covered_column) VALUES /*!csv 5000 (@n(), @n % 1000, @n, @n)*/
8 changes: 8 additions & 0 deletions benchmarks/jcole-bug-97001/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE t (
id BIGINT NOT NULL,
other_id BIGINT NOT NULL,
covered_column VARCHAR(50) NOT NULL,
non_covered_column VARCHAR(50) NOT NULL,
PRIMARY KEY (id),
INDEX index_other_id_covered_column (other_id, covered_column)
)
17 changes: 17 additions & 0 deletions benchmarks/jcole-bug-97001/setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://bugs.mysql.com/bug.php?id=97001
# https://blog.jcole.us/2019/09/30/reconsidering-access-paths-for-index-ordering-a-dangerous-optimization-and-a-fix/
# https://hackmysql.com/post/infamous-order-by-limit-query-optimizer-bug/

stage:
trx:
- file: schema.sql
- file: insert-rows.sql
data:
n:
generator: auto-inc
scope: client-group
workload:
- trx: [schema.sql]
- trx: [insert-rows.sql] # 5k rows/insert
iter-clients: 200 # x 200 inserts = 1,000,000 rows
clients: 4
1 change: 1 addition & 0 deletions benchmarks/jcole-bug-97001/shift-rows.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE t SET id=id+1000000 WHERE other_id = 555
2 changes: 0 additions & 2 deletions benchmarks/sysbench/read-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ stage:
data:
id:
generator: "int"
scope: client
params:
max: $params.rows
dist: normal
id_100:
generator: "int-range"
scope: client
params:
range: 100
max: $params.rows
1 change: 1 addition & 0 deletions benchmarks/sysbench/trx/read-only.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ SELECT c FROM sbtest1 WHERE id BETWEEN @id_100 AND @PREV ORDER BY c
-- prepare
SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN @id_100 AND @PREV ORDER BY c

-- prepare
COMMIT
1 change: 1 addition & 0 deletions benchmarks/xfer/_all.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://square.github.io/finch/benchmark/examples/#xfer

params:
customers: 1,000,000 # + 3 balances per customer (4M rows total)
Expand Down
8 changes: 5 additions & 3 deletions benchmarks/xfer/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# https://square.github.io/finch/benchmark/examples/#xfer

stage:
name: setup
stats:
disable: true
workload:
- clients: 1 #
name: schema # exec group "schema"
group: schema # exec group "schema"
trx: [schema.sql] #
- clients: 2 #
name: rows #
group: rows #
trx: [insert-cust-bal.sql] # exec group "rows"
- clients: 2 #
name: rows #
group: rows #
trx: [insert-xfers.sql] #

trx:
Expand Down
1 change: 1 addition & 0 deletions benchmarks/xfer/xfer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://square.github.io/finch/benchmark/examples/#xfer

stage:
name: xfer
Expand Down
Loading

0 comments on commit 6fb8c7f

Please # to comment.