Improving PostgreSQL Sequence Cache Performance With YugabyteDB
Npgsql discards sequence cache after each connection, impacting scalability. YugabyteDB offers server-side caching to mitigate this issue.
Npgsql, the Entity Framework data provider for PostgreSQL, issues a DISCARD ALL or DISCARD SEQUENCES command after each connection is released to the pool, unless No Reset On Close=true, in which case no discard is called. Discarding the changes made by the connection, such as temporary tables or parameter settings, is a good idea. However, the sequence cache is a feature explicitly set when creating a sequence to optimize them, and starting each connection with a cold cache, when grabbed from the pool, is not desirable. The consequence of discarding those is that you cannot scale your applica...