Skip to content

Commit

Permalink
Better place for index_covers method
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Aug 31, 2018
1 parent 9dd8cd2 commit 7dc97c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib/pghero/methods/indexes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ def index_bloat(min_size: nil)
index_name
SQL
end

protected

def index_covers?(indexed_columns, columns)
indexed_columns.first(columns.size) == columns
end
end
end
end
4 changes: 0 additions & 4 deletions lib/pghero/methods/suggested_indexes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ def best_index_structure(statement)
{table: table, where: where, sort: sort}
end

def index_covers?(indexed_columns, columns)
indexed_columns.first(columns.size) == columns
end

# TODO better row estimation
# https://www.postgresql.org/docs/current/static/row-estimation-examples.html
def row_estimates(stats, total_rows, rows_left, op)
Expand Down

0 comments on commit 7dc97c6

Please sign in to comment.