Class TableWithMissingIndex

java.lang.Object
io.github.mfvanek.pg.model.table.TableWithMissingIndex
All Implemented Interfaces:
DbObject, TableNameAware, TableSizeAware, Comparable<TableWithMissingIndex>

@Immutable public class TableWithMissingIndex extends Object implements Comparable<TableWithMissingIndex>
Representation of a table in a database with additional information on reads amount via index or sequential scans.
  • Field Details

    • table

      protected final Table table
  • Method Details

    • getSeqScans

      public long getSeqScans()
    • getIndexScans

      public long getIndexScans()
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(@Nonnull TableWithMissingIndex other)
      Specified by:
      compareTo in interface Comparable<TableWithMissingIndex>
    • of

      public static TableWithMissingIndex of(@Nonnull String tableName, long tableSizeInBytes, long seqScans, long indexScans)
      Constructs a TableWithMissingIndex object.
      Parameters:
      tableName - table name; should be non-blank.
      tableSizeInBytes - table size in bytes; should be positive or zero.
      seqScans - number of sequential scans initiated on this table; should be non-negative.
      indexScans - number of index scans initiated on this table; should be non-negative.
      Returns:
      TableWithMissingIndex
    • of

      public static TableWithMissingIndex of(@Nonnull Table table, long seqScans, long indexScans)
      Constructs a TableWithMissingIndex object.
      Parameters:
      table - table; should be non-null.
      seqScans - number of sequential scans initiated on this table; should be non-negative.
      indexScans - number of index scans initiated on this table; should be non-negative.
      Returns:
      TableWithMissingIndex
      Since:
      0.7.0
    • getName

      @Nonnull public final String getName()
      Gets database object name.
      Specified by:
      getName in interface DbObject
      Returns:
      database object name
    • getTableName

      @Nonnull public final String getTableName()
      Gets table name.
      Specified by:
      getTableName in interface TableNameAware
      Returns:
      table name
    • getTableSizeInBytes

      public final long getTableSizeInBytes()
      Gets table size in bytes.
      Specified by:
      getTableSizeInBytes in interface TableSizeAware
      Returns:
      table size in bytes