Page 1 of 1

discriminator column index

Posted: Wed 25 Jan 2012 16:54
by mindplay
In the Column Editor, I can specify an Index Name - but this seems to have no effect on the generated schema?

Specifically, I have a discriminator-column on a table-per-hierarchy inheritance - and I'm trying to improve performance of searches for a particular sub-type, by adding an index to the discriminator column.

I've also attempted to configure a simple index on a "Created" DateTime column, but that seems to have no effect either...

Am I missing something, or how do you configure indexes?

Posted: Fri 27 Jan 2012 09:14
by Shalex
mindplay wrote:In the Column Editor, I can specify an Index Name - but this seems to have no effect on the generated schema?
Do you want the statements for creating indexes be generated in the script when using Generate Database Script From Model if Index Name is set for the corresponding column?

At the moment NHibernate runtime uses index which is already created in the database and is specified in Index Name.

Posted: Fri 27 Jan 2012 15:07
by mindplay
The idea is to create and maintain the database schema from within ED, rather than having to build and maintain it by hand, right?

Indexes are just another aspect of the database schema.

So yes, I was expecting that indexes would be generated and updated (added/removed) the same way table and column migrations are performed with the "update database" tool.

Is there a reason why I would want to maintain this by hand? (and don't take that question the wrong way - I think there might well be a reason why somebody would want to do this by hand, but I can't think of a reason myself...)

Posted: Mon 30 Jan 2012 17:49
by Shalex
Thank you for your suggestion. We will investigate the issue and post here about the results.