# TDE with PgSQL 17

**URL:** <https://forums.percona.com/t/tde-with-pgsql-17/39549>\
**Category:** PostgreSQL\
**Created:** [October 14, 2025, 11:33am UTC](https://forums.percona.com/t/tde-with-pgsql-17/39549 "2025-10-14T11:33:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashish\_Mukherjee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ashish_mukherjee/32/19539_2.png) [@Ashish\_Mukherjee](https://forums.percona.com/u/Ashish_Mukherjee)\
**Post date:** [October 14, 2025, 11:33am UTC](https://forums.percona.com/t/tde-with-pgsql-17/39549/1 "2025-10-14T11:33:02Z")

</div>

I upgraded a TDE database to PgSQL 17 from PgSQL 12. My non-TDE pgsql 17 databases work fine. However, the TDE one I upgraded has the problem that query planner takes too long. Details below -

DB size: 4T

No. of tables - 10K

Largest tables - 100M tuples

The planning time for query on pgsql 17 v 12, TDE-enabled

**s14=\> explain analyze select invoicenum from ltlinvoice where pseq=1400000224216382;  
QUERY PLAN**

Index Scan using ltlinvoice\_pseq on ltlinvoice (cost=0.43..10.10 rows=9 width=12) (actual time=0.040..0.040 rows=0 loops=1)  
Index Cond: (pseq = ‘1400000224216382’::bigint)  
Planning Time: 158.199 ms  
Execution Time: 0.051 ms

**s14=\> explain analyze select invoicenum from ltlinvoice where pseq=1400000224216382;  
QUERY PLAN**

Index Scan using ltlinvoice\_pseq on ltlinvoice (cost=0.43..10.10 rows=9 width=12) (actual time=0.023..0.023 rows=0 loops=1)  
Index Cond: (pseq = ‘1400000224216382’::bigint)  
Planning Time: 0.195 ms  
Execution Time: 0.046 ms

Please advise about the reason for this problem and potential solutions.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 14, 2025, 2:59pm UTC](https://forums.percona.com/t/tde-with-pgsql-17/39549/2 "2025-10-14T14:59:25Z")

</div>

Can you please compare pgsql17-TDE vs pgsql17-noTDE? Let’s make sure that the issue is with TDE.
