Skip to content

Commit

Permalink
Removed invert
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 27, 2024
1 parent 9e93dc1 commit 20bf5e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dexter/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 20bf5e5

Please sign in to comment.