core/schema: Optimize get_dependent_materialized_views() when no views

Eliminates get_dependent_materialized_views() overhead when there are no
views. Note that we need to optimize the case when there are views as
well because this ends up being pretty hot in write-intensive workloads.
This commit is contained in:
Pekka Enberg
2025-09-12 07:21:16 +03:00
parent f9f7a44955
commit d80814fa2c

View File

@@ -178,6 +178,9 @@ impl Schema {
/// Get all materialized views that depend on a given table
pub fn get_dependent_materialized_views(&self, table_name: &str) -> Vec<String> {
if self.table_to_materialized_views.is_empty() {
return Vec::new();
}
let table_name = normalize_ident(table_name);
self.table_to_materialized_views
.get(&table_name)