# @SequenceGenerator: allocationSize versus INCREMENT BY

**URL:** <https://discourse.hibernate.org/t/sequencegenerator-allocationsize-versus-increment-by/5070>\
**Category:** Hibernate ORM\
**Created:** [February 16, 2021, 10:19pm UTC](https://discourse.hibernate.org/t/sequencegenerator-allocationsize-versus-increment-by/5070 "2021-02-16T22:19:40Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [February 19, 2021, 9:47am UTC](https://discourse.hibernate.org/t/sequencegenerator-allocationsize-versus-increment-by/5070/8 "2021-02-19T09:47:36Z")

</div>

I don’t know if the JPA TCK has anything to say about the `allocationSize`, but the spec document says:

> The amount  
> to increment by when  
> allocating numbers  
> from the generator/sequence.

What should hbm2ddl `update` do in such a case where increment size \> allocation size?

This is a pretty special use case for which it IMO is ok to require a user to write/configure a custom optimizer. I don’t think it is very common to intentionally introduce gaps in sequence values. Hope you understand this.

---

_[View the full topic](https://discourse.hibernate.org/t/sequencegenerator-allocationsize-versus-increment-by/5070)._
