souffle  2.0.2-371-g6315b36
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
souffle::ram::analysis::MinIndexSelection Class Reference

#include <Index.h>

Inheritance diagram for souffle::ram::analysis::MinIndexSelection:
Inheritance graph
Collaboration diagram for souffle::ram::analysis::MinIndexSelection:
Collaboration graph

Data Structures

class  SearchComparator
 

Public Types

using AttributeIndex = uint32_t
 
using AttributeSet = std::unordered_set< AttributeIndex >
 
using Chain = std::vector< SearchSignature >
 
using ChainOrderMap = std::list< Chain >
 
using DischargeMap = std::unordered_map< SearchSignature, AttributeSet, SearchSignature::Hasher >
 
using IndexSignatureMap = std::unordered_map< AttributeIndex, SearchSignature >
 
using LexOrder = std::vector< AttributeIndex >
 
using OrderCollection = std::vector< LexOrder >
 
using SearchSet = std::set< SearchSignature, SearchComparator >
 
using SignatureIndexMap = std::unordered_map< SearchSignature, AttributeIndex, SearchSignature::Hasher >
 
using SignatureMap = std::unordered_map< SearchSignature, SearchSignature, SearchSignature::Hasher >
 

Public Member Functions

void addSearch (SearchSignature cols)
 @Brief Add new key to an Index Set More...
 
const ChainOrderMap getAllChains () const
 @Brief Get all chains More...
 
const OrderCollection getAllOrders () const
 @Brief Get all indexes More...
 
AttributeSet getAttributesToDischarge (const SearchSignature &s, const Relation &rel)
 Return the attribute position for each indexed operation that should be discharged. More...
 
const LexOrdergetLexOrder (SearchSignature cols) const
 @Brief Get index for a search More...
 
int getLexOrderNum (SearchSignature cols) const
 @Brief Get index for a search More...
 
const SearchSetgetSearches () const
 @Brief Get searches More...
 
void insertDefaultTotalIndex (size_t arity)
 @Brief insert a total order index More...
 
bool isSubset (SearchSignature cols) const
 Check whether number of constraints in k is not equal to number of columns in lexicographical order. More...
 
 MinIndexSelection ()=default
 
void print (std::ostream &os)
 
void solve ()
 @Brief map the keys in the key set to lexicographical order More...
 
 ~MinIndexSelection ()=default
 

Protected Member Functions

Chain getChain (const SearchSignature umn, const MaxMatching::Matchings &match)
 @Brief get a chain from a matching More...
 
const ChainOrderMap getChainsFromMatching (const MaxMatching::Matchings &match, const SearchSet &nodes)
 @Brief get all chains from the matching More...
 
const SearchSet getUnmatchedKeys (const MaxMatching::Matchings &match, const SearchSet &nodes)
 @Brief get all nodes which are unmatched from A-> B More...
 
void insertIndex (LexOrder &ids, SearchSignature delta)
 @Brief insert an index based on the delta More...
 
int map (SearchSignature cols) const
 @Brief maps search columns to an lexicographical order (labeled by a number) More...
 
void removeExtraInequalities ()
 @Brief remove arbitrary extra inequalities More...
 
void updateSearch (SearchSignature oldSearch, SearchSignature newSearch)
 

Static Protected Member Functions

static size_t card (SearchSignature cols)
 @Brief count the number of constraints in key More...
 

Protected Attributes

ChainOrderMap chainToOrder
 
DischargeMap dischargedMap
 
IndexSignatureMap indexToSignature
 
MaxMatching matching
 
OrderCollection orders
 
SearchSet searches
 
SignatureIndexMap signatureToIndexA
 
SignatureIndexMap signatureToIndexB
 

Detailed Description

@Brief computes the minimal index cover for a relation in a RAM Program.

If the indexes of a relation can cover several searches, the minimal set of indexes is computed by Dilworth's problem. See

"Automatic Index Selection for Large-Scale Datalog Computation" http://www.vldb.org/pvldb/vol12/p141-subotic.pdf

Definition at line 208 of file Index.h.

Member Typedef Documentation

◆ AttributeIndex

Definition at line 210 of file Index.h.

◆ AttributeSet

Definition at line 211 of file Index.h.

◆ Chain

Definition at line 218 of file Index.h.

◆ ChainOrderMap

Definition at line 221 of file Index.h.

◆ DischargeMap

Definition at line 215 of file Index.h.

◆ IndexSignatureMap

Definition at line 214 of file Index.h.

◆ LexOrder

Definition at line 216 of file Index.h.

◆ OrderCollection

Definition at line 217 of file Index.h.

◆ SearchSet

Definition at line 231 of file Index.h.

◆ SignatureIndexMap

Definition at line 213 of file Index.h.

◆ SignatureMap

Definition at line 212 of file Index.h.

Constructor & Destructor Documentation

◆ MinIndexSelection()

souffle::ram::analysis::MinIndexSelection::MinIndexSelection ( )
default

◆ ~MinIndexSelection()

souffle::ram::analysis::MinIndexSelection::~MinIndexSelection ( )
default

Member Function Documentation

◆ addSearch()

void souffle::ram::analysis::MinIndexSelection::addSearch ( SearchSignature  cols)
inline

@Brief Add new key to an Index Set

Definition at line 237 of file Index.h.

237  {
238  if (!cols.empty()) {
239  searches.insert(cols);
240  }
241  }

References souffle::ram::analysis::SearchSignature::empty(), and searches.

Referenced by souffle::ram::analysis::IndexAnalysis::run().

Here is the call graph for this function:

◆ card()

static size_t souffle::ram::analysis::MinIndexSelection::card ( SearchSignature  cols)
inlinestaticprotected

@Brief count the number of constraints in key

Definition at line 338 of file Index.h.

338  {
339  size_t sz = 0;
340  for (size_t i = 0; i < cols.arity(); i++) {
341  if (cols[i] != AttributeConstraint::None) {
342  sz++;
343  }
344  }
345  return sz;
346  }

References souffle::ram::analysis::SearchSignature::arity(), i, and souffle::ram::analysis::None.

Referenced by isSubset().

Here is the call graph for this function:

◆ getAllChains()

const ChainOrderMap souffle::ram::analysis::MinIndexSelection::getAllChains ( ) const
inline

@Brief Get all chains

Definition at line 268 of file Index.h.

268  {
269  return chainToOrder;
270  }

References chainToOrder.

Referenced by print().

◆ getAllOrders()

const OrderCollection souffle::ram::analysis::MinIndexSelection::getAllOrders ( ) const
inline

@Brief Get all indexes

Definition at line 263 of file Index.h.

263  {
264  return orders;
265  }

References orders.

Referenced by souffle::interpreter::Relation< 2, Eqrel >::castView(), and print().

◆ getAttributesToDischarge()

MinIndexSelection::AttributeSet souffle::ram::analysis::MinIndexSelection::getAttributesToDischarge ( const SearchSignature s,
const Relation rel 
)

Return the attribute position for each indexed operation that should be discharged.

Definition at line 443 of file Index.cpp.

449  {
450  return allInequalities;
451  }
452 
453  // do not support indexed inequalities with provenance
454  if (Global::config().has("provenance")) {
455  return allInequalities;
456  }
457 
458  // if we are in the interpreter then we only permit signed inequalities
459  // remembering to discharge any excess signed inequalities!
460  AttributeSet interpreterAttributesToDischarge(dischargedMap[s]);
461  for (size_t i = 0; i < s.arity(); ++i) {
462  if (s[i] == AttributeConstraint::Inequal && rel.getAttributeTypes()[i][0] != 'i') {
463  interpreterAttributesToDischarge.insert(i);
464  }
465  }
466  if (!Global::config().has("compile") && !Global::config().has("dl-program") &&
467  !Global::config().has("generate") && !Global::config().has("swig")) {
468  return interpreterAttributesToDischarge;
469  }
470 
471  return dischargedMap[s];
472 }
473 
474 void IndexAnalysis::run(const TranslationUnit& translationUnit) {
475  relAnalysis = translationUnit.getAnalysis<RelationAnalysis>();
476 
477  // After complete:
478  // 1. All relations should have at least one index (for full-order search).

◆ getChain()

MinIndexSelection::Chain souffle::ram::analysis::MinIndexSelection::getChain ( const SearchSignature  umn,
const MaxMatching::Matchings match 
)
protected

@Brief get a chain from a matching

Parameters
Startingnode of a chain
Matching
Returns
A minimal chain given an unmapped node from set A we follow it from set B until it cannot be matched from B if not matched from B then umn is a chain.

Definition at line 348 of file Index.cpp.

351  {
352  auto mit = match.find(signatureToIndexB[start]); // we start from B side
353  // on each iteration we swap sides when collecting the chain so we use the corresponding index map
354  if (std::find(chain.begin(), chain.end(), start) == chain.end()) {
355  chain.push_back(start);
356  }
357 
358  if (mit == match.end()) {
359  std::reverse(chain.begin(), chain.end());
360  return chain;
361  }
362 
363  SearchSignature a = indexToSignature.at(mit->second);
364  if (std::find(chain.begin(), chain.end(), a) == chain.end()) {
365  chain.push_back(a);
366  }
367  start = a;
368  }
369 }
370 
372  const MaxMatching::Matchings& match, const SearchSet& nodes) {
373  assert(!nodes.empty());
374 
375  // Get all unmatched nodes from A

References indexToSignature, and signatureToIndexB.

◆ getChainsFromMatching()

const MinIndexSelection::ChainOrderMap souffle::ram::analysis::MinIndexSelection::getChainsFromMatching ( const MaxMatching::Matchings match,
const SearchSet nodes 
)
protected

@Brief get all chains from the matching

Definition at line 377 of file Index.cpp.

378  {
379  for (auto node : nodes) {
380  Chain a;
381  a.push_back(node);
382  chainToOrder.push_back(a);
383  return chainToOrder;
384  }
385  }
386 
387  assert(!umKeys.empty());
388 
389  // A worklist of used nodes
390  SearchSet usedKeys;
391 
392  // Case: nodes < umKeys or if nodes == umKeys then anti chain - this is handled by this loop
393  for (auto umKey : umKeys) {
394  Chain c = getChain(umKey, match);
395  assert(!c.empty());
396  chainToOrder.push_back(c);
397  }
398 
399  assert(!chainToOrder.empty());
400  return chainToOrder;
401 }
402 
403 void MinIndexSelection::updateSearch(SearchSignature oldSearch, SearchSignature newSearch) {
404  auto delta = SearchSignature::getDelta(oldSearch, newSearch);
405  for (size_t i = 0; i < delta.arity(); ++i) {
406  if (delta[i] == AttributeConstraint::Inequal) {
407  dischargedMap[oldSearch].insert(i);

References chainToOrder.

◆ getLexOrder()

const LexOrder& souffle::ram::analysis::MinIndexSelection::getLexOrder ( SearchSignature  cols) const
inline

@Brief Get index for a search

Definition at line 252 of file Index.h.

252  {
253  int idx = map(cols);
254  return orders[idx];
255  }

References map(), and orders.

Here is the call graph for this function:

◆ getLexOrderNum()

int souffle::ram::analysis::MinIndexSelection::getLexOrderNum ( SearchSignature  cols) const
inline

@Brief Get index for a search

Definition at line 258 of file Index.h.

258  {
259  return map(cols);
260  }

References map().

Here is the call graph for this function:

◆ getSearches()

const SearchSet& souffle::ram::analysis::MinIndexSelection::getSearches ( ) const
inline

@Brief Get searches

Definition at line 247 of file Index.h.

247  {
248  return searches;
249  }

References searches.

Referenced by print().

◆ getUnmatchedKeys()

const SearchSet souffle::ram::analysis::MinIndexSelection::getUnmatchedKeys ( const MaxMatching::Matchings match,
const SearchSet nodes 
)
inlineprotected

@Brief get all nodes which are unmatched from A-> B

Definition at line 396 of file Index.h.

396  {
397  SearchSet unmatched;
398 
399  // For all nodes n such that n is not in match
400  for (auto node : nodes) {
401  if (match.find(signatureToIndexA[node]) == match.end()) {
402  unmatched.insert(node);
403  }
404  }
405  return unmatched;
406  }

References signatureToIndexA.

◆ insertDefaultTotalIndex()

void souffle::ram::analysis::MinIndexSelection::insertDefaultTotalIndex ( size_t  arity)
inline

@Brief insert a total order index

Parameters
sizeof the index

Definition at line 287 of file Index.h.

287  {
288  Chain chain = std::vector<SearchSignature>();
289  SearchSignature fullIndexKey = SearchSignature::getFullSearchSignature(arity);
290  chain.push_back(fullIndexKey);
291  chainToOrder.push_back(std::move(chain));
292  LexOrder totalOrder;
293  for (size_t i = 0; i < arity; ++i) {
294  totalOrder.push_back(i);
295  }
296  orders.push_back(std::move(totalOrder));
297  }

References chainToOrder, souffle::ram::analysis::SearchSignature::getFullSearchSignature(), i, and orders.

Here is the call graph for this function:

◆ insertIndex()

void souffle::ram::analysis::MinIndexSelection::insertIndex ( LexOrder ids,
SearchSignature  delta 
)
inlineprotected

@Brief insert an index based on the delta

Definition at line 362 of file Index.h.

362  {
363  LexOrder backlog; // add inequalities at the end
364  for (size_t pos = 0; pos < delta.arity(); pos++) {
365  if (delta[pos] == AttributeConstraint::Equal) {
366  ids.push_back(pos);
367  } else if (delta[pos] == AttributeConstraint::Inequal) {
368  backlog.push_back(pos);
369  }
370  }
371  ids.insert(ids.end(), backlog.begin(), backlog.end());
372  }

References souffle::ram::analysis::SearchSignature::arity(), souffle::ram::analysis::Equal, and souffle::ram::analysis::Inequal.

Here is the call graph for this function:

◆ isSubset()

bool souffle::ram::analysis::MinIndexSelection::isSubset ( SearchSignature  cols) const
inline

Check whether number of constraints in k is not equal to number of columns in lexicographical order.

Definition at line 276 of file Index.h.

276  {
277  int idx = map(cols);
278  return card(cols) < orders[idx].size();
279  }

References card(), map(), and orders.

Here is the call graph for this function:

◆ map()

int souffle::ram::analysis::MinIndexSelection::map ( SearchSignature  cols) const
inlineprotected

@Brief maps search columns to an lexicographical order (labeled by a number)

Definition at line 349 of file Index.h.

349  {
350  assert(orders.size() == chainToOrder.size() && "Order and Chain Sizes do not match!!");
351  int i = 0;
352  for (auto it = chainToOrder.begin(); it != chainToOrder.end(); ++it, ++i) {
353  if (std::find(it->begin(), it->end(), cols) != it->end()) {
354  assert((size_t)i < orders.size());
355  return i;
356  }
357  }
358  fatal("cannot find matching lexicographical order");
359  }

References chainToOrder, souffle::fatal(), i, and orders.

Referenced by getLexOrder(), getLexOrderNum(), and isSubset().

Here is the call graph for this function:

◆ print()

void souffle::ram::analysis::MinIndexSelection::print ( std::ostream &  os)
inline

Definition at line 302 of file Index.h.

302  {
303  /* Print searches */
304  os << "\tNumber of Searches: " << getSearches().size() << "\n";
305 
306  /* print searches */
307  for (auto& search : getSearches()) {
308  os << "\t\t";
309  os << search;
310  os << "\n";
311  }
312 
313  /* print chains */
314  for (auto& chain : getAllChains()) {
315  os << join(chain, "-->") << "\n";
316  }
317  os << "\n";
318 
319  os << "\tNumber of Indexes: " << getAllOrders().size() << "\n";
320  for (auto& order : getAllOrders()) {
321  os << "\t\t";
322  os << join(order, "<") << "\n";
323  os << "\n";
324  }
325  }

References getAllChains(), getAllOrders(), getSearches(), and souffle::join().

Here is the call graph for this function:

◆ removeExtraInequalities()

void souffle::ram::analysis::MinIndexSelection::removeExtraInequalities ( )
protected

@Brief remove arbitrary extra inequalities

Definition at line 426 of file Index.cpp.

426  {
427  newSearch[i] = AttributeConstraint::None;
428  } else {
429  seenInequality = true;
430  }
431  }
432  }
433  updateSearch(oldSearch, newSearch);
434  }
435 }
436 
438  const SearchSignature& s, const Relation& rel) {
439  // by default we have all attributes w/inequalities discharged
440  AttributeSet allInequalities;
441  for (size_t i = 0; i < s.arity(); ++i) {

References i, and souffle::ram::analysis::None.

◆ solve()

void souffle::ram::analysis::MinIndexSelection::solve ( )

@Brief map the keys in the key set to lexicographical order

Definition at line 263 of file Index.cpp.

268  : searches) {
269  if (s.empty()) {
270  continue;
271  }
272  // map the signature to its unique index in each set
273  signatureToIndexA.insert({s, currentIndex});
274  signatureToIndexB.insert({s, currentIndex + 1});
275  // map each index back to the search signature
276  indexToSignature.insert({currentIndex, s});
277  indexToSignature.insert({currentIndex + 1, s});
278  currentIndex += 2;
279  }
280 
281  // Construct the matching poblem
282  for (auto search : searches) {
283  for (auto itt : searches) {
284  if (search == itt) {
285  continue;
286  }
287 
288  if (search < itt) {
290  }
291  }
292  }
293 
294  // Perform the Hopcroft-Karp on the graph and receive matchings (mapped A->B and B->A)
295  // Assume: alg.calculate is not called on an empty graph
296  assert(!searches.empty());
297  const MaxMatching::Matchings& matchings = matching.solve();
298 
299  // Extract the chains given the nodes and matchings
300  ChainOrderMap chains = getChainsFromMatching(matchings, searches);
301 
302  // Should never get no chains back as we never call calculate on an empty graph
303  assert(!chains.empty());
304  for (const auto& chain : chains) {
305  std::vector<uint32_t> ids;
306 
307  SearchSignature initDelta = *(chain.begin());
308  insertIndex(ids, initDelta);
309 
310  // build the lex-order
311  for (auto iit = chain.begin(); next(iit) != chain.end(); ++iit) {
312  SearchSignature delta = SearchSignature::getDelta(*next(iit), *iit);
313  insertIndex(ids, delta);
314  }
315 
316  assert(!ids.empty());
317  orders.push_back(ids);
318  }
319 
320  // Validate the lex-order
321  for (auto chain : chains) {
322  for (auto search : chain) {
323  int idx = map(search);
324  size_t l = card(search);
325 
326  SearchSignature k(search.arity());
327  for (size_t i = 0; i < l; i++) {
329  }
330  for (size_t i = 0; i < search.arity(); ++i) {
331  if (k[i] == AttributeConstraint::None && search[i] != AttributeConstraint::None) {
332  assert("incorrect lexicographical order");
333  }
334  if (k[i] != AttributeConstraint::None && search[i] == AttributeConstraint::None) {
335  assert("incorrect lexicographical order");
336  }
337  }
338  }
339  }
340 }
341 
343  const SearchSignature umn, const MaxMatching::Matchings& match) {
344  SearchSignature start = umn; // start at an unmatched node
345  Chain chain;
346  // given an unmapped node from set A we follow it from set B until it cannot be matched from B

◆ updateSearch()

void souffle::ram::analysis::MinIndexSelection::updateSearch ( SearchSignature  oldSearch,
SearchSignature  newSearch 
)
protected
Parameters
OldSearchto be updated
NewSearchto replace the OldSearch

Definition at line 409 of file Index.cpp.

411  : chainToOrder) {
412  for (auto& search : chain) {
413  if (search == oldSearch) {
414  search = newSearch;
415  }
416  }
417  }
418 }
419 
421  for (auto oldSearch : searches) {
422  auto newSearch = oldSearch;
423  bool seenInequality = false;
424  for (size_t i = 0; i < oldSearch.arity(); ++i) {

Field Documentation

◆ chainToOrder

ChainOrderMap souffle::ram::analysis::MinIndexSelection::chainToOrder
protected

Definition at line 334 of file Index.h.

Referenced by getAllChains(), getChainsFromMatching(), insertDefaultTotalIndex(), and map().

◆ dischargedMap

DischargeMap souffle::ram::analysis::MinIndexSelection::dischargedMap
protected

Definition at line 330 of file Index.h.

◆ indexToSignature

IndexSignatureMap souffle::ram::analysis::MinIndexSelection::indexToSignature
protected

Definition at line 331 of file Index.h.

Referenced by getChain().

◆ matching

MaxMatching souffle::ram::analysis::MinIndexSelection::matching
protected

Definition at line 335 of file Index.h.

◆ orders

OrderCollection souffle::ram::analysis::MinIndexSelection::orders
protected

Definition at line 333 of file Index.h.

Referenced by getAllOrders(), getLexOrder(), insertDefaultTotalIndex(), isSubset(), and map().

◆ searches

SearchSet souffle::ram::analysis::MinIndexSelection::searches
protected

Definition at line 332 of file Index.h.

Referenced by addSearch(), and getSearches().

◆ signatureToIndexA

SignatureIndexMap souffle::ram::analysis::MinIndexSelection::signatureToIndexA
protected

Definition at line 328 of file Index.h.

Referenced by getUnmatchedKeys().

◆ signatureToIndexB

SignatureIndexMap souffle::ram::analysis::MinIndexSelection::signatureToIndexB
protected

Definition at line 329 of file Index.h.

Referenced by getChain().


The documentation for this class was generated from the following files:
souffle::ram::analysis::MaxMatching::solve
const Matchings & solve()
@Brief solve the maximum matching problem
Definition: Index.cpp:248
souffle::ram::analysis::MinIndexSelection::orders
OrderCollection orders
Definition: Index.h:333
souffle::ram::analysis::MinIndexSelection::matching
MaxMatching matching
Definition: Index.h:335
souffle::ram::analysis::MinIndexSelection::Chain
std::vector< SearchSignature > Chain
Definition: Index.h:218
souffle::ram::analysis::MinIndexSelection::searches
SearchSet searches
Definition: Index.h:332
souffle::ram::analysis::MinIndexSelection::insertIndex
void insertIndex(LexOrder &ids, SearchSignature delta)
@Brief insert an index based on the delta
Definition: Index.h:362
souffle::ram::analysis::AttributeConstraint::Inequal
@ Inequal
souffle::ram::analysis::MinIndexSelection::updateSearch
void updateSearch(SearchSignature oldSearch, SearchSignature newSearch)
Definition: Index.cpp:409
souffle::ram::analysis::MinIndexSelection::map
int map(SearchSignature cols) const
@Brief maps search columns to an lexicographical order (labeled by a number)
Definition: Index.h:349
souffle::ram::analysis::MinIndexSelection::SearchSet
std::set< SearchSignature, SearchComparator > SearchSet
Definition: Index.h:231
souffle::ram::analysis::MaxMatching::Matchings
std::unordered_map< Node, Node > Matchings
Matching represent a solution of the matching, i.e., which node in the bi-partite graph maps to anoth...
Definition: Index.h:124
souffle::ram::analysis::MinIndexSelection::AttributeSet
std::unordered_set< AttributeIndex > AttributeSet
Definition: Index.h:211
souffle::ram::analysis::AttributeConstraint::None
@ None
souffle::ram::analysis::MinIndexSelection::LexOrder
std::vector< AttributeIndex > LexOrder
Definition: Index.h:216
souffle::ram::analysis::IndexAnalysis::run
void run(const TranslationUnit &translationUnit) override
Run analysis for a RAM translation unit.
Definition: Index.cpp:480
l
var l
Definition: htmlJsChartistMin.h:15
i
size_t i
Definition: json11.h:663
souffle::ram::analysis::MinIndexSelection::removeExtraInequalities
void removeExtraInequalities()
@Brief remove arbitrary extra inequalities
Definition: Index.cpp:426
souffle::ram::analysis::MinIndexSelection::ChainOrderMap
std::list< Chain > ChainOrderMap
Definition: Index.h:221
souffle::ram::analysis::MinIndexSelection::getAllChains
const ChainOrderMap getAllChains() const
@Brief Get all chains
Definition: Index.h:268
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::ram::analysis::MinIndexSelection::getChainsFromMatching
const ChainOrderMap getChainsFromMatching(const MaxMatching::Matchings &match, const SearchSet &nodes)
@Brief get all chains from the matching
Definition: Index.cpp:377
souffle::ram::analysis::MinIndexSelection::indexToSignature
IndexSignatureMap indexToSignature
Definition: Index.h:331
souffle::ram::analysis::MinIndexSelection::card
static size_t card(SearchSignature cols)
@Brief count the number of constraints in key
Definition: Index.h:338
souffle::ram::analysis::MinIndexSelection::dischargedMap
DischargeMap dischargedMap
Definition: Index.h:330
souffle::ram::analysis::MinIndexSelection::chainToOrder
ChainOrderMap chainToOrder
Definition: Index.h:334
k
var k
Definition: htmlJsChartistMin.h:15
souffle::ram::analysis::MinIndexSelection::signatureToIndexB
SignatureIndexMap signatureToIndexB
Definition: Index.h:329
souffle::ram::analysis::MinIndexSelection::signatureToIndexA
SignatureIndexMap signatureToIndexA
Definition: Index.h:328
souffle::ram::analysis::SearchSignature::getFullSearchSignature
static SearchSignature getFullSearchSignature(size_t arity)
Definition: Index.cpp:140
souffle::Global::config
static MainConfig & config()
Definition: Global.h:141
souffle::ram::analysis::AttributeConstraint::Equal
@ Equal
souffle::ram::analysis::MinIndexSelection::getAttributesToDischarge
AttributeSet getAttributesToDischarge(const SearchSignature &s, const Relation &rel)
Return the attribute position for each indexed operation that should be discharged.
Definition: Index.cpp:443
souffle::ram::analysis::SearchSignature::getDelta
static SearchSignature getDelta(const SearchSignature &lhs, const SearchSignature &rhs)
Definition: Index.cpp:126
souffle::fatal
void fatal(const char *format, const Args &... args)
Definition: MiscUtil.h:198
souffle::ram::analysis::MinIndexSelection::getAllOrders
const OrderCollection getAllOrders() const
@Brief Get all indexes
Definition: Index.h:263
souffle::ram::analysis::MaxMatching::addEdge
void addEdge(Node u, Node v)
@Brief add an edge to the bi-partite graph
Definition: Index.cpp:170
souffle::ram::analysis::MinIndexSelection::getSearches
const SearchSet & getSearches() const
@Brief Get searches
Definition: Index.h:247
souffle::ram::analysis::MinIndexSelection::getChain
Chain getChain(const SearchSignature umn, const MaxMatching::Matchings &match)
@Brief get a chain from a matching
Definition: Index.cpp:348
rel
void rel(size_t limit, bool showLimit=true)
Definition: Tui.h:1086