AR changes to support creating ordered (asc, desc) indexes #3529

merged 1 commit into from Nov 5, 2011


None yet

2 participants


Allows to have AR migrations that create indexes with specified per-column order (asc, desc) for some extra performance fine-tuning, e.g. . Supported by most SQL databases.

add_index(:accounts, [:branch_id, :party_id], :order => {:branch_id => :desc, :part_id => :asc})


CREATE INDEX by_branch_desc_party ON accounts(branch_id DESC, party_id ASC)

(this is to replace pull request 3351)

@jonleighton jonleighton merged commit 2751e21 into rails:master Nov 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment