Skip to content

Navigation Menu

Sign in
Sign up

In the implementation of TDE, why is encryption performed before compression? What is the rationale behind this? #1495

Unanswered
wsg314 asked this question in Q&A
Discussion options

From the perspective of TDE function implementation, the sequence of operations when reading data is: read data -> decompress data -> decrypt data; when writing data, the sequence is: encrypt data -> compress data -> write data to disk. Placing the encryption operation before the compression operation almost renders the compression ineffective. Why is this processing method adopted?

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Generally, data should be compressed first and then encrypted when written.
However, when TDE was first designed, it mainly aimed to support heap tables, which do not support compression.
AO/AOCS tables were implemented later; to keep the code simple, the same codebase was reused, so the order of compression and encryption was not taken into account.

You must be logged in to vote
3 replies
Comment options

Do you have any plans to readjust the processing sequence in the future?

Comment options

I am working on other projects and have no plans to process the encryption and compression sequence issues.

Comment options

tuhaihe Dec 22, 2025
Collaborator

Hi @wsg314 welcome to contribute if you have a chance. 🫶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /