Speed of fetching records
Posted: 13.10.2006, 10:56
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?
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?