Skip to main content

hawdb_optimizer_graph/
lib.rs

1// Copyright 2026 Nowledge
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Graph catalog, costing, rewrites, lowering, and typed trace ownership.
16
17mod cardinality_defaults;
18pub mod context;
19pub mod cost {
20    pub use hawdb_cascades::cost::*;
21}
22pub mod graph;
23pub mod logical;
24pub mod memo {
25    pub use hawdb_cascades::memo::*;
26}
27pub mod operator;
28pub mod properties {
29    pub use hawdb_cascades::properties::*;
30}
31pub mod rule {
32    pub use hawdb_cascades::rule::*;
33}
34pub mod search;
35pub mod stage {
36    pub use hawdb_cascades::stage::*;
37}
38pub mod trace;
39
40use hawdb_optimizer_vector::plan_vector_search;
41
42pub use context::{
43    ExplainMode, OptimizerContext, QueryFamily, ResourceHints, StatementClass, TraceSink,
44};
45pub use cost::{
46    PlanCost, PlanCostBreakdown, PlanCostWeights, DEFAULT_PLAN_COST_POLICY_ID,
47    DEFAULT_PLAN_COST_WEIGHTS,
48};
49pub use graph::{
50    CascadesOptimizer, FastPathPhysicalPhase, FastPathPhysicalPlanRoot, LogicalPhase,
51    LogicalPlanRoot, LoweringReadyLogicalPlanRoot, LoweringReadyPhase, OptimizerCatalog,
52    OptimizerCatalogIndexes, OptimizerCatalogStatistics, OptimizerIndexStatistics, PhysicalPhase,
53    PhysicalPlanRoot, PlanPhase, PlanPhaseKind,
54};
55pub use hawdb_plan_cypher::PhysicalPlanNode as PlanNode;
56pub use hawdb_plan_cypher::{
57    plan_class_counts, plan_operator_counts, visit_plan, visit_plan_with_ids, PhysicalOperatorId,
58    PhysicalPlanClass, PhysicalPlanKind, PhysicalPlanNode, PlanChildren,
59};
60pub use logical::{LogicalPlanClass, LogicalPlanKind, LogicalPlanNode};
61pub use memo::{GroupId, Memo, MemoGroup};
62pub use properties::{
63    Distribution, MemoryBudgetClass, PhysicalProperties, RequiredProperties, ScanPruningSupport,
64    VectorPrecision,
65};
66pub use rule::{
67    apply_rule_batch, AppliedRule, OptimizerRule, RuleApplication, RuleBatch, RuleId, RuleKind,
68    RulePromise,
69};
70pub use search::{
71    OptimizationSearchReport, OptimizerSearchDirective, OptimizerSearchDirectiveError, RuleEvent,
72    RuleOutcome, SearchMode, SelectedPlanTrace,
73};
74pub use stage::{
75    ApplyOrder, OptimizationPipeline, OptimizationStage, PipelineExecution, RuleStage,
76    StageRuleBatch, StageStats, StageTrace,
77};
78pub use trace::{OperatorCardinalityEstimate, OptimizerConfig, OptimizerTrace};
79
80pub use hawdb_cascades::qualification::{
81    InvalidOptimizerCostPerturbation, OptimizerBoundedOrderAlternative, OptimizerCostPerturbation,
82    OptimizerQualificationOptions, OptionalOptimizerRule, BOUNDED_ORDER_QUALIFICATION_RULE,
83};
84
85pub use hawdb_cascades::qualification::{
86    verify_optimizer_rule_assertions, OptimizerRuleAssertion, OptimizerRuleAssertionError,
87};