Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Creating an index with a specific column order over a foreign key and a discriminator #3567

Unanswered
TiltonJH asked this question in Q&A
Discussion options

Hi,

I'm using the current version of NH as well as FluentNH.

Using the DDL capabilities of NH, a multi-column index over value or foreign key columns uses the order in which those columns get mapped.

I'm looking for a way to create an index over a foreign key column and a discriminator column, where the foreign key column is the first in the multi-column index. However, I always end up with the discriminator column being first.

My goal is to increase the index performance. Which means the column with the most diverse values should come first. This clearly means the foreign key column needs to come first.

Can I somehow reorder the columns within a mapped index, or even reorder all the columns? Alternatively, can a discriminator column double as a regular a value column? Therefore, I would create the index over a foreign key column and a value column instead?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #3566 on June 28, 2024 16:47.

AltStyle によって変換されたページ (->オリジナル) /