Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

From: Joerg Sonnenberger <joerg(at)bec(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Joerg Sonnenberger <joerg(at)bec(dot)de>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)
Date: 2019-01-08 23:00:04
Message-ID: 20190108230004.GA22421@britannica.bec.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 08, 2019 at 05:53:25PM -0500, Tom Lane wrote:
> John Naylor <john(dot)naylor(at)2ndquadrant(dot)com> writes:
> > -As for the graph algorithm, I'd have to play with it to understand
> > how it works.
>
> I improved the comment about how come the hash table entry assignment
> works. One thing I'm not clear about myself is
>
> # A cycle-free graph is either empty or has some vertex of degree 1.
>
> That sounds like a standard graph theory result, but I'm not familiar
> with a proof for it.

Let's assume all vertexes have a degree > 1, the graph is acyclic and
non-empty. Pick any vertex. Let's construct a path now starting from
this vertex. It is connected to at least one other vertex. Let's follow
that path. Again, there must be connected to one more vertex and it can't
go back to the starting point (since that would be a cycle). The next
vertex must still have another connections and it can't go back to any
already visited vertexes. Continue until you run out of vertex...

Joerg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-01-09 00:07:40 Re: proposal: variadic argument support for least, greatest function
Previous Message Tom Lane 2019-01-08 22:53:25 Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)