Skip to content

Support for index ordering (ASC/DESC) #4150

Description

@natemcmaster

After discussion on #11846, we decided that the way to handle this is to allow multiple named indexes to be created over columns, while still preserving the current semantics (i.e. addressing by ordered property set) for unnamed indexes.

Original issue:
Add support for column sort order to migrations, metadata, and reverse engineering.

  • Add API to specific ascending/descending columns in an index (
    CREATE INDEX IX_1 ON Table ( Col1 DESC, Col2 ASC) )
  • Add to reverse engineering database model (prototype here)
  • Adapt to older version of SQLite (sort order is not supported < 3.8.9)

Activity

  1. added this to the Backlog milestone on Jan 6, 2016
  2. jjxtra commented on Mar 5, 2018

    @jjxtra

    Is this going to happen anytime soon? Using EfCore.Shaman to workaround this issue and others at the moment...

  3. ajcvickers commented on Mar 5, 2018

    @ajcvickers
    Contributor

    @jjxtra This issue is in the Backlog milestone. This means that it is not going to happen for the 2.1 release. We will re-assess the backlog following the 2.1 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

  4. changed the title [-]Support column sort order in indexes[/-] [+]Support indexes with DESC order by allowing named indexes[/+] on Jun 4, 2018
  5. roji commented on Feb 18, 2019

    @roji
    Member

    Note that this is being done in Npgsql as part of npgsql/efcore.pg#705. It would ideally be better to have implemented here as well so that Npgsql can align (and reuse the same SortOrder enum, possibly).

  6. bhugot commented on Dec 10, 2019

    @bhugot

    Hello any news ont this feature

  7. ajcvickers commented on Dec 10, 2019

    @ajcvickers
    Contributor

    @bhugot This issue is in the Backlog milestone. This means that it is not currently planned for any upcoming release. We will re-assess the backlog for 5.0 and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

  8. changed the title [-]Support indexes with DESC order by allowing named indexes[/-] [+]Support multiple indexes over same column(s) with differing ASC/DESC or collation[/+] on Apr 16, 2020
  9. roji commented on Apr 16, 2020

    @roji
    Member

    Another variant of this issue is for having multiple indexes on the same column, but with different collations (supported by PostgreSQL and Sqlite, but not SQL Server and MySQL).

  10. removed this from the Backlog milestone on May 28, 2020
  11. lajones commented on May 28, 2020

    @lajones
    Contributor

    Clearing Milestone to reconsider this, or part of this, for 5.0 per this comment.

  12. added this to the Backlog milestone on Jun 1, 2020
  13. 32 remaining items

  14. added 2 commits that reference this issue on Jan 19, 2022
    f9cfaaf
    23fb416
  15. added a commit that references this issue on Jan 22, 2022
    786798e
  16. modified the milestones: 7.0.0, on Feb 14, 2022
  17. changed the title [-]Add support for index ordering (ASC/DESC)[/-] [+]Support for index ordering (ASC/DESC)[/+] on Feb 28, 2022
  18. modified the milestones: , 7.0.0 on Nov 5, 2022
  19. added theissue type on Jun 15, 2025
  20. marked Defining columns index sort #24029 as a duplicate of this issue on Jun 16, 2025
  21. marked IIndex enhancements #1868 as a duplicate of this issue on Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions