Re: Suggestion to improve query performance for GIS query.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Suggestion to improve query performance for GIS query.
Дата
Msg-id CAKFQuwaKE4mieDL+V-Ek2Mu2OrfWC5+wNA9bqGf0=Ok6uEt60Q@mail.gmail.com
обсуждение исходный текст
Ответ на Suggestion to improve query performance for GIS query.  (postgann2020 s <postgann2020@gmail.com>)
Список pgsql-performance
On Thursday, May 21, 2020, postgann2020 s <postgann2020@gmail.com> wrote:

SELECT seq_no+1 INTO pair_seq_no FROM SCHEMA.TABLE WHERE (Column1 like '%,sheath--'||cable_seq_id ||',%' or Column1 like 'sheath--'||cable_seq_id ||',%' or Column1 like '%,sheath--'||cable_seq_id  or Column1='sheath--'||cable_seq_id) order by seq_no desc limit 1 ;


Could you please suggest a better way to execute the query

Add a trigger to the table to normalize the contents of column1 upon insert and then rewrite your query to reference the newly created normalized fields.

David J.

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

Предыдущее
От: postgann2020 s
Дата:
Сообщение: Suggestion to improve query performance for GIS query.
Следующее
От: Mohammed Afsar
Дата:
Сообщение: Re: Suggestion to improve query performance for GIS query.