MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / computeRelDirectionSchemaStats

Function computeRelDirectionSchemaStats

src/storage/stats/planner_stats.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static PlannerRelDirectionStats computeRelDirectionSchemaStats(RelTable& relTable,
50 const Transaction* transaction, const RelTableCatalogInfo& relInfo,
51 RelDataDirection direction) {
52 auto stats = PlannerRelDirectionStats{};
53 stats.numRows = relTable.getNumTotalRows(transaction);
54 stats.boundKeysUnique = relInfo.getMultiplicity(direction) == RelMultiplicity::ONE;
55 if (stats.boundKeysUnique) {
56 stats.maxDegree = 1;
57 stats.avgDegree = stats.numRows == 0 ? 0 : 1;
58 }
59 return stats;
60}
61
62static void appendIndexStats(PlannerTableStats& plannerStats, const Catalog& catalog,
63 const Transaction* transaction, const TableCatalogEntry& tableEntry, table_id_t tableID) {

Callers 1

buildPlannerTableStatsFunction · 0.85

Calls 2

getNumTotalRowsMethod · 0.45
getMultiplicityMethod · 0.45

Tested by

no test coverage detected