From 20bf5e56044685cdc7445c3f56614143181f4a1a Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 26 Feb 2024 23:56:27 -0800 Subject: [PATCH] Removed invert --- lib/dexter/indexer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dexter/indexer.rb b/lib/dexter/indexer.rb index 4e46536f..119ce29b 100644 --- a/lib/dexter/indexer.rb +++ b/lib/dexter/indexer.rb @@ -282,9 +282,8 @@ def hypo_indexes_from_plan(index_name_to_columns, plan, index_set) query_indexes end - def determine_indexes(queries, candidates, tables) + def determine_indexes(queries, index_name_to_columns, tables) new_indexes = {} - index_name_to_columns = candidates.invert # filter out existing indexes # this must happen at end of process @@ -595,7 +594,8 @@ def create_hypothetical_indexes_helper(columns_by_table, n, candidates) columns_by_table.each do |table, cols| # no reason to use btree index for json columns cols.reject { |c| ["json", "jsonb"].include?(c[:type]) }.permutation(n) do |col_set| - candidates[col_set] = create_hypothetical_index(table, col_set) + index_name = create_hypothetical_index(table, col_set) + candidates[index_name] = col_set end end end