Module notice

Source
Expand description

Notices that the optimizer wants to show to users.

The top-level notice types are RawOptimizerNotice (for notices emitted by optimizer pipelines) and OptimizerNotice (for notices stored in the catalog memory). The adapter module contains code for converting the former to the latter.

The RawOptimizerNotice type is an enum generated by the raw_optimizer_notices macro. Each notice type lives in its own submodule and implements the OptimizerNoticeApi trait.

To add a new notice do the following:

  1. Create a new submodule.
  2. Define a struct for the new notice in that submodule.
  3. Implement OptimizerNoticeApi for that struct.
  4. Re-export the notice type in this module.
  5. Add the notice type to the raw_optimizer_notices macro which generates the RawOptimizerNotice enum and other boilerplate code.

ModulesΒ§

index_already_exists πŸ”’
Hosts IndexAlreadyExists.
index_key_empty πŸ”’
Hosts IndexKeyEmpty.
index_too_wide_for_literal_constraints πŸ”’
Hosts IndexTooWideForLiteralConstraints.

MacrosΒ§

raw_optimizer_notices πŸ”’

StructsΒ§

HumanizedAction
A wrapper for the OptimizerNoticeApi::fmt_action that implements fmt::Display.
HumanizedHint
A wrapper for the OptimizerNoticeApi::fmt_hint that implements fmt::Display.
HumanizedMessage
A wrapper for the OptimizerNoticeApi::fmt_message that implements fmt::Display.
IndexAlreadyExists
Trying to re-create an index that already exists.
IndexKeyEmpty
An index with an empty key is maximally skewed (all of the data goes to a single worker), and is almost never really useful. It’s slightly useful for a cross join, because a cross join also has an empty key, so we avoid rearranging the input. However, this is still not very useful, because
IndexTooWideForLiteralConstraints
An index could be used for some literal constraints if the index included only a subset of its columns.
OptimizerNotice
An long lived in-memory representation of a RawOptimizerNotice that is meant to be kept as part of the hydrated catalog state.

EnumsΒ§

Action
An action attached to an OptimizerNotice
ActionKind
OptimizerNoticeKind
RawOptimizerNotice
Notices that the optimizer wants to show to users.

TraitsΒ§

OptimizerNoticeApi
An API structs RawOptimizerNotice wrapped by structs