View Source Tablex.Optimizer.Helper (tablex v0.2.0-alpha.3)

Link to this section Summary

Functions

Remove all already-existing stubs in an output.

Check if a input condition covers by another.

Fix ids of rules.

Check if an output is meaningful. A meaningful output is one that does not contain all :any elements.

Order an already sorted, list of rules by hit policy.

Order a list of table rules by priority, high to low.

Link to this section Types

@type order() :: :h2l | :l2h
@type rule() :: Tablex.Table.rule()

Link to this section Functions

Link to this function

conflict_free_output(output, existing_output)

View Source

Remove all already-existing stubs in an output.

example

Example

iex> conflict_free_output([1, 2, 3], [2, 4, 6]) [:any, :any, :any]

iex> conflict_free_output([1, 2, 3], [2, :any, 6]) [:any, 2, :any]

@spec covers?(covering :: any(), target :: any()) :: boolean()

Check if a input condition covers by another.

@spec fix_ids([rule()]) :: [rule()]

Fix ids of rules.

Link to this function

meaningful_output?(output)

View Source

Check if an output is meaningful. A meaningful output is one that does not contain all :any elements.

Link to this function

order_by_hit_policy(rules, arg2, arg3)

View Source
@spec order_by_hit_policy(
  [rule()],
  current_order :: order(),
  Tablex.HitPolicy.hit_policy()
) :: [rule()]

Order an already sorted, list of rules by hit policy.

Link to this function

order_by_priority_high_to_lower(rules, arg2)

View Source

Order a list of table rules by priority, high to low.

Link to this function

stub_covers?(same, same)

View Source