lib/dexter/indexer.rb in pgdexter-0.3.5 vs lib/dexter/indexer.rb in pgdexter-0.3.6

- old
+ new

@@ -105,17 +105,17 @@ # analyze tables if needed analyze_tables(tables) if tables.any? && (@analyze || @log_level == "debug2") # create hypothetical indexes and explain queries - candidates = tables.any? ? create_hypothetical_indexes(queries.select(&:candidate_tables), tables) : {} + candidates = tables.any? ? create_hypothetical_indexes(queries.select(&:candidate_tables)) : {} # see if new indexes were used and meet bar new_indexes = determine_indexes(queries, candidates, tables) # display and create new indexes - show_and_create_indexes(new_indexes, queries, tables) + show_and_create_indexes(new_indexes, queries) end private def create_extension @@ -191,11 +191,11 @@ end puts if @log_explain end end - def create_hypothetical_indexes(queries, tables) + def create_hypothetical_indexes(queries) candidates = {} # get initial costs for queries calculate_plan(queries) explainable_queries = queries.select { |q| q.explainable? && q.high_cost? } @@ -415,10 +415,10 @@ else "None" end end - def show_and_create_indexes(new_indexes, queries, tables) + def show_and_create_indexes(new_indexes, queries) # print summary if new_indexes.any? new_indexes.each do |index| log "Index found: #{index[:table]} (#{index[:columns].join(", ")})" end