fix: Performance and high memory usage of relation hint calculation

* Calculation of hint message when requested relation is not present in schema cache requires creation of a FuzzySet (to use fuzzy search to find candidate tables). For schemas with many tables it is costly.
This patch introduces dbTablesFuzzyIndex in SchemaCache to memoize the FuzzySet creation.

* Additionally, because of FuzzySet large memory requirements, this patch introduces a limit of 500 relations per schema, above which FuzzySet is not created and hint calculation disabled.

(cherry picked from commit e592d568c6)
This commit is contained in:
Michał Kłeczek
2026-01-03 15:18:37 +08:00
committed by Steve Chavez
parent 01bdb05c89
commit e252a4900c
7 changed files with 86 additions and 29 deletions
+1
View File
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. From versio
- Fix not returning `Content-Length` on empty HTTP `201` responses by @laurenceisla in #4518
- Fix inaccurate Server-Timing header durations by @steve-chavez in #4522
- Fix inaccurate "Schema cache queried" logs by @steve-chavez in #4522
- Fix performance and high memory usage of relation hint calculation by @mkleczek in #4462 #4463
## [14.1] - 2025-11-05