Re: Suggestion to improve query performance for GIS query.

From: postgann2020 s <postgann2020(at)gmail(dot)com>
To: Mohammed Afsar <vmdapsar(at)gmail(dot)com>
Cc: postgis-users(at)lists(dot)osgeo(dot)org, PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Suggestion to improve query performance for GIS query.
Date: 2020-05-22 07:34:21
Message-ID: CANynezPVwipwro1y-MAWg8UnLr1iu4XufjXynq-Uhatg1B5CiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

Thanks for your support David and Afsar.

Hi David,

Could you please suggest the resource link to "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." if anything
available. So that it will help me to get into issues.

Thanks for your support.

Regards,
Postgann.

On Fri, May 22, 2020 at 12:46 PM Mohammed Afsar <vmdapsar(at)gmail(dot)com> wrote:

> Dear team,
>
> Kindly try to execute the vacuum analyzer on that particular table and
> refresh the session and execute the query.
>
> VACUUM (VERBOSE, ANALYZE) tablename;
>
> Regards,
> Mohammed Afsar
> Database engineer
>
> On Fri, May 22, 2020, 12:30 PM postgann2020 s <postgann2020(at)gmail(dot)com>
> wrote:
>
>> 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.
>>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message postgann2020 s 2020-05-22 07:44:27 Re: Suggestion to improve query performance of data validation in proc.
Previous Message Mohammed Afsar 2020-05-22 07:16:36 Re: Suggestion to improve query performance for GIS query.

Browse pgsql-performance by date

  From Date Subject
Next Message postgann2020 s 2020-05-22 07:44:27 Re: Suggestion to improve query performance of data validation in proc.
Previous Message Mohammed Afsar 2020-05-22 07:16:36 Re: Suggestion to improve query performance for GIS query.