[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-performance
Subject:    Re: Suggestion to improve query performance for GIS query.
From:       postgann2020 s <postgann2020 () gmail ! com>
Date:       2020-05-22 7:46:21
Message-ID: CANynezPVwipwro1y-MAWg8UnLr1iu4XufjXynq-Uhatg1B5CiQ () mail ! gmail ! com
[Download RAW message or body]

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@gmail.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@gmail.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.
>>
>

[Attachment #3 (text/html)]

<div dir="ltr">Thanks for your support David and Afsar.<div><br></div><div>Hi \
David,</div><div><br></div><div>Could you please suggest the resource link to   \
&quot;<font color="#ff00ff">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</font>.&quot; if anything available. So that it will help me to get \
into issues.</div><div><br></div><div>Thanks for your \
support.</div><div><br></div><div>Regards,</div><div>Postgann.</div><div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 22, 2020 at 12:46 \
PM Mohammed Afsar &lt;<a href="mailto:vmdapsar@gmail.com">vmdapsar@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Dear \
team,<div dir="auto"><br></div><div dir="auto">Kindly try to execute the vacuum \
analyzer on that particular table and refresh the session and execute the \
query.</div><div dir="auto"><br></div><div dir="auto">VACUUM (VERBOSE, ANALYZE) \
tablename;</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div \
dir="auto">Mohammed Afsar</div><div dir="auto">Database engineer</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 22, 2020, 12:30 PM \
postgann2020 s &lt;<a href="mailto:postgann2020@gmail.com" \
target="_blank">postgann2020@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Team,<br><br>Thanks for your \
support.<br><br>Could you please suggest on below \
query.<br><br>EnvironmentPostgreSQL: 9.5.15<br>Postgis: 2.2.7<br><br>The table \
contains GIS data which is fiber data(underground routes).<br><br>We are using the \
below query inside the proc which is taking a long time to \
complete.<div><br></div><div>*************************************************************<br><br>SELECT \
seq_no+1 INTO pair_seq_no FROM SCHEMA.TABLE WHERE (Column1 like \
&#39;%,sheath--&#39;||cable_seq_id ||&#39;,%&#39; or Column1 like \
&#39;sheath--&#39;||cable_seq_id ||&#39;,%&#39; or Column1 like \
&#39;%,sheath--&#39;||cable_seq_id   or Column1=&#39;sheath--&#39;||cable_seq_id) \
order by seq_no desc limit 1 \
;<br><br>****************************************************************<br><br>We \
have created an index on parental_path Column1 still it is taking 4secs to get the \
results.<br><br>Could you please suggest a better way to execute the \
query.<br><br>Thanks for your support.<br><br>Regards,<br>PostgAnn.<br></div></div> \
</blockquote></div> </blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic