Why create tuplestore for each fetch?

Started by 高增琦about 14 years ago1 messages
#1高增琦
pgf00a@gmail.com

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@gmail.com
zengqigao@gmail.com