Grails GORM and indices deficiencies which I hope get addressed in near future.

Someone really needs to do something to improve the way GORM specifies indices.

This post came about because I wanted to improve my post from the other day and add an index by Person, then Linkedingroup. The index that gets created when you have a compound key in this scenario, is to revert to creating a duplicate of the primary key.

I can only create an index by person_id at the moment to facilitate deletion of LinkedInGroup member records more efficiently. See:

LinkedInGroupMember.groovy v1

show indices

indices results v1

LinkedInGroupMember.groovy v2

indices results v2

There was this post on the Grails.org website, that appears to have not been implemented. Sounded better than what we’ve got currently, which is this (1 2). :-(

There were some interesting discussions on the mailing list recently (1 2)and JPA seems to offer a better solution via annotations. Still don’t know if ASC/DESC option was included.

From what I can make out there seems to be some sort of Hibernate limitation that is preventing this moving foward.

Would appreciate take from Graeme Rocher & the Grails team as to how this can be improved and a clearer indication as to what’s holding up the improvement.

Advertisements

About this entry