1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Sysbench Benchmark Module
//!
//! This module provides Sysbench benchmark utilities for testing MySQL-compatible
//! OLTP micro-benchmarks. Sysbench tests include:
//!
//! - Point select: Lookup by primary key
//! - Range select: Range scan on primary key
//! - Index scan: Secondary index lookups
//! - Insert: Single-row inserts
//! - Update index: Update with indexed column
//! - Update non-index: Update without indexed column
//! - Delete: Delete by primary key
//!
//! ## Schema
//!
//! The standard sysbench OLTP schema:
//! ```sql
//! CREATE TABLE sbtest1 (
//! id INTEGER PRIMARY KEY,
//! k INTEGER NOT NULL DEFAULT 0,
//! c CHAR(120) NOT NULL DEFAULT '',
//! padding CHAR(60) NOT NULL DEFAULT ''
//! );
//! CREATE INDEX k_1 ON sbtest1(k);
//! ```
//!
//! ## Usage
//!
//! ```
//! use vibesql_bench_common::sysbench::SysbenchData;
//!
//! // Generate sysbench data for 10,000 rows
//! let mut data = SysbenchData::new(10_000);
//! while let Some((id, k, c, pad)) = data.next_row() {
//! // Insert row into database
//! }
//!
//! // Generate random query parameters
//! data.reset();
//! let random_id = data.random_id();
//! let (start, end) = data.random_range(100);
//! ```
pub use *;