Skip to content

RDoc-3860 Auto-index is created when querying a collection with "order by" and no filtering - #2732

Open
Danielle9897 wants to merge 1 commit into
ravendb:mainfrom
Danielle9897:RDoc-3860-auto-index-creation
Open

Danielle9897 wants to merge 1 commit into
ravendb:mainfrom
Danielle9897:RDoc-3860-auto-index-creation

Conversation

@Danielle9897

Copy link
Copy Markdown
Member

Issue link

https://issues.ravendb.net/issue/RDoc-3860/Auto-index-is-created-when-querying-a-collection-with-order-by-and-no-filtering

Additional description

  • Updated documentation to explain that sorting a collection query uses or creates an auto-index even without filtering.
  • Aligned related explanations, examples, and comments across supported client languages.
  • Clarified when full-collection and ID-only queries avoid auto-index creation.

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

@Danielle9897
Danielle9897 requested a review from Lwiel November 8, 2026 11:55
##### Auto-indexes:

* An auto-index is created by the server when making a filtering query that doesn't specify which index to use.
* When a dynamic query filters on fields other than the document ID, or sorts the results, RavenDB uses a suitable existing auto-index or creates one if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried that the word filter may be mistakenly associated with filter clause. Maybe we could rather use phrases like this? "When querying dynamically by fields other than the document ID, or sorts the results, RavenDB uses a suitable existing auto-index or creates one if needed."

* Auto-indexes are created when all of the following conditions are met:
* A query is issued without specifying an index (a dynamic query).
* The query includes a filtering condition.
* The query filters on fields other than the document ID, or sorts the results (`order by`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group by clause also creates an auto index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants