- All Implemented Interfaces:
Serializable
,Comparable<CursorMode>
TableHandler
.- Author:
- AO Industries, Inc.
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The number of rows above which when cursors are enabled in auto mode. -
Method Summary
Modifier and TypeMethodDescriptionstatic CursorMode
Returns the enum constant of this type with the specified name.static CursorMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SELECT
The query will be performed as-is, no CURSOR and FETCH. This has the potential to use more memory during larger queries, but minimizes the number of round-trips to the database. -
FETCH
The query will be performed via DECLARE CURSOR, FETCH, CLOSE. This reduces the memory consumption of larger queries, at the cost of more round-trips to the database. -
AUTO
Automatic mode currently simply usesFETCH
when!provideProgress
, otherwise usesSELECT
. This matches the old behavior, but much more crafty ideas follow.TODO: In automatic mode, the first query for a given table and user is performed with
FETCH
, while subsequent queries will only useFETCH
if the previous query returned more thanAUTO_CURSOR_ABOVE
rows.TODO: The per-(table, user) cache is cleaned in the background when unused for
TableHandler.MAX_ROW_COUNT_CACHE_AGE
milliseconds.TODO: Invalidating schema_tables clears these caches?
TODO: Should we query PostgreSQL statistics instead, or in addition (pg_class.reltuples)? At least as an upper bound for the first query, where if total rows is low enough, skip cursor on the first query. Hint: cache rultuples to bigint.
- See Also:
-
-
Field Details
-
AUTO_CURSOR_ABOVE
public static final int AUTO_CURSOR_ABOVEThe number of rows above which when cursors are enabled in auto mode. By default, tripleDatabaseConnection.FETCH_SIZE
, which avoids round-trips to the server for tables that would result in only a few batches.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-