Re: LIKE CLAUSE on VIEWS

Поиск
Список
Период
Сортировка
От Rick Otten
Тема Re: LIKE CLAUSE on VIEWS
Дата
Msg-id CAMAYy4Ke34PHQzAQvj1qv7sbUz6xZVSXNTtmWHbGJrF_9_pq4Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LIKE CLAUSE on VIEWS  (Samed YILDIRIM <samed@reddoc.net>)
Список pgsql-performance

On Sun, 22 Jan 2023 at 13:34, aditya desai <admad123@gmail.com> wrote:
Hi,
Is there any way to improve performance of LIKE clause on VIEWS.

select * From request_vw where upper(status) like '%CAPTURED%' - 28 seconds.

select * from  request_vw where status='CAPTURED'

Application team is reluctant to change queries from the Application side to = instead of LIKE.

Also as this is VIEW TRIGRAM nor normal indexes don't get used.


Regards,
Aditya.

You could try using the `text_pattern_ops` operator class on your index on the `status` column:  https://www.postgresql.org/docs/current/indexes-opclass.html
 

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

Предыдущее
От: Samed YILDIRIM
Дата:
Сообщение: Re: LIKE CLAUSE on VIEWS
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: LIKE CLAUSE on VIEWS