Re: Patch: pg_trgm: gin index scan performance for similarity search

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Patch: pg_trgm: gin index scan performance for similarity search
Дата
Msg-id CAPpHfduvmuQRzmKUWG-i0EgAw=NhDH=3PfDQ6jdnpsxcSx0GvA@mail.gmail.com
обсуждение исходный текст
Ответ на Patch: pg_trgm: gin index scan performance for similarity search  (Fornaroli Christophe <cfornaro@gmail.com>)
Список pgsql-hackers
Hi, Christophe!

On Thu, Dec 24, 2015 at 6:28 PM, Fornaroli Christophe <cfornaro@gmail.com> wrote:
This code uses this upper bound for the similarity: ntrue / (nkeys - ntrue). But if there is ntrue trigrams in common, we know that the indexed string is at least ntrue trigrams long. We can then use a more aggressive upper bound: ntrue / (ntrue + nkeys - ntrue) or ntrue / nkeys. Attached is a patch that changes this.
 
​Good catch, thank you! The estimate in pg_trgm was not optimal.
I think it would be good to add comment which would explicitly state why do we use this upper bound.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Chapman Flack
Дата:
Сообщение: missing "SPI_finish" that isn't missing
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Commit fest status for 2015-11