MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / default_key

Method default_key

src/repr/src/relation.rs:333–343  ·  view source on GitHub ↗

Gets the index of the columns used when creating a default index.

(&self)

Source from the content-addressed store, hash-verified

331
332 /// Gets the index of the columns used when creating a default index.
333 pub fn default_key(&self) -> Vec<usize> {
334 if let Some(key) = self.keys.first() {
335 if key.is_empty() {
336 (0..self.column_types.len()).collect()
337 } else {
338 key.clone()
339 }
340 } else {
341 (0..self.column_types.len()).collect()
342 }
343 }
344
345 /// Returns all the [`SqlColumnType`]s, in order, for this relation.
346 pub fn columns(&self) -> &[SqlColumnType] {

Callers 3

plan_create_indexFunction · 0.80
optimizeMethod · 0.80
newMethod · 0.80

Calls 5

firstMethod · 0.45
is_emptyMethod · 0.45
collectMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected