Re: Query taking long with levenshtein function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query taking long with levenshtein function
Дата
Msg-id 1278258.1677627051@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query taking long with levenshtein function  (Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>)
Список pgsql-admin
Teju Jakkidi vlogs <teja.jakkidi05@gmail.com> writes:
> We have a query as below which uses the levenshtein function to compare
> strings.

> SELECT "name", levenshtein("name",'some string') as p FROM table1
> where levenshtein("name",'some string')   <= 2 order by p desc;

> We have a GIST index built on top of this table as below:
> CREATE INDEX gist_idx ON table1 USING GIST("name");

AFAIK, that index is completely useless for this query.  I don't
really see a good way to index it either --- "levenshtein distance
less than X" seems like a not very tractable requirement.  Can
you formulate your matching rules some other way?

            regards, tom lane



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

Предыдущее
От: Teju Jakkidi vlogs
Дата:
Сообщение: Query taking long with levenshtein function
Следующее
От: "Govardhan .G"
Дата:
Сообщение: Forcasting in Postgresql