mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[Feature] Optimizing column alignment #6541
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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...?
@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.
@flaushi commented on GitHub (Sep 17, 2020):
@beberlei Ok, it was just an idea.
I guess thousands of users did not expect that.
@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