-->
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.  [ 2 posts ] 
Author Message
 Post subject: Optimisation: INSERT and INDEX disabling
PostPosted: Sat Nov 22, 2008 7:52 am 
Newbie

Joined: Sat Nov 22, 2008 7:45 am
Posts: 3
Hello,

I have spend some time searching the forums and Google... But I found nothing.

I have a table named 'Log'... Each time I doing something I insert a line saying what have been done by Who/When and What.

For example, when I am inserting an user I have a row like that:

<code>
NEWUSER date createdUser_id
</code>

Note that a row reference entitis like the created user...

The problem is that I have a lot of INSERT in this table and hibernates created an index for each column referencing another entity.

For example, this time I have an index for the createdUser_id column.

My questions are:

1°) is it possible to disable INDEX here, because, the insert is longuer (I think) and I will never make some search in the Log table or the time won't be a problem..

2°) Is it possible to give a pleasant name to created indexes ?


Thanks a lot.

Best Regards,

Frederic


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2008 1:58 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
....hibernates created an index for each column referencing another entity.


No, I don' think so. Hibernate only creates an index if you have told Hibernate to do so. For example, with index, unique or any other related tag attribute.

It could be that the database you are using requires an index on foreign-key columns. I know that MySQL has this requirement, and automatically creates an index if one doesn't already exists.


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

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.