Posicion de los Runs en los Tapes

From: <mac_man2005(at)hotmail(dot)it>
To: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Posicion de los Runs en los Tapes
Date: 2008-02-02 18:19:26
Message-ID: BAY132-DS22A2C6EB4CA4802ADDE6FE6310@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola a todos.

Estoy intentando memorizar la posición en el Tape correspondiente de la
primera y ultima tupla que voy escribiendo por un cierto run, durante la
fase de creación de los runs
[ src/backend/utils/sort/tuplesort.c ].

Les agradecería me confirmaran que la manera mas simple y correcta para
lograrlo es fijarme en la estructura siguiente y concretamente en las
variables

int curFile; /* file index
(0..n) part of current pos */
int curOffset; /* offset part of
current pos */
int pos; /* next read/write
position in buffer */

[ src/backend/storage/file/buffile.c ]
struct BufFile
{
int numFiles; /* number of
physical files in set */
/* all files except the last have length exactly
MAX_PHYSICAL_FILESIZE */
File *files; /* palloc'd array with
numFiles entries */
long *offsets; /* palloc'd array with numFiles
entries */

/*
* offsets[i] is the current seek position of files[i]. We use
this to
* avoid making redundant FileSeek calls.
*/

bool isTemp; /* can only add files if
this is TRUE */
bool isInterXact; /* keep open over transactions? */
bool dirty; /* does buffer need to be
written? */

/*
* "current pos" is position of start of buffer within the logical
file.
* Position as seen by user of BufFile is (curFile, curOffset +
pos).
*/
int curFile; /* file index
(0..n) part of current pos */
int curOffset; /* offset part of
current pos */
int pos; /* next read/write
position in buffer */
int nbytes; /* total # of valid
bytes in buffer */
char buffer[BLCKSZ];
};

Eso me serviria para posiblemente memorizar dicha informacion en la variable
"state" [de tipo TupleSortState] o bien en esa misma estructura BufFile para
luego poder mover las tuplas de un cierto run desde un tape a otro.

Gracias por su tiempo.
Saludos, Manolo.

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Gabriel Ferro 2008-02-02 19:11:02 Re: registro de actividad de usuarios
Previous Message + RME 2008-02-02 17:09:33 Re: registro de actividad de usuarios