-->
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.  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Recursive CTE based sequence generators
PostPosted: Wed Aug 23, 2017 9:26 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
Quote:
Btw. How do you use hi-lo when you actually want to use a sequence which increments by another value than 1?


Hi/lo is deprecated. There's no reason to use it anymore. You should use pooled or pooled-lo instead.

Now, about gaps. There's no performance impact for having a sequence with an INCREMENT BY, and, usually, you'd pick a reasonable increment, like 2 or 5, depending on how many entities you tend of creating in a batch.

One example: an Image always has 5 Versions. Then, the Version sequence will use an INCREMENT BY 5 because I will always create 5 Version objects belonging to an Image.

If most of the time you are inserting a single entity, then you don't need any optimizer. However, if you have a batch process which imports hundreds of entities, then you should use an optimizer.


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

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.