Optimizing Postgresql ILIKE while query - Mailing list pgadmin-hackers

From aman gupta
Subject Optimizing Postgresql ILIKE while query
Date
Msg-id CAC=C=veOiz2vo35uEhGhhq2YMmXcGj_ciA1S5hXDS3kCOq-zkA@mail.gmail.com
Whole thread Raw
Responses Re: Optimizing Postgresql ILIKE while query  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Optimizing Postgresql ILIKE while query  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Optimizing Postgresql ILIKE while query  (Alban Hertroys <haramrae@gmail.com>)
Re: Optimizing Postgresql ILIKE while query  (Alban Hertroys <haramrae@gmail.com>)
List pgadmin-hackers
Hi Team,

Greetings for the day!!

Platform:

PostgreSQL 9.6.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit


Issue:


We have the base table which contains 22M records and we created a view on top of it while querying the view with ILIKE clause it took 44 seconds and with LIKE Clause 20 Seconds

Query:

fm_db_custom_db=# EXPLAIN (ANALYZE, TIMING OFF)
select destination,hostname,inputfilename,inputtime,logicalservername,outputfilename,outputtime,processinglink,source,totalinputbytes,totalinputcdrs,totaloutputbytes,totaloutputcdrs from mmsuper.test_20m_view  where inputfilename ilike '%SDPOUTPUTCDR_4001_BLSDP09_ADM_4997_18-10-15-02549.ASN%';

Also attaching the comparison for both ILIKE and LIKE test performed.

Expectation:

How can we optimize our ILIKE query, since it is hardcoded in the application and we can't use any other keyword than ILIKE .

BR//
Aman Gupta
+918447611183

Attachment

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: [pgAdmin4][Patch]: RM #3232 Backup with incorrect path stays inbroken state
Next
From: Pavel Stehule
Date:
Subject: Re: Optimizing Postgresql ILIKE while query