Suggestion to improve query performance for GIS query. - Mailing list pgsql-performance

From postgann2020 s
Subject Suggestion to improve query performance for GIS query.
Date
Msg-id CANynezMGfmZbJ4EDFJoDRDzwJAGd0jCUtpTLFeP==ZgUOaFhyA@mail.gmail.com
Whole thread Raw
Responses Re: Suggestion to improve query performance for GIS query.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Suggestion to improve query performance for GIS query.  (Mohammed Afsar <vmdapsar@gmail.com>)
Re: Suggestion to improve query performance for GIS query.  (Mohammed Afsar <vmdapsar@gmail.com>)
List pgsql-performance
Hi Team,

Thanks for your support.

Could you please suggest on below query.

EnvironmentPostgreSQL: 9.5.15
Postgis: 2.2.7

The table contains GIS data which is fiber data(underground routes).

We are using the below query inside the proc which is taking a long time to complete.

*************************************************************

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 ;

****************************************************************

We have created an index on parental_path Column1 still it is taking 4secs to get the results.

Could you please suggest a better way to execute the query.

Thanks for your support.

Regards,
PostgAnn.

pgsql-performance by date:

Previous
From: Stephen Frost
Date:
Subject: Re: OOM Killer kills PostgreSQL
Next
From: "David G. Johnston"
Date:
Subject: Re: Suggestion to improve query performance for GIS query.