1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Plan Analysis Module
//!
//! Provides an analysis of query plans, supporting decision-making processes related to optimization.
//! Quote Count Analysis: Identifying Sub-plans That Are Cited Multiple Times
//! Expression analysis: Examining the characteristics of an expression (such as determinacy, complexity, etc.)
//! Fingerprint calculation: Calculating the structural fingerprint of the planning nodes
//!
//! # Explanation of the module locations
//!
//! This module is located in `src/query/optimizer/analysis/` and is at the same level as the `cost` module.
//! Reason for placing it in the optimizer rather than the planner:
//! Separation of responsibilities: The planner is responsible for generating plans, while the optimizer is responsible for optimizing these plans.
//! 2. Calculation on demand: Analysis is only performed during the optimization phase, as and when necessary.
//! 3. Dependency relationships: The optimizer already depends on the planner; therefore, no circular dependencies will be introduced.
//!
//! # Usage Examples
//!
//! ```rust
//! use linkrs_query::optimizer::analysis::{
//! ExpressionAnalyzer,
//! ReferenceCountAnalyzer,
//! };
//!
//! let ref_analyzer = ReferenceCountAnalyzer::new();
//! let expr_analyzer = ExpressionAnalyzer::new();
//!
//! // Count how many times sub-plans are referenced (needs a full plan):
//! // let ref_analysis = ref_analyzer.analyze(plan.root());
//! // Analyze an expression's characteristics (determinism, complexity, etc.):
//! // let expr_analysis = expr_analyzer.analyze(condition);
//! ```
// Re-export the main types
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;