DDC-577: Change default allocationSize from 10 to 1 #711

Closed
opened 2026-01-22 12:47:40 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (May 7, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jantichy:

I propose to change the default value of allocationSize for sequence columns from current 10 to 1. It's defined in $definition['allocationSize'] in Doctrine/ORM/Mapping/ClassMetaFactory.php.

The improvement request is based on detailed discussion on http://www.doctrine-project.org/jira/browse/DDC-569?focusedCommentId=12855&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12855

Current default value for allocationSize=10 is CONFUSING and I am sure it will cause problems and misunderstoods for many people in future.

The core of the problem is that lot of people define table structure manually, separately from entity annotations. And while the default allocationSize is 10, they have to remember (and they have to know they should remember) each time they write new table and new entity, that:

a) They have to define each the sequence in database manually with INCREMENT BY 10
b) OR they have to define in each entity manually the annotation for @SequenceGenerator - allocationSize=1
c) OR they have to manually use strategy="IDENTITY", but it's primarily related to primary keys, not to all sequences at general.

Shortly, in an intuitive way everybody assumes the behaviour as allocationSize would be 1. Current default value 10 is not in accord with this intuitive perception and will cause many questions and misunderstoods.

The "preloading" of 10 values at once is a kind of "advanced optimalization" - it's great it is available and implemented - but it should not be applied automatically, but only after explicit setup.

Originally created by @doctrinebot on GitHub (May 7, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jantichy: I propose to change the default value of allocationSize for sequence columns from current 10 to 1. It's defined in $definition['allocationSize'] in Doctrine/ORM/Mapping/ClassMetaFactory.php. The improvement request is based on detailed discussion on http://www.doctrine-project.org/jira/browse/[DDC-569](http://www.doctrine-project.org/jira/browse/DDC-569)?focusedCommentId=12855&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12855 Current default value for allocationSize=10 is CONFUSING and I am sure it will cause problems and misunderstoods for many people in future. The core of the problem is that lot of people define table structure manually, separately from entity annotations. And while the default allocationSize is 10, they have to remember (and they have to know they should remember) each time they write new table and new entity, that: a) They have to define each the sequence in database manually with INCREMENT BY 10 b) OR they have to define in each entity manually the annotation for @SequenceGenerator - allocationSize=1 c) OR they have to manually use strategy="IDENTITY", but it's primarily related to primary keys, not to all sequences at general. Shortly, in an intuitive way everybody assumes the behaviour as allocationSize would be 1. Current default value 10 is not in accord with this intuitive perception and will cause many questions and misunderstoods. The "preloading" of 10 values at once is a kind of "advanced optimalization" - it's great it is available and implemented - but it should not be applied automatically, but only after explicit setup.
admin added the Improvement label 2026-01-22 12:47:40 +01:00
admin closed this issue 2026-01-22 12:47:41 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 5, 2010):

Comment created by romanb:

This should be changed for BETA3.

@doctrinebot commented on GitHub (Jun 5, 2010): Comment created by romanb: This should be changed for BETA3.
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Comment created by @beberlei:

Fixed and scheduled for 2.0 BETA 3

@doctrinebot commented on GitHub (Jun 13, 2010): Comment created by @beberlei: Fixed and scheduled for 2.0 BETA 3
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jun 13, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Aug 12, 2010):

Comment created by @guilhermeblanco:

Actually patch was only committed now.

5719f8523b

@doctrinebot commented on GitHub (Aug 12, 2010): Comment created by @guilhermeblanco: Actually patch was only committed now. http://github.com/doctrine/doctrine2/commit/5719f8523bbb3c8a6fd11c749e5317b238d3d2b3
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#711