0

In the example here: https://www.percona.com/blog/postgresql-column-alignment-and-padding-how-to-improve-performance-with-smarter-table-design/ enter image description here

Why doesn't PostgreSQL add 2 bytes padding after the int2 in t2 to align the word correctly?

1 Answer 1

0

Why should PostgreSQL add padding bytes to the tuple? The next tuple will start at an address that is divisible by eight, and if there is unused space left between the tuples, it belongs to none of them. Increasing the size of a tuple for no good reason would be a bad thing to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.