Interface IndexStatisticsDaemon

All Known Implementing Classes:
IndexStatisticsDaemonImpl

public interface IndexStatisticsDaemon
Daemon acting as a coordinator for creating and updating index statistics.

There are two modes of operation:

  • explicit - generates index statistics due to an explict request from the user. The entrypoint is runExplicitly.
  • background - generates index statistics as a background task due to an event that has triggered a statistics update. The entrypoint is schedule.
    • The modes differ in how the operation affects other operations in the running system, and also how errors are dealt with. The background mode will try to affect other operations as little as possible, and errors won't be reported unless they are severe. The explicit mode will do more to make sure the operation succeeds (for instance by using locks), and will report all errors.

  • Method Details

    • runExplicitly

      void runExplicitly(LanguageConnectionContext lcc, TableDescriptor td, ConglomerateDescriptor[] cds, String runContext) throws StandardException
      Creates/updates index statistics for the specified conglomerates/indexes.
      Parameters:
      lcc - connection used to carry out the work
      td - base table
      cds - index conglomerates (non-index conglomerates are ignored)
      runContext - descriptive text for the context in which the work is being run (i.e. ALTER TABLE)
      Throws:
      StandardException - if something goes wrong
    • schedule

      void schedule(TableDescriptor td)
      Schedules creation/update of the index statistics associated with the specified table.

      Note that the scheduling request may be denied. Typical situations where that will happen is if the work queue is full, or if work has already been scheduled for the specified table.

      Parameters:
      td - base table
    • stop

      void stop()
      Stops the background daemon.

      Any ongoing tasks will be aborted as soon as possible, and it will not be possible to schedule new tasks. Note that runExplicitly can still be used.