Why create tuplestore for each fetch?

From: 高增琦 <pgf00a(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Why create tuplestore for each fetch?
Date: 2011-12-12 13:23:35
Message-ID: CAFmBtr2EshjezZ-CxtbVJ--=y6-9Ea+CJJqCb-4qRg=3EfpOsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am reading code about cursor and fetch ...
Here is a test:

create table t (a int);
insert into t values (1),(3),(5),(7),(9);
insert into t select a+1 from t;
begin;
declare c cursor for select * from t order by a;
fetch 3 in c;
fetch 3 in c;
fetch 3 in c;

In func "PortalRun", FillPortalStore(portal, isTopLevel) will create a
tuplestore for each query...
Why create tuplestore for each fetch?

--
GaoZengqi
pgf00a(at)gmail(dot)com
zengqigao(at)gmail(dot)com

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-12-12 13:45:25 Re: [REVIEW] pg_last_xact_insert_timestamp
Previous Message Yeb Havinga 2011-12-12 12:32:41 Re: [REVIEW] Patch for cursor calling with named parameters