-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: many-to-many and index creation.
PostPosted: Mon Sep 04, 2006 7:33 am 
Newbie

Joined: Sat Jan 22, 2005 9:39 am
Posts: 10
Hi,

Is it possible to specify to create indexes on each column of the
primary key of an association table ( the third table for many-to-many
association ) ?

For example, hbm2ddl will generate :

create table T_PERSONADDRESS (
PERSON_ID number(10,0) not null,
ADDRESS_ID number(10,0) not null,
primary key (PERSON_ID, ADDRESS_ID)
);

I would like he is able to add the following indexes :

CREATE INDEX INDEX1 ON T_PERSONADDRESS(PERSON_ID);
CREATE INDEX INDEX2 ON T_PERSONADDRESS(ADDRESS_ID);

It is important because with a select like this :
select * from t_personaddress where person_id = 1 ;

Oracle will use a full fast index scan if there is no index.
and with the indexes, a "table access by index row id" will be used ( faster ).

But i have seen no mean to specify these indexes in the hibernate
mapping for the many-to-many relation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.