#include <Index.h>
|  | 
| static constexpr const char * | name = "index-analysis" | 
|  | 
Definition at line 413 of file Index.h.
 
◆ IndexAnalysis()
  
  | 
        
          | souffle::ram::analysis::IndexAnalysis::IndexAnalysis | ( | const char * | id | ) |  |  | inline | 
 
 
◆ getIndexes()
      
        
          | MinIndexSelection & souffle::ram::analysis::IndexAnalysis::getIndexes | ( | const std::string & | relName | ) |  | 
      
 
@Brief get the minimal index cover for a relation 
- Parameters
- 
  
  
- Returns
- set of indexes of the minimal index cover 
Definition at line 549 of file Index.cpp.
  556         const std::string& relName = cur.first;
 
  557         const MinIndexSelection& indexes = cur.second;
 
 
Referenced by run().
 
 
◆ getSearchSignature() [1/4]
@Brief Get the index signature for an existence check 
- Parameters
- 
  
  
- Returns
- index signature of existence check 
Definition at line 655 of file Index.cpp.
 
 
◆ getSearchSignature() [2/4]
@Brief Get index signature for an Ram IndexOperation operation 
- Parameters
- 
  
    | Index-relation-search | operation |  
 
- Returns
- Index signature of operation 
Definition at line 612 of file Index.cpp.
  618         } 
else if (*lower[
i] == *upper[
i]) {
 
  628     const auto values = provExistCheck->getValues();
 
  630     auto auxiliaryArity = 
rel->getAuxiliaryArity();
 
 
Referenced by run().
 
 
◆ getSearchSignature() [3/4]
@Brief Get the index signature for a provenance existence check 
- Parameters
- 
  
    | Provenance-existence | check |  
 
- Returns
- index signature of provenance-existence check 
Definition at line 633 of file Index.cpp.
  642     for (
size_t i = values.size() - auxiliaryArity; 
i < values.size(); 
i++) {
 
  651     return searchSignature(
rel->getArity(), existCheck->getValues());
 
 
References souffle::ram::analysis::Equal, i, and souffle::ram::isUndefValue().
 
 
◆ getSearchSignature() [4/4]
@Brief Get the default index signature for a relation (the total-order index) 
- Parameters
- 
  
  
- Returns
- total full-signature of the relation 
Definition at line 660 of file Index.cpp.
 
 
◆ isTotalSignature()
      
        
          | bool souffle::ram::analysis::IndexAnalysis::isTotalSignature | ( | const AbstractExistenceCheck * | existCheck | ) | const | 
      
 
@Brief index signature of existence check resembles a total index 
- Parameters
- 
  
    | (provenance) | existence check |  
 
isTotalSignature returns true if all elements of a tuple are used for the the existence check. 
Definition at line 664 of file Index.cpp.
 
 
◆ print()
  
  | 
        
          | void souffle::ram::analysis::IndexAnalysis::print | ( | std::ostream & |  | ) | const |  | overridevirtual | 
 
Print the analysis result in HTML format. 
Reimplemented from souffle::ram::analysis::Analysis.
Definition at line 560 of file Index.cpp.
  561                                    : 
" << indexes.getSearches().size() << "\n"; 
  564         for (auto& search : indexes.getSearches()) { 
  571         for (auto& chain : indexes.getAllChains()) { 
  572             os << join(chain, "-->
") << "\n
"; 
  576         os << "\tNumber of Indexes: 
" << indexes.getAllOrders().size() << "\n"; 
  577         for (auto& order : indexes.getAllOrders()) { 
  579             os << join(order, "<
") << "\n"; 
  586 // handles equality constraints 
  587 template <typename Iter> 
  588 SearchSignature searchSignature(size_t arity, Iter const& bgn, Iter const& end) { 
  589     SearchSignature keys(arity); 
 
 
◆ run()
  
  | 
        
          | void souffle::ram::analysis::IndexAnalysis::run | ( | const TranslationUnit & | translationUnit | ) |  |  | overridevirtual | 
 
Run analysis for a RAM translation unit. 
Implements souffle::ram::analysis::Analysis.
Definition at line 480 of file Index.cpp.
  490         if (
const auto* indexSearch = 
dynamic_cast<const IndexOperation*
>(&node)) {
 
  491             MinIndexSelection& indexes = 
getIndexes(indexSearch->getRelation());
 
  493         } 
else if (
const auto* exists = 
dynamic_cast<const ExistenceCheck*
>(&node)) {
 
  494             MinIndexSelection& indexes = 
getIndexes(exists->getRelation());
 
  496         } 
else if (
const auto* provExists = 
dynamic_cast<const ProvenanceExistenceCheck*
>(&node)) {
 
  497             MinIndexSelection& indexes = 
getIndexes(provExists->getRelation());
 
  499         } 
else if (
const auto* ramRel = 
dynamic_cast<const Relation*
>(&node)) {
 
  500             MinIndexSelection& indexes = 
getIndexes(ramRel->getName());
 
  513         const std::string& relA = swap.getFirstRelation();
 
  514         const std::string& relB = swap.getSecondRelation();
 
  515         MinIndexSelection& indexesA = getIndexes(relA);
 
  516         MinIndexSelection& indexesB = getIndexes(relB);
 
  518         for (const auto& signature : indexesA.getSearches()) {
 
  519             indexesB.addSearch(signature);
 
  523         for (
const auto& signature : indexesB.getSearches()) {
 
  524             indexesA.addSearch(signature);
 
  530         MinIndexSelection& indexes = cur.second;
 
  536         MinIndexSelection& indexes = cur.second;
 
  537         if (indexes.getAllOrders().empty()) {
 
  538             indexes.insertDefaultTotalIndex(0);
 
 
References souffle::ram::analysis::MinIndexSelection::addSearch(), getIndexes(), and getSearchSignature().
 
 
◆ minIndexCover
  
  | 
        
          | std::map<std::string, MinIndexSelection> souffle::ram::analysis::IndexAnalysis::minIndexCover |  | private | 
 
minimal index cover for relations, i.e., maps a relation to a set of indexes 
Definition at line 474 of file Index.h.
 
 
◆ name
  
  | 
        
          | constexpr const char* souffle::ram::analysis::IndexAnalysis::name = "index-analysis" |  | staticconstexpr | 
 
 
◆ relAnalysis
relation analysis for looking up relations by name 
Definition at line 469 of file Index.h.
 
 
The documentation for this class was generated from the following files:
 
void visitDepthFirst(const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
A utility function visiting all nodes within the RAM fragments rooted by the given node recursively i...