You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
This discussion was converted from issue #3566 on June 28, 2024 16:47.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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?
Beta Was this translation helpful? Give feedback.
All reactions