#include <cachedresult.h>
Public Types | |
typedef Result::size_type | size_type |
typedef size_type | blocknum |
typedef Result::Tuple | Tuple |
Public Methods | |
CachedResult (pqxx::TransactionItf &, const char Query[], PGSTD::string BaseName="query", size_type Granularity=100) | |
const Tuple | operator[] (size_type i) const |
const Tuple | at (size_type i) const |
size_type | size () const |
Number of rows in result set. | |
bool | empty () const |
Is the result set empty, i.e. does it contain no rows? May fetch 1 block. | |
void | clear () |
Drop all data in internal cache, freeing up memory. |
The class uses a Cursor internally to fetch results. Data are not fetched row-by-row, but in chunks of configurable size. For internal computational reasons, these chunks (called "blocks" here) must be at least 2 rows large.
|
|
|
|
|
|
|
Perform query and transparently fetch and cache resulting data. Granularity determines how large the blocks of data used internally will be; must be at least 2. |
|
|
|
Drop all data in internal cache, freeing up memory.
|
|
Is the result set empty, i.e. does it contain no rows? May fetch 1 block.
|
|
|
|
Number of rows in result set. Figuring out the size of the result set for the first time may take a lot of time and network traffic, as the CachedResult's internal cursor scans back and forth in search of the set's last row. Some 30 blocks of data may be fetched in the process. |