diff options
author | Tom Lane | 2008-10-29 00:00:39 +0000 |
---|---|---|
committer | Tom Lane | 2008-10-29 00:00:39 +0000 |
commit | 05bba3d176e0adc1a032d5c8c6ea2a7622c7dd0d (patch) | |
tree | 59140f72d76bd4fb7fc7e8bbad6ccf57084f042a /src/backend/commands | |
parent | e3e3d2a789e34ff6572bdf693beb1516a228c5ff (diff) |
Be more tense about not creating tuplestores with randomAccess = true unless
backwards scan could actually happen. In particular, pass a flag to
materialize-mode SRFs that tells them whether they need to require random
access. In passing, also suppress unneeded backward-scan overhead for a
Portal's holdStore tuplestore. Per my proposal about reducing I/O costs for
tuplestores.
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/prepare.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c index dee994c5509..1d3bb13ff3e 100644 --- a/src/backend/commands/prepare.c +++ b/src/backend/commands/prepare.c @@ -10,7 +10,7 @@ * Copyright (c) 2002-2008, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.91 2008/08/28 23:09:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.92 2008/10/29 00:00:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -766,7 +766,9 @@ pg_prepared_statement(PG_FUNCTION_ARGS) * We put all the tuples into a tuplestore in one scan of the hashtable. * This avoids any issue of the hashtable possibly changing between calls. */ - tupstore = tuplestore_begin_heap(true, false, work_mem); + tupstore = + tuplestore_begin_heap(rsinfo->allowedModes & SFRM_Materialize_Random, + false, work_mem); /* hash table might be uninitialized */ if (prepared_queries) |