Record Class QueryStats

java.lang.Object
java.lang.Record
com.loomcache.server.query.QueryStats

public record QueryStats(long parseTimeNs, long executeTimeNs, long rowsScanned, long rowsReturned) extends Record
Statistics about query execution performance. Records timing and cardinality information for analysis and optimization.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryStats(long parseTimeNs, long executeTimeNs, long rowsScanned, long rowsReturned)
    Creates an instance of a QueryStats record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Execute time in milliseconds.
    long
    Returns the value of the executeTimeNs record component.
    final int
    Returns a hash code value for this object.
    long
    Parse time in milliseconds.
    long
    Returns the value of the parseTimeNs record component.
    long
    Returns the value of the rowsReturned record component.
    long
    Returns the value of the rowsScanned record component.
    double
    Selectivity ratio: rowsReturned / rowsScanned.
    final String
    Returns a string representation of this record class.
    long
    Total execution time in milliseconds.
    long
    Total execution time (parse + execute) in nanoseconds.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • QueryStats

      public QueryStats(long parseTimeNs, long executeTimeNs, long rowsScanned, long rowsReturned)
      Creates an instance of a QueryStats record class.
      Parameters:
      parseTimeNs - the value for the parseTimeNs record component
      executeTimeNs - the value for the executeTimeNs record component
      rowsScanned - the value for the rowsScanned record component
      rowsReturned - the value for the rowsReturned record component
  • Method Details

    • totalTimeNs

      public long totalTimeNs()
      Total execution time (parse + execute) in nanoseconds.
    • totalTimeMs

      public long totalTimeMs()
      Total execution time in milliseconds.
    • parseTimeMs

      public long parseTimeMs()
      Parse time in milliseconds.
    • executeTimeMs

      public long executeTimeMs()
      Execute time in milliseconds.
    • selectivity

      public double selectivity()
      Selectivity ratio: rowsReturned / rowsScanned.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • parseTimeNs

      public long parseTimeNs()
      Returns the value of the parseTimeNs record component.
      Returns:
      the value of the parseTimeNs record component
    • executeTimeNs

      public long executeTimeNs()
      Returns the value of the executeTimeNs record component.
      Returns:
      the value of the executeTimeNs record component
    • rowsScanned

      public long rowsScanned()
      Returns the value of the rowsScanned record component.
      Returns:
      the value of the rowsScanned record component
    • rowsReturned

      public long rowsReturned()
      Returns the value of the rowsReturned record component.
      Returns:
      the value of the rowsReturned record component