Re: LIKE CLAUSE on VIEWS

2023-01-22 Thread Jeff Janes
On Sun, Jan 22, 2023 at 6:34 AM aditya desai 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. > You would need to have an expression index over upper(status) to support such a query,

Re: LIKE CLAUSE on VIEWS

2023-01-22 Thread Rick Otten
> > > On Sun, 22 Jan 2023 at 13:34, aditya desai 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

Re: LIKE CLAUSE on VIEWS

2023-01-22 Thread Samed YILDIRIM
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 do

LIKE CLAUSE on VIEWS

2023-01-22 Thread aditya desai
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. Als

Re: ALTER STATEMENT getting blocked

2023-01-22 Thread aditya desai
Thanks All. Let me check this and get back to you. On Fri, Jan 20, 2023 at 2:36 AM MichaelDBA wrote: > Do something like this to get it without being behind other > transactions...You either get in and get your work done or try again > > DO language plpgsql $$ > BEGIN > FOR get_lock IN 1 .. 100