{"record":{"id":"4c651556ccafd45e","repo":"influxdata/influxdb","slug":"per-table-column-limits-are-restricted-to-a-maximum-value-of","errorCode":null,"errorMessage":"per-table column limits are restricted to a maximum value of {0} for system performance purposes","messagePattern":"per-table column limits are restricted to a maximum value of (.+?) for system performance purposes","errorType":"validation","errorClass":"ServiceLimitError","httpStatus":null,"severity":"error","filePath":"core/data_types/src/service_limits.rs","lineNumber":236,"sourceCode":"\n/// Errors converting from raw values to the service limits\n#[derive(Error, Debug, Clone, Copy)]\npub enum ServiceLimitError {\n    /// A negative or 0 value was specified; those aren't allowed\n    #[error(\"service limit values must be greater than 0\")]\n    MustBeGreaterThanZero,\n\n    /// No value was provided so we can't update anything\n    #[error(\"a supported service limit value is required\")]\n    NoValueSpecified,\n\n    /// Limits are stored as `i32` in the database and transferred as i32 over protobuf, so even\n    /// though they are stored as `usize` in Rust, the `usize` value must be less than `i32::MAX`.\n    #[error(\"service limit values must fit in a 32-bit signed integer (`i32`)\")]\n    MustFitInI32,\n\n    /// Per-table column limits are restricted\n    #[error(\n        \"per-table column limits are restricted to a maximum value of {0} for system performance purposes\"\n    )]\n    ColumnLimitTooLarge(MaxColumnsPerTable),\n}\n\nimpl ServiceLimitUpdate {\n    /// Constructs a [`ServiceLimitUpdate`] from the provided `limit_update`,\n    /// performing validation and applying `column_limit_upper_bound` to the\n    /// per-table column limit.\n    pub fn bounded_try_from(\n        limit_update: Option<LimitUpdate>,\n        column_limit_upper_bound: MaxColumnsPerTable,\n    ) -> Result<Self, ServiceLimitError> {\n        match limit_update {\n            Some(LimitUpdate::MaxTables(n)) => Ok(Self::MaxTables(MaxTables::try_from(n)?)),\n            Some(LimitUpdate::MaxColumnsPerTable(n)) => Ok(Self::MaxColumnsPerTable(\n                MaxColumnsPerTable::try_from(n).map(|l| {\n                    if l <= column_limit_upper_bound {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/data_types/src/service_limits.rs#L218-L254","documentation":"`ServiceLimitError::ColumnLimitTooLarge` is raised when the per-table column limit (`MaxColumnsPerTable`) is set above the hard maximum the system allows. The cap exists for system performance purposes: very wide tables degrade query and storage performance, so the library enforces an upper bound even though the value would otherwise fit in `i32`.","triggerScenarios":"Converting/configuring a `MaxColumnsPerTable` service limit with a value larger than the compile-time maximum allowed by the system (the cap carried in the `MaxColumnsPerTable` argument of the variant).","commonSituations":"Deployments trying to ingest extremely wide schemas (hundreds/thousands of columns per table); misreading the limit as configurable without bound; copying limits from another InfluxDB IOx deployment with a higher cap.","solutions":["Lower the per-table column limit to the documented maximum shown in the error message.","Restructure overly wide schemas (split data across multiple tables or use tags/fields appropriately) so fewer columns are needed.","Check the `MAX_COLUMNS_PER_TABLE` constant/limit in the codebase to know the exact cap before configuring.","Validate configured limits at startup so misconfigurations surface early."],"exampleFix":"// before\nServiceLimitUpdate::MaxColumnsPerTable(MaxColumnsPerTable::new(10_000))\n// after\nServiceLimitUpdate::MaxColumnsPerTable(MaxColumnsPerTable::new(200)) // within system cap","handlingStrategy":"validation","validationCode":"fn validate_column_limit(limit: usize, max: usize) -> Result<(), String> {\n    if limit > max { Err(format!(\"per-table column limits are restricted to a maximum value of {max}\")) } else { Ok(()) }\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(ServiceLimitError::ColumnLimitTooLarge(max)) => {\n        eprintln!(\"column limit too high; cap is {max:?}\");\n    }\n    ...\n}","preventionTips":["Know the compile-time MAX_COLUMNS_PER_TABLE cap before configuring","Design schemas to stay well under the column cap","Validate deployment config against the cap at startup"],"tags":["rust","service-limits","column-limit","config"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}