Class Optimize


public final class Optimize extends ACreate
Evaluates the 'optimize' command and optimizes the data structures of the currently opened database. Indexes and statistics are refreshed, which is especially helpful after updates.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Optimize

      public Optimize()
      Default constructor.
  • Method Details

    • run

      protected boolean run()
      Description copied from class: Command
      Executes the command and serializes the result (internal call).
      Specified by:
      run in class Command
      Returns:
      success of operation
    • progressInfo

      public double progressInfo()
      Description copied from class: Job
      Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
      Overrides:
      progressInfo in class Job
      Returns:
      header information
    • stoppable

      public boolean stoppable()
      Description copied from class: Command
      Returns true if this command can be stopped. This method is only required by the GUI.
      Overrides:
      stoppable in class ACreate
      Returns:
      result of check
    • detailedInfo

      public String detailedInfo()
      Description copied from class: Job
      Returns detailed progress information. Can be overwritten to give more specific feedback.
      Overrides:
      detailedInfo in class Job
      Returns:
      header information
    • finish

      public static void finish(Data data) throws IOException
      Optimizes a database after updates.
      Parameters:
      data - data
      Throws:
      IOException - I/O Exception
    • optimize

      public static void optimize(Data data, Optimize cmd) throws IOException
      Optimizes the structures of a database.
      Parameters:
      data - data
      cmd - calling command instance (may be null)
      Throws:
      IOException - I/O Exception during index rebuild
    • optimize

      public static void optimize(Data data, boolean enforceText, boolean enforceAttr, boolean enforceToken, boolean enforceFt, Optimize cmd) throws IOException
      Optimizes the structures of a database.
      Parameters:
      data - data
      enforceText - enforce creation or deletion of text index
      enforceAttr - enforce creation or deletion of attribute index
      enforceToken - enforce creation or deletion of token index
      enforceFt - enforce creation or deletion of full-text index
      cmd - calling command instance (may be null)
      Throws:
      IOException - I/O Exception during index rebuild