Page 1 of 1

Speed of fetching records

Posted: 13.10.2006, 10:56
by jascha
I use my application with a Database on the Internet, thats why I have to reduce the amount of data transfered between application and database.

By now I found out that if I set Filtered:=true only the needed records are fetched, which is quite good and exactly what I want. But there are some problems with this.

1. RecordCount fetches all records and takes long
2. If I do TZQuery.Last it seems to also fetch all the Records till the end
or if I do RecNo:=10000 the same

Now I have looked at the PostgreSQL API and it seems to me that this is not necessary. There are API calls to return the number of fetched rows and to get a specific row by rownumber out of the resultset.

We could keep track of which records are already fetched and in the clients memory. So it would be possible to fill it part by part.

I haven´t looked at other APIs, but even if they have not the possibility. It still would be possible to move the code somewhere in databasedriver and let him choice which method is best to perform the task.

Do you think that is possible or am I missing something?

Posted: 13.10.2006, 20:47
by fduenas
Well if you you wan only to browse a record, its ok. But if you have a dbgrid, the it coould be difficult to achiev if you dont´browse other recods. Yes maybe there could be another way, but for now this the way that all drivers can work. Maybe it can be done but whould require a little bit of work to apply the correct behaviour to each protocol.