-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, LC, HC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE hc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let hc = hash2(i, 26709) % HC; | ||
db.execute_prepared(READ, [hc]).await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, LC, HC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE lc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let lc = hash2(i, 26709) % LC; | ||
db.execute_prepared(READ, [lc]).await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, LC, HC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE lc = ? AND hc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let lc = hash2(i, 26709) % LC; | ||
let hc = hash2(i, 67633) % HC; | ||
db.execute_prepared(READ, [lc, hc]).await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, LC, MC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE lc = ? AND mc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let lc = hash2(i, 26709) % LC; | ||
let mc = hash2(i, 6773) % MC; | ||
db.execute_prepared(READ, [lc, mc]).await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, HC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE hc = ? OR hc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let hc1 = hash2(i, 85790) % HC; | ||
let hc2 = hash2(i, 24303) % HC; | ||
db.execute_prepared(READ, [hc1, hc2]).await?; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
mod common; | ||
|
||
use common::{KEYSPACE, TABLE, LC}; | ||
use latte::*; | ||
|
||
pub const LOAD_COUNT = latte::param!("rows", 100000); | ||
|
||
const READ_SIZE = latte::param!("read_size", 10); | ||
|
||
const READ = "read"; | ||
|
||
pub async fn schema(db) { | ||
common::init_schema(db).await?; | ||
} | ||
|
||
pub async fn erase(db) { | ||
common::erase(db).await?; | ||
} | ||
|
||
pub async fn prepare(db) { | ||
common::prepare(db).await?; | ||
db.prepare(READ, `SELECT * FROM ${KEYSPACE}.${TABLE} | ||
WHERE lc = ? OR lc = ? LIMIT ${READ_SIZE}`).await?; | ||
} | ||
|
||
pub async fn load(db, i) { | ||
common::insert_row(db, i).await?; | ||
} | ||
|
||
pub async fn run(db, i) { | ||
let lc1 = hash2(i, 85790) % LC; | ||
let lc2 = hash2(i, 24303) % LC; | ||
db.execute_prepared(READ, [lc1, lc2]).await?; | ||
} |