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

From David G. Johnston
Subject Re: Suggestion to improve query performance for GIS query.
Date
Msg-id CAKFQuwaKE4mieDL+V-Ek2Mu2OrfWC5+wNA9bqGf0=Ok6uEt60Q@mail.gmail.com
Whole thread Raw
In response to Suggestion to improve query performance for GIS query.  (postgann2020 s <postgann2020@gmail.com>)
List pgsql-performance
On Thursday, May 21, 2020, postgann2020 s <postgann2020@gmail.com> wrote:

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 ;


Could you please suggest a better way to execute the query

Add a trigger to the table to normalize the contents of column1 upon insert and then rewrite your query to reference the newly created normalized fields.

David J.

pgsql-performance by date:

Previous
From: postgann2020 s
Date:
Subject: Suggestion to improve query performance for GIS query.
Next
From: Mohammed Afsar
Date:
Subject: Re: Suggestion to improve query performance for GIS query.