Re: pg_trgm Memory Allocation logic
| От | Alvaro Herrera |
|---|---|
| Тема | Re: pg_trgm Memory Allocation logic |
| Дата | |
| Msg-id | 20150309125456.GK3291@alvh.no-ip.org обсуждение исходный текст |
| Ответ на | pg_trgm Memory Allocation logic (Beena Emerson <memissemerson@gmail.com>) |
| Ответы |
Re: pg_trgm Memory Allocation logic
|
| Список | pgsql-hackers |
Beena Emerson wrote: > In the pg_trgm module, within function generate_trgm, the memory for trigrams > is allocated as follows: > > trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) *3); > > I have been trying to understand why this is so because it seems to be > allocating more space than that is required. Maybe it's considering a worst-case for multibyte characteres? I don't really know if trgm supports multibyte, but I assume it does. If it does, then probably the trigrams consist of chars, not bytes. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: