Enum Class GraphOptimizedFor

java.lang.Object
java.lang.Enum<GraphOptimizedFor>
oracle.pgx.config.GraphOptimizedFor
All Implemented Interfaces:
Serializable, Comparable<GraphOptimizedFor>, Constable

public enum GraphOptimizedFor extends Enum<GraphOptimizedFor>
Enumeration to specify the optimization strategy for graph operations in PGX.

The optimization strategy determines whether the graph is optimized for read-intensive scenarios or for fast updates. This impacts the performance characteristics of graph operations such as querying and updating.

Choose the appropriate strategy based on your primary use case:

  • READ for read-heavy workloads
  • UPDATES for update-heavy workloads

Since:
20.1
  • Enum Constant Details

    • READ

      public static final GraphOptimizedFor READ
      Optimize the graph for read-intensive scenarios.

      When this strategy is selected, the graph's data structures are replicated whenever a new graph or graph snapshot is created. This results in faster and more efficient read operations, such as traversals and queries, but can lead to performance overhead and increased memory usage during updates, and creating snapshots can be expensive.

      Use this option when the primary operations on the graph are read-based, and updates are infrequent or non-existent.

    • UPDATES

      public static final GraphOptimizedFor UPDATES
      Optimize the graph for fast update operations.

      When this strategy is selected, delta logs are used to manage updates. This approach makes updates more memory-efficient and faster. However, there may be some time overhead when querying the graph due to the need to apply these deltas.

      Use this option when the graph is expected to undergo frequent updates, such as adding or removing nodes and edges, or modifying properties of existing elements.

  • Method Details

    • values

      public static GraphOptimizedFor[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GraphOptimizedFor valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null