Documentation
¶
Overview ¶
Package seqscanstorm defines implementation of a workload which deliberately drives a sustained, CPU-bound sequential-scan storm on a PostgreSQL instance.
It seeds one large table whose filter column (payload) carries NO index, then fans out --jobs per-worker connections that loop a forced full-table Seq Scan (count(*) ... WHERE payload = <empty-predicate>). Because payload is never indexed and the predicate matches nothing, the planner is forced into a Seq Scan over the whole heap on every query, burning CPU on brute-force scan+filter rather than I/O (once the table is warm in page cache).
The workload self-reports honestly: it keeps an in-process counter of logical bytes scanned (completed queries × the real, once-read table size) and never polls live server state at runtime. The seed table is dropped on a fresh connection at exit. Workload duration is controlled by a context created outside and passed to Run.
This file currently provides the package foundation: Config/validate, the seed prepare path, the one-time relation-size read, and cleanup. The escalation engine (Run, warm-up, workers, reporter) is added by a follow-up task.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Conninfo defines connection string used for connecting to Postgres.
// It is a secret and must never be logged.
Conninfo string
// TableSize defines the target seed-table size in bytes (from --table-size,
// base-2 parsed). It is converted to a row count via bytesPerRowEstimate.
TableSize int64
// Jobs defines how many concurrent scan workers to run, taken from the global
// --jobs flag (>= 1). One worker already saturates one core.
Jobs uint16
}
Config defines configuration settings for seqscan-storm workload.