Board index » delphi » How many rows are fetched

How many rows are fetched

A short question.

How many rows are fetched using sql and dbgrid?

E.g.: I have a query which will fetch e.g. 1000 records. My dbgrid shows
e.g. 20 lines.
Therefore: will Delphi load the 1000 records (and cache it local) or will
delphi retrieve only the first 20 records?

Thanks for any hint.

--
Regards
Nicolas Bronke

 

Re:How many rows are fetched


Hi Nicolas,

I think that Delphi fetchs just a part of records not all.
I have been using Delphi for two months only, so i am not an expert.
Cheers.

                           Stefano

Quote
Nicolas Bronke wrote:
> A short question.

> How many rows are fetched using sql and dbgrid?

> E.g.: I have a query which will fetch e.g. 1000 records. My dbgrid shows
> e.g. 20 lines.
> Therefore: will Delphi load the 1000 records (and cache it local) or will
> delphi retrieve only the first 20 records?

> Thanks for any hint.

> --
> Regards
> Nicolas Bronke

Re:How many rows are fetched


Quote
Nicolas Bronke wrote in message <828rtg$3...@forums.borland.com>...

>How many rows are fetched using sql and dbgrid?

>E.g.: I have a query which will fetch e.g. 1000 records. My dbgrid shows
>e.g. 20 lines.
>Therefore: will Delphi load the 1000 records (and cache it local) or will
>delphi retrieve only the first 20 records?

Unless you are doing something else in code that forces all records to be
fetched, only enough records to fill the grid will be fetched at any one
time. As you scroll, fetched records are cached so they do not need to be
fetched from the server again.

--
Wayne Niddery - WinWright Consulting
RADBooks - http://members.home.net/wniddery/
Toronto Delphi Users Group - http://www.tdug.com/

Re:How many rows are fetched


Quote
> >How many rows are fetched using sql and dbgrid?

> >E.g.: I have a query which will fetch e.g. 1000 records. My dbgrid shows
> >e.g. 20 lines.
> >Therefore: will Delphi load the 1000 records (and cache it local) or will
> >delphi retrieve only the first 20 records?

> Unless you are doing something else in code that forces all records to be
> fetched, only enough records to fill the grid will be fetched at any one
> time. As you scroll, fetched records are cached so they do not need to be
> fetched from the server again.

Thanks for this response.

Regards
Nicolas

Other Threads