mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Revise tuplestore and nodeMaterial so that we don't have to read the
entire contents of the subplan into the tuplestore before we can return any tuples. Instead, the tuplestore holds what we've already read, and we fetch additional rows from the subplan as needed. Random access to the previously-read rows works with the tuplestore, and doesn't affect the state of the partially-read subplan. This is a step towards fixing the problems with cursors over complex queries --- we don't want to stick in Materialize nodes if they'll prevent quick startup for a cursor.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: execnodes.h,v 1.95 2003/02/16 02:30:39 tgl Exp $
|
||||
* $Id: execnodes.h,v 1.96 2003/03/09 02:19:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -917,14 +917,13 @@ typedef struct HashJoinState
|
||||
* of a subplan into a temporary file.
|
||||
*
|
||||
* ss.ss_ScanTupleSlot refers to output of underlying plan.
|
||||
*
|
||||
* tuplestorestate private state of tuplestore.c
|
||||
* ----------------
|
||||
*/
|
||||
typedef struct MaterialState
|
||||
{
|
||||
ScanState ss; /* its first field is NodeTag */
|
||||
void *tuplestorestate;
|
||||
void *tuplestorestate; /* private state of tuplestore.c */
|
||||
bool eof_underlying; /* reached end of underlying plan? */
|
||||
} MaterialState;
|
||||
|
||||
/* ----------------
|
||||
|
Reference in New Issue
Block a user