The finalize method can return this value from final_analyze to indicate it should not be used.
430246 {
430248 auto &
db = storage_manager.GetDatabase();
430249 auto &config = DBConfig::GetConfig(db);
430250 vector<CompressionType> forced_methods(checkpoint_states.size(), CompressionType::COMPRESSION_AUTO);
430251
430252 auto compression_type = checkpoint_info.GetCompressionType();
430253 for (
idx_t i = 0; i < checkpoint_states.size(); i++) {
430255 if (compression_type != CompressionType::COMPRESSION_AUTO) {
430256 forced_methods[i] = ForceCompression(storage_manager, functions, compression_type);
430257 }
430258 if (compression_type == CompressionType::COMPRESSION_AUTO) {
430259 auto force_compression = Settings::Get<ForceCompressionSetting>(config);
430260 if (force_compression != CompressionType::COMPRESSION_AUTO) {
430261 forced_methods[i] = ForceCompression(storage_manager, functions, force_compression);
430262 }
430263 }
430264 }
430265
430266 InitAnalyze();
430267
430268
430269 ScanSegments([&](Vector &scan_vector,
idx_t count) {
430270 for (
idx_t i = 0; i < checkpoint_states.size(); i++) {
430273 for (
idx_t j = 0; j < functions.size(); j++) {
430274 auto &state = states[j];
430275 auto &func = functions[j];
430276
430277 if (!state) {
430278 continue;
430279 }
430280 if (!func->analyze(*state, scan_vector, count)) {
430281 state = nullptr;
430282 func = nullptr;
430283 }
430284 }
430285 }
430286 });
430287
430288 vector<CheckpointAnalyzeResult> result;
430289 result.resize(checkpoint_states.size());
430290
430291 for (
idx_t i = 0; i < checkpoint_states.size(); i++) {
430294 auto &forced_method = forced_methods[i];
430295
430296 unique_ptr<AnalyzeState> chosen_state;
430297 idx_t best_score = NumericLimits<idx_t>::Maximum();
430299
430300 D_ASSERT(functions.size() == states.size());
430301 for (
idx_t j = 0; j < functions.size(); j++) {
430302 auto &function = functions[j];
430303 auto &state = states[j];
430304
430305 if (!state) {
430306 continue;
430307 }
430308
430310 bool forced_method_found = function->type == forced_method;
430311
430312
430313 auto score = function->final_analyze(*state);
430314
430317 continue;
430318 }
430319
430320 if (score < best_score || forced_method_found) {
430321 compression_idx = j;
430322 best_score = score;
430323 chosen_state = std::move(state);
430324 }
430326 if (forced_method_found) {
430327 break;
430328 }
430329 }
430330
430331 auto &checkpoint_state = checkpoint_states[i];
430332 auto &col_data = checkpoint_state.get().GetResultColumn();
430333 if (!chosen_state) {
430334 throw FatalException("No suitable compression/storage method found to store column of type %s",
430335 col_data.type.ToString());
430336 }
430338
430339 auto &best_function = *functions[compression_idx];
430340 DUCKDB_LOG_TRACE(db, "ColumnDataCheckpointer FinalAnalyze(%s) result for %s.%s.%d(%s): %d",
430341 EnumUtil::ToString(best_function.type), col_data.info.GetSchemaName(),
430342 col_data.info.GetTableName(), col_data.column_index, col_data.type.ToString(), best_score);
430343 result[i] = CheckpointAnalyzeResult(std::move(chosen_state), best_function);
430344 }
430345 return result;
430346}
vector< vector< unique_ptr< AnalyzeState > > > analyze_states
For every column data that is being checkpointed, the analyze state of functions being tried.
Definition duckdb.cpp:276658
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117