From: "mac_man2005 on
Il 21/06/2010 04:25, Tom Lane ha scritto:
> No. You could do that if the rate at which you need to write data to
> the file is<= the rate at which you extract it. But for what we
> are doing, namely merging runs from several tapes into one output run,
> it's pretty much guaranteed that you need new space faster than you are
> consuming data from any one input tape. It balances out as long as you
> keep *all* the tapes in one operating-system file; otherwise not.
>
> regards, tom lane
>
>
Tom, hope you could clarify the issue of the rates.

During the initialisation phase (loading blocks into heap) of course we
can mark as garbage more space than we are consuming (since we haven't
still begun merging blocks). The time to do that is after prereading as
much tuples as possible. Of course even during the algorithm we cannot
output more tuples than we preread. So there is no problem in terms of
total number of tuples read and output: at each time, read tuples are >=
output tuples.

Of course, in this case, output blocks should be placed in the free
space spread around the various files and we should keep track of this
placement.

But, recall that even in case of using a LogicalTapeSet we should keep
track of the output blocks, as Robert said in his example.

What's wrong in my picture?

Thank you.
Manolo.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
"mac_man2005(a)hotmail.it" <mac_man2005(a)hotmail.it> writes:
> Of course, in this case, output blocks should be placed in the free
> space spread around the various files and we should keep track of this
> placement.

And once you've done that, what benefit have you got over the current
design? None that I can see. It's only more complicated.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "mac_man2005 on
Tom, you are right: it is just more complicated.

In fact, I did not pretend to demonstrate that it was easier or faster
using one file per tape.
As you can remember, I just did not understand why you said it was
*impossible* to recycle space in that case.

So, the conclusion is: you can do recycle space when using one file per
tape, but it is just more complicated than current design, isn't it?

PD: are we sure it is more complicated?

Thanks.

Manolo.


Il 21/06/2010 21:27, Tom Lane ha scritto:
>
> And once you've done that, what benefit have you got over the current
> design? None that I can see. It's only more complicated.
>
> regards, tom lane
>
>

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers