pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Cc: Filip RembiaƂkowski <filip.rembialkowski@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Oleg Bartunov <obartunov@postgrespro.ru>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: fix for BUG #3720: wrong results at using ltree
Date: Tue, 31 Mar 2020 01:22:19 +0300
Message-ID: <9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru> (raw)
In-Reply-To: <3843.1585606362@sss.pgh.pa.us>
References: <CAP_rww=waX2Oo6q+MbMSiZ9ktdj6eaJj0cQzNu=Ry2cCDij5fw@mail.gmail.com>
	<28639.1554565562@sss.pgh.pa.us>
	<CA+hUKGKVbTGHGpHBX6EGew13CrfYcagThJqBAmeATCMKnVqisQ@mail.gmail.com>
	<CAF4Au4yV8vsgA_7XCce4kFUa2BjseqWj=KVuOwcE+DGLj6AW7g@mail.gmail.com>
	<5eedfd9e-2f14-a2df-3bd9-4c92eb0f08a5@postgrespro.ru>
	<CAPpHfdsvEaqXDsLWebQ4Q4GszRZ_P6h-1_cidmiqPMtWzXnmhA@mail.gmail.com>
	<20200124182915.zz7hzdkijzsb4ic4@development>
	<a315c67d-5b3b-8005-99ef-daa9ea7036a0@postgrespro.ru>
	<19375.1585438012@sss.pgh.pa.us>
	<15582.1585529626@sss.pgh.pa.us>
	<23304.1585591242@sss.pgh.pa.us>
	<943dc224-eb82-8abd-15c3-f4b516f89767@postgrespro.ru>
	<3007.1585605566@sss.pgh.pa.us>
	<3843.1585606362@sss.pgh.pa.us>

On 31.03.2020 1:12, Tom Lane wrote:

> I wrote:
>> I dunno, that doesn't really seem clearer to me (although some of it
>> might be that you expended no effort on making the comments match
>> the new code logic).
> ... although looking closer, this formulation does have one very nice
> advantage: for the typical non-star case with high = low = 1, the
> only recursive call is a tail recursion, so it ought to consume less
> stack space than what I wrote.

And we even can simply transform this tail call into a loop:

-if (tlen > 0 && qlen > 0)
+while (tlen > 0 && qlen > 0)

> Let me see what I can do with the comments.

Thanks.

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

view thread (25+ messages)  latest in thread

Message-ID: <9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru>
Permalink:  ../9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru/
Also on:    postgresql.org/message-id/9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: n.gluhov@postgrespro.ru, tgl@sss.pgh.pa.us, filip.rembialkowski@gmail.com, tomas.vondra@2ndquadrant.com, a.korotkov@postgrespro.ru, obartunov@postgrespro.ru, thomas.munro@gmail.com, teodor@sigaev.ru
  Subject: Re: fix for BUG #3720: wrong results at using ltree
  In-Reply-To: <9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox