Re: LIKE CLAUSE on VIEWS - Mailing list pgsql-performance

From Samed YILDIRIM
Subject Re: LIKE CLAUSE on VIEWS
Date
Msg-id CAAo1mbnR5x2p8sYSs-EO=+c6JfNYZcKtDNi_+vqnCKWdnZ0YZg@mail.gmail.com
Whole thread Raw
In response to LIKE CLAUSE on VIEWS  (aditya desai <admad123@gmail.com>)
Responses Re: LIKE CLAUSE on VIEWS  (Rick Otten <rottenwindfish@gmail.com>)
List pgsql-performance
Hi Aditya,

If you share your view's query and the query you run against the view, it would help all of us to understand better.

pg_trgm would be the life saver option for you, of course if you created it on the right column, with the right expression, and by using the right indexing method. It doesn't mean you can't use any index and indexes won't be used because it is a view, well, if you do it right.


Best regards.
Samed YILDIRIM


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.

pgsql-performance by date:

Previous
From: aditya desai
Date:
Subject: LIKE CLAUSE on VIEWS
Next
From: Rick Otten
Date:
Subject: Re: LIKE CLAUSE on VIEWS