Hi,
I have a many-to-many relation between a Hit and an Item like
Code:
class Hit {
..
@IndexedEmbedded(depth = 1)
//@ManyToMany(fetch = FetchType.LAZY)
@ManyToMany(fetch = FetchType.EAGER)
@Sort(type = SortType.COMPARATOR, comparator = BranchComparator.class)
//@Analyzer(definition="StandardanalyzerSearch")
private SortedSet<Item> items;
..
}
Code:
The Item does not have a reference to Hit, so u can do hit.getItems() but not item.getHits()
The Hit has a compound(bigint, varchar) key and the item a simple key(int), so the table consists of 3 columns with those keys
Code:
CREATE TABLE `hits_items` (
`hits_id` bigint(20) NOT NULL,
`hits_source` varchar(255) COLLATE utf8_bin NOT NULL,
`items_id` bigint(20) NOT NULL,
PRIMARY KEY (`hits_id`,`hits_source`,`items_id`)
) ENGINE=MyISAM
There are about 22 mil of them with a size of about .5G
The problem is that Hibernate is generating all possible intexes for this mapping table
ie
Primary: hit_id, hit_source, item_id
(2nd index):hit_id, hit_source
(3rd index):item_id
I dont need and dont want the 2 and 3rd indexes but hibernate always makes them automatically, how can I stop this from happening ?
Thanks