Class IndexesHealthImpl
- java.lang.Object
-
- io.github.mfvanek.pg.index.health.IndexesHealthImpl
-
- All Implemented Interfaces:
IndexesHealth
public class IndexesHealthImpl extends java.lang.Object implements IndexesHealth
Implementation ofIndexesHealth
which collects information from all hosts in the cluster.- See Also:
IndexMaintenance
-
-
Constructor Summary
Constructors Constructor Description IndexesHealthImpl(HighAvailabilityPgConnection haPgConnection, MaintenanceFactory maintenanceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<DuplicatedIndexes>
getDuplicatedIndexes(PgContext pgContext)
java.util.List<ForeignKey>
getForeignKeysNotCoveredWithIndex(PgContext pgContext)
java.util.List<IndexWithBloat>
getIndexesWithBloat(PgContext pgContext)
Returns bloated indexes in the specified schema on master host.java.util.List<IndexWithNulls>
getIndexesWithNullValues(PgContext pgContext)
Returns indexes in the specified schema on master host that contain null values.java.util.List<DuplicatedIndexes>
getIntersectedIndexes(PgContext pgContext)
java.util.List<Index>
getInvalidIndexes(PgContext pgContext)
java.util.List<TableWithBloat>
getTablesWithBloat(PgContext pgContext)
Returns bloated tables in the specified schema on master host.java.util.List<TableWithMissingIndex>
getTablesWithMissingIndexes(PgContext pgContext)
java.util.List<Table>
getTablesWithoutPrimaryKey(PgContext pgContext)
java.util.List<UnusedIndex>
getUnusedIndexes(PgContext pgContext)
void
resetStatistics()
Reset all statistics counters on all hosts in the cluster to zero.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mfvanek.pg.index.health.IndexesHealth
getDuplicatedIndexes, getForeignKeysNotCoveredWithIndex, getIndexesWithBloat, getIndexesWithNullValues, getIntersectedIndexes, getInvalidIndexes, getTablesWithBloat, getTablesWithMissingIndexes, getTablesWithoutPrimaryKey, getUnusedIndexes
-
-
-
-
Constructor Detail
-
IndexesHealthImpl
public IndexesHealthImpl(@Nonnull HighAvailabilityPgConnection haPgConnection, @Nonnull MaintenanceFactory maintenanceFactory)
-
-
Method Detail
-
getInvalidIndexes
@Nonnull public java.util.List<Index> getInvalidIndexes(@Nonnull PgContext pgContext)
- Specified by:
getInvalidIndexes
in interfaceIndexesHealth
-
getDuplicatedIndexes
@Nonnull public java.util.List<DuplicatedIndexes> getDuplicatedIndexes(@Nonnull PgContext pgContext)
- Specified by:
getDuplicatedIndexes
in interfaceIndexesHealth
-
getIntersectedIndexes
@Nonnull public java.util.List<DuplicatedIndexes> getIntersectedIndexes(@Nonnull PgContext pgContext)
- Specified by:
getIntersectedIndexes
in interfaceIndexesHealth
-
getUnusedIndexes
@Nonnull public java.util.List<UnusedIndex> getUnusedIndexes(@Nonnull PgContext pgContext)
- Specified by:
getUnusedIndexes
in interfaceIndexesHealth
-
getForeignKeysNotCoveredWithIndex
@Nonnull public java.util.List<ForeignKey> getForeignKeysNotCoveredWithIndex(@Nonnull PgContext pgContext)
- Specified by:
getForeignKeysNotCoveredWithIndex
in interfaceIndexesHealth
-
getTablesWithMissingIndexes
@Nonnull public java.util.List<TableWithMissingIndex> getTablesWithMissingIndexes(@Nonnull PgContext pgContext)
- Specified by:
getTablesWithMissingIndexes
in interfaceIndexesHealth
-
getTablesWithoutPrimaryKey
@Nonnull public java.util.List<Table> getTablesWithoutPrimaryKey(@Nonnull PgContext pgContext)
- Specified by:
getTablesWithoutPrimaryKey
in interfaceIndexesHealth
-
getIndexesWithNullValues
@Nonnull public java.util.List<IndexWithNulls> getIndexesWithNullValues(@Nonnull PgContext pgContext)
Returns indexes in the specified schema on master host that contain null values.- Specified by:
getIndexesWithNullValues
in interfaceIndexesHealth
- Parameters:
pgContext
-PgContext
with the specified schema- Returns:
- list of indexes with null values
- See Also:
PgContext
,IndexWithNulls
-
getIndexesWithBloat
@Nonnull public java.util.List<IndexWithBloat> getIndexesWithBloat(@Nonnull PgContext pgContext)
Returns bloated indexes in the specified schema on master host.- Specified by:
getIndexesWithBloat
in interfaceIndexesHealth
- Parameters:
pgContext
-PgContext
with the specified schema- Returns:
- list of bloated indexes
- See Also:
PgContext
,IndexWithBloat
-
getTablesWithBloat
@Nonnull public java.util.List<TableWithBloat> getTablesWithBloat(@Nonnull PgContext pgContext)
Returns bloated tables in the specified schema on master host.- Specified by:
getTablesWithBloat
in interfaceIndexesHealth
- Parameters:
pgContext
-PgContext
with the specified schema- Returns:
- list of bloated tables
- See Also:
PgContext
,TableWithBloat
-
resetStatistics
public void resetStatistics()
Reset all statistics counters on all hosts in the cluster to zero.It is safe running this method on your database. It just reset counters without any impact on performance.
- Specified by:
resetStatistics
in interfaceIndexesHealth
- See Also:
StatisticsMaintenance
-
-