Re: [pgAdmin][RM4570] Tree improvement to improve speed of finding a node

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin][RM4570] Tree improvement to improve speed of finding a node
Date: 2019-08-06 13:03:11
Message-ID: CA+OCxoyBOujjSmz-ARcYUi0jWOcDF_80NFrri7yXnOcvAJGGtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, patch applied.

On Tue, Aug 6, 2019 at 1:10 PM Aditya Toshniwal <
aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:

> Hi Hackers,
>
> Attached is a tiny but very effective patch to improve the speed of
> finding a node using path (used internally).
> If you right click or just click on a node, internally the node is
> traversed using its path. But currently, it compares with the path of all
> the open nodes to find a match.
> So if you 1000+ tables and the tables node is open and if you click on a
> view, the view path is compared with all the 1000+ tables (and with any
> other open nodes above) before arriving to path. You're at bad luck if you
> have more open servers above.
>
> Code is changed to check if the path of node to be found starts with the
> current node path. If it doesn't match, why bother the children's of
> current node.
> This change will not show much effect for small data, but it does matter
> for large servers.
>
> One more change is to remove unnecessary calls to find node and use the
> data available with Main Menu -> Object to enable/disable node context menu
> items.
>
> Kindly review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2019-08-06 13:26:15 pgAdmin 4 commit: Add Reverse Engineered SQL tests for Trigger Function
Previous Message Dave Page 2019-08-06 13:03:00 pgAdmin 4 commit: Add an optimisation to the internal code responsible