FetchRows + FetchAll + UniDirectional
Posted: Mon 18 Feb 2008 22:46
Before discovering the UniDirectional property, the amount of memory being used by a TMyQuery was very high. Setting this property solved that problem.
Now, is there a way to cache ONLY n rows at a time instead of one row at a time? For example, I would like to bring in 25 rows and after looping through that set of 25 (via TMyQuery.Next), the TMyQuery grabs another 25 and discards the previous 25. This process continues until TMyQuery.EOF. This should keep the amount of memory used by a TMyQuery object lower than fetching all rows and reduce network trips to the MySQL database, which resides on a different server on the network.
Thanks,
Damon
Now, is there a way to cache ONLY n rows at a time instead of one row at a time? For example, I would like to bring in 25 rows and after looping through that set of 25 (via TMyQuery.Next), the TMyQuery grabs another 25 and discards the previous 25. This process continues until TMyQuery.EOF. This should keep the amount of memory used by a TMyQuery object lower than fetching all rows and reduce network trips to the MySQL database, which resides on a different server on the network.
Thanks,
Damon