Re: Question about maxTapes & selectnewtape & dumptuples - Mailing list pgsql-hackers

From Andy Fan
Subject Re: Question about maxTapes & selectnewtape & dumptuples
Date
Msg-id 87msn2wuh6.fsf@163.com
Whole thread Raw
In response to Re: Question about maxTapes & selectnewtape & dumptuples  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes:

> On 30/06/2024 12:48, Andy Fan wrote:

>> for example, at the first use of outputTapes[x], it stores (1, 3, 5,
>> 7),
>> and later (2, 4, 6, 8) are put into it.  so the overall of (1, 3, 5, 7,
>> 2, 4, 6, 8) are not sorted? Where did I go wrong?
>
> There's a distinction between "runs" and "tapes". Each "run" is sorted,
> but there can be multiple runs on a tape. In that case, multiple merge
> passes are needed. Note the call to markrunend() between the runs. In
> your example, the tape would look like (1, 3, 5, 7, <end marker>, 2, 4,
> 6, 8).

I see, Thank you for your answer!

-- 
Best Regards
Andy Fan




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Optimize numeric.c mul_var() using the Karatsuba algorithm
Next
From: "Joel Jacobson"
Date:
Subject: Re: Optimize numeric.c mul_var() using the Karatsuba algorithm