From ea8b4ec5cb66ded102ef417b64a2c203eafb68eb Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 8 Oct 2026 14:12:26 -0700 Subject: [PATCH] Skip the account-led search index on tables without an account column 2026.10.9 added an (account, column) index for every sorted search column, but the tracing table has no account column, so each node logged a build warning at startup for the one CREATE INDEX that failed. The index is now only made where the table's primary key has the account. --- crates/store/src/backend/postgres/main.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/store/src/backend/postgres/main.rs b/crates/store/src/backend/postgres/main.rs index 9854871d..98a39849 100644 --- a/crates/store/src/backend/postgres/main.rs +++ b/crates/store/src/backend/postgres/main.rs @@ -306,14 +306,17 @@ async fn create_search_tables( .map_err(into_error)?; // inbuxa: every sorted query is for one account, so an index led // by the account column answers "this account, in this order" - // with an ordered scan instead of sorting the account's rows - let account_column = SearchField::AccountId.column(); - let create_index_query = format!( - "CREATE INDEX IF NOT EXISTS idx_{table_name}_{account_column}_{column_name} ON {table_name}({account_column}, {column_name})", - ); - conn.execute(&create_index_query, &[]) - .await - .map_err(into_error)?; + // with an ordered scan instead of sorting the account's rows. + // The tracing table has no account column. + if T::primary_keys().contains(&SearchField::AccountId) { + let account_column = SearchField::AccountId.column(); + let create_index_query = format!( + "CREATE INDEX IF NOT EXISTS idx_{table_name}_{account_column}_{column_name} ON {table_name}({account_column}, {column_name})", + ); + conn.execute(&create_index_query, &[]) + .await + .map_err(into_error)?; + } } } -- 2.54.0