[Feature] Optimizing column alignment #6541

Closed
opened 2026-01-22 15:34:47 +01:00 by admin · 3 comments
Owner

Originally created by @flaushi on GitHub (Sep 17, 2020).

Dear community,

I just stumbled over this article https://www.2ndquadrant.com/en/blog/on-rocks-and-sand/ where the benefits of an optimized column alignment are discussed.

I never thought about this before "because doctrine does all this for me". But is this true? When creating the sql statements to create the schema, is the column order optimized?

The rule of thumb to take large columns first looks like doctrine could implement this easily...?

Originally created by @flaushi on GitHub (Sep 17, 2020). Dear community, I just stumbled over this article https://www.2ndquadrant.com/en/blog/on-rocks-and-sand/ where the benefits of an optimized column alignment are discussed. I never thought about this before "because doctrine does all this for me". But is this true? When creating the sql statements to create the schema, is the column order optimized? The rule of thumb to take large columns first looks like doctrine could implement this easily...?
admin closed this issue 2026-01-22 15:34:47 +01:00
Author
Owner

@beberlei commented on GitHub (Sep 17, 2020):

@flaushi This is outside of Doctrine's scope. We do not recommend to use the SchemaTool directly on production / deployment anyways, you are free to optimize the generated DDL SQL statements in a way that reduces the required table space by aligning columns better.

@beberlei commented on GitHub (Sep 17, 2020): @flaushi This is outside of Doctrine's scope. We do not recommend to use the SchemaTool directly on production / deployment anyways, you are free to optimize the generated DDL SQL statements in a way that reduces the required table space by aligning columns better.
Author
Owner

@flaushi commented on GitHub (Sep 17, 2020):

@beberlei Ok, it was just an idea.

We do not recommend to use the SchemaTool directly on production

I guess thousands of users did not expect that.

@flaushi commented on GitHub (Sep 17, 2020): @beberlei Ok, it was just an idea. > We do not recommend to use the SchemaTool directly on production I guess thousands of users did not expect that.
Author
Owner

@beberlei commented on GitHub (Sep 17, 2020):

There is a big fat warning about it in the documentation as the first sentence about explaining SchemaTool: https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/tools.html#database-schema-generation

@beberlei commented on GitHub (Sep 17, 2020): There is a big fat warning about it in the documentation as the first sentence about explaining SchemaTool: https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/tools.html#database-schema-generation
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6541