Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
pqxx::CachedResult Class Reference
#include <cachedresult.h>
List of all members.
Detailed Description
Cached result set. Chunks of result data are transparently fetched on-demand and stored in an internal cache for reuse. Functionality is similar to that of Result, with certain restrictions and different performance characteristics. A CachedResult must live in the context of a transaction, so that it can fetch further rows as they are needed.
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.
CAUTION: PostgreSQL currently doesn't always let you move cursors backwards, which is a feature this class relies upon. As a result, CachedResult will only work on certain types of queries. To make things worse, there is no documentation to define exactly which queries those are. Therefore the only way to use CachedResult at this time is to test carefully. Hopefully this can be fixed in the future.
Member Typedef Documentation
typedef size_type pqxx::CachedResult::blocknum
|
|
typedef Result::size_type pqxx::CachedResult::size_type
|
|
typedef Result::Tuple pqxx::CachedResult::Tuple
|
|
Constructor & Destructor Documentation
pqxx::CachedResult::CachedResult |
( |
pqxx::TransactionItf & |
, |
|
|
const char |
Query[], |
|
|
const PGSTD::string & |
BaseName = "query", |
|
|
size_type |
Granularity = 100 |
|
) |
[explicit] |
|
|
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. |
Member Function Documentation
void pqxx::CachedResult::clear |
( |
|
) |
|
|
|
Drop all data in internal cache, freeing up memory.
|
bool pqxx::CachedResult::empty |
( |
|
) |
const |
|
|
Is the result set empty, i.e. does it contain no rows? May fetch 1 block.
|
|
Number of rows in result set. First call may be slow.
|
The documentation for this class was generated from the following files:
Generated on Sat Feb 15 18:04:50 2003 for libpqxx by
1.3-rc2