Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:04:48+00:00 2026-06-18T21:04:48+00:00

Is it possible to use the CreateIndex syntax of EF Code First Migrations to

  • 0

Is it possible to use the CreateIndex syntax of EF Code First Migrations to create a Covering Index (*see below for what a Covering Index is).

For example I can create a simple index in a manual migration like so:

CreateIndex("RelatedProduct", "RelatedId");

It has a final argument named “anonymous arguments” that specifies it can handle whatever the underlying provider supports – but it’s not clear how I determine what that support would be. Is this possible or do I need to resort to flat SQL?

*A Covering Index is one where the RDB stores duplicated data in the leaf nodes, not just pointers to the main table. It’s essentially a duplication of a table reordered by the columns in the index, containing just the columns most used in that type of search.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:04:49+00:00Added an answer on June 18, 2026 at 9:04 pm

    I think the covering index is non-clustered index which covers the query (so it doesn’t require any additional lookups back to the table). What you describe is additional feature of such index which allows you including data which are not part of the index key on the leaf level.

    CreateIndex doesn’t support that now. You must either use Sql directly or you can check EF’s source code and add support for INCLUDE into CreateIndex call, CreateIndexOperation and related Generate method in SQL Generator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an index using EF Code Migrations. The index looks
Do I need to create all objects which i will possible use with itemRenderer
Can functors be defined locally within the body of a function? One possible use
I've got (for example) an index: CREATE INDEX someIndex ON orders (customer, date); Does
This is a two part question. First, is it possible use a generic defined
We are trying to create an index on CDX and ADT tables that use
Is it possible use regex to remove small words in a text? For example,
It is possible use Sphinx RT index in conjunction with Mysql innodb table for
Possible Duplicate: How to use index in select statement? Let me be specific: I
Is it possible use in-explicit constructing with operators ? Just like in this example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.