mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
0a5d5a49d9
Since gtrgm_penalty() is usually called many times in a row with the same "newval" (to determine which item on an index page newval fits into best), the makesign() calculation is repetitious. It's expensive enough to make it worth caching the result, so do so. On my machine this is good for more than a 40% savings in the time needed to build a trigram index on /usr/share/dict/words. This is all per a suggestion of Heikki's. In passing, make some mostly-cosmetic improvements in the caching logic in the other functions in this file that rely on caching info in fn_extra. |
||
---|---|---|
.. | ||
data | ||
expected | ||
sql | ||
.gitignore | ||
Makefile | ||
pg_trgm--1.0.sql | ||
pg_trgm--unpackaged--1.0.sql | ||
pg_trgm.control | ||
trgm_gin.c | ||
trgm_gist.c | ||
trgm_op.c | ||
trgm.h |