Help us shape the future of Go! Take the 2026 Go Developer Survey

duckdbtuning

package
v0.117.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package duckdbtuning holds the shared DuckDB resource-tuning flags used by the offline query/recover/reconstruct/verify commands (#510/#511): the --ultrafast / --duckdb-threads / --duckdb-memory-limit flag set, the precedence resolution into a duckdbutil.Tuning, and the archive-fetcher adapter that carries that budget into parquetquery.

It is deliberately a leaf: its only dependencies are cobra plus the low-level duckdbutil / query / parquetquery packages, and it imports nothing from the command layer. That lets the public read-plane facade (indexquery) expose these helpers WITHOUT pulling in internal/cli — which imports ext for the audit sink — so an ext seam that consumes the facade does not create an ext → indexquery → internal/cli → ext import cycle. internal/cli re-exports the same three functions (thin forwarders) so its command layer and existing callers are unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDuckDBTuningFlags

func AddDuckDBTuningFlags(cmd *cobra.Command)

AddDuckDBTuningFlags registers the shared DuckDB resource flags on the offline query/recover/reconstruct commands. They lift the conservative, container-safe DuckDB budget (threads=2, memory_limit=4GB) that parquetquery.Fetch applies by default — useful on a dedicated box with plenty of RAM where the small-container defaults leave performance on the table (#510). The long-lived shim/console daemons never register these, so their archive reads keep the safe default (#509 non-goal).

--duckdb-threads default -1 (not 0) so 0 stays a meaningful explicit value: "let DuckDB pick one thread per core". --duckdb-memory-limit "" means unset.

func DuckDBTuningFromFlags

func DuckDBTuningFromFlags(cmd *cobra.Command) (duckdbutil.Tuning, error)

DuckDBTuningFromFlags resolves the effective DuckDB tuning for a command. Precedence: an explicit --duckdb-* flag wins over --ultrafast, which wins over the conservative default. The granular flags let an operator tune to their box without the all-or-nothing --ultrafast switch.

An operator-supplied --duckdb-memory-limit is validated here, at the CLI boundary, and a bad value is a hard error — DuckDB's SET memory_limit is best-effort downstream and would either silently fall back to the default (a typo) or silently uncap on a negative value, neither of which an operator who explicitly asked for a budget should get without being told.

func TunedArchiveFetcher

func TunedArchiveFetcher(t duckdbutil.Tuning) query.ArchiveFetcher

TunedArchiveFetcher adapts a DuckDB Tuning into a query.ArchiveFetcher so the CLI commands can inject their budget without changing parquetquery.Fetch's signature (which other packages pass as a function value).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL