Limiting cursor size

Frank Schima frank-list2 at mindstarprods.com
Thu Jun 12 13:45:33 CDT 2003


Hi Erik!


On Thursday, June 12, 2003, at 09:04  AM, Erik Mueller-Harder wrote:

> It's probably staring me in the face, but I cannot find the answer to this in the 
documentation.
> 
> Is there a way to limit the size of a cursor?  Often, I find I'm interested in only the first 
row or two in a > cursor that might have a few hundred rows in it -- and I'd like to 
tweak things so I don't incur the extra > > > overhead of 100s of rows.
> 
> I guess I'm thinking something like:
> 
>     SELECT FIRST foo, bar from myBO WHERE foo = 'some value'
> 
> Can this be done?  Or in fact are cursors so well fine-tuned that there'd be no 
performance benefit anyway?

There is no way to do that yet (hopefully with version 2 of the kernel we will get that). 
But cursors are very memory efficient - they are simply an ordered list of record 
pointers (essentially ULLONG fields). I believe that Ruslan has stated that even returning 
millions of records uses a only few MBs of RAM. Of course reading the data requires 
more memory.

So the bottom line is get your complete cursor and only read the first row(s) you need.


Best regards,
Frank

---
Frank Schima                <mailto:frank-list2 at-sign mindstarprods.com>
Independent Consultant
Gaithersburg, MD USA        <http://www.ci.gaithersburg.md.us/>



More information about the Valentina mailing list