Обсуждение: Avoid scanning on tape

Поиск
Список
Период
Сортировка

Avoid scanning on tape

От
Manolo _
Дата:
Hi.

I would like to store the "address on tape" of the first and the last tuple for the run I'm currently creating on a
specifictape. 
I need it in order to access directly to those two tuples right after terminating the creation of that specific run.

Of course I could store that address of first tuple as soon as I start the creation of the corresponding new run. On
theother hand I could store the address of that last tuple when I terminate the creation of that run. 

The problem is that Postgres writes tuples in various buffers before really writing blocks of tuples on disk.

Is there an efficient way to access to those tuples avoiding scanning a specific run from the last tuple till the first
one?

Thanks for your attention.

Regards, Manolo.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Re: Avoid scanning on tape

От
Tom Lane
Дата:
Manolo _ <mac_man2005@hotmail.it> writes:
> I would like to store the "address on tape" of the first and the last tuple for the run I'm currently creating on a
specifictape.
 
> I need it in order to access directly to those two tuples right after terminating the creation of that specific run.

Why don't you just hold those two tuples in memory (ie, track the first
and latest-so-far tuples of each run)?
        regards, tom lane


Re: Avoid scanning on tape

От
Manolo _
Дата:
Thanks for your reply.

I need to read all the run in order to move it to another tape. I suppose the only way to make it is reading the run
tupleby tuple and writing them into the destination tape. 

Regards, Manolo.

----------------------------------------
> To: mac_man2005@hotmail.it
> CC: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Avoid scanning on tape
> Date: Mon, 11 Feb 2008 14:27:57 -0500
> From: tgl@sss.pgh.pa.us
>
> Manolo _  writes:
>> I would like to store the "address on tape" of the first and the last tuple for the run I'm currently creating on a
specifictape. 
>> I need it in order to access directly to those two tuples right after terminating the creation of that specific run.
>
> Why don't you just hold those two tuples in memory (ie, track the first
> and latest-so-far tuples of each run)?
>
>             regards, tom lane

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/