lib/postgres_to_redshift/tuning.rb
# If there is a reference to the optimised table, sort on this column in order to optimise any join with optimised table
# Else, sort by PK to optimise any joins or filter on this table
If there is a reference to the optimised table, sort on this column in order to optimise any join with optimised table
Else, sort by PK to optimise any joins or filter on this table
If there is a reference to the optimised table sort on this column in order to optimise any join with optimised table Else sort by PK to optimise any joins or filter on this table
def sort_keys
      sort_key_column_names = if can_optimise_for_different_table?
                           [foreign_key_column_name_to_optimised_table]
                         else
                           [primary_key_column_name].compact
                         end
      sort_key_column_names + DEFAULT_SORT_KEYS.select { |column_name| table_includes_column?(column_name) }
    end
def sort_keys sort_key_column_names = if can_optimise_for_different_table? [ foreign_key_column_name_to_optimised_table ] else [ primary_key_column_name ] . compact end sort_key_column_names + DEFAULT_SORT_KEYS . select { | column_name | table_includes_column? ( column_name ) } end
If there is a reference to the optimised table, sort on this column in order to optimise any join with optimised table
Else, sort by PK to optimise any joins or filter on this table
If there is a reference to the optimised table sort on this column in order to optimise any join with optimised table Else sort by PK to optimise any joins or filter on this table