From e920dad55b86c09bc41a385755482ebc91f06806 Mon Sep 17 00:00:00 2001 From: Brendan Clement Date: Fri, 9 Oct 2026 13:42:32 -0700 Subject: [PATCH] docs: correct view listing cost and say what an expression may use Two pages said list_materialized_views reads every table's schema and that SHOW MATERIALIZED VIEWS is cheaper. That is the local implementation; on a db:// connection the SDK asks the deployment for its views, as SHOW MATERIALIZED VIEWS does. The computed-column page now says that a literal must fit the column it meets, and that a deployment's refresh can fail on an expression reading a struct field, which the embedded library computes, so an expression for a deployment should use top-level columns. --- docs/web/feature-engineering/add-computed-column.mdx | 10 ++++++++++ docs/web/feature-engineering/materialized-views.mdx | 7 ++++--- docs/web/sql/ddl/materialized-view.mdx | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/web/feature-engineering/add-computed-column.mdx b/docs/web/feature-engineering/add-computed-column.mdx index 1b57d7839..43fa93a79 100644 --- a/docs/web/feature-engineering/add-computed-column.mdx +++ b/docs/web/feature-engineering/add-computed-column.mdx @@ -69,6 +69,16 @@ declared earlier in the same mapping, but not one declared after it. The functions available are the ones the [SQL dialect](/sql/functions) documents. +A literal in the expression has to fit the column it meets: `x / 2.0` is +refused when `x` is an integer column, so write `cast(x as double) / 2.0`. + + +On a deployment, keep the expression to top-level columns. A deployment's +refresh can fail on an expression that reads a field inside a struct, such as +`stats.magic + stats.strength`, which the embedded library computes. Try a new +expression on a small table first. + + ## Its inputs become load-bearing {#input-constraints} diff --git a/docs/web/feature-engineering/materialized-views.mdx b/docs/web/feature-engineering/materialized-views.mdx index 3e8019c5f..a6e53ea91 100644 --- a/docs/web/feature-engineering/materialized-views.mdx +++ b/docs/web/feature-engineering/materialized-views.mdx @@ -110,9 +110,10 @@ when a view is created through its REST API, which recent versions no longer have. Check with the deployment's administrator which version it runs before relying on a source. -`SHOW MATERIALIZED VIEWS` lists them, which is cheaper than -`list_materialized_views` -- that method finds views by reading every table's -schema, so it costs one open per table. +`list_materialized_views` asks the deployment for its views, as +[`SHOW MATERIALIZED VIEWS`](/sql/ddl/materialized-view#show) does. On a local +database the same method opens each table to read its schema, so it costs one +open per table. ## Working with the view {#working-with-the-view} diff --git a/docs/web/sql/ddl/materialized-view.mdx b/docs/web/sql/ddl/materialized-view.mdx index 51b5ef55b..f3482854f 100644 --- a/docs/web/sql/ddl/materialized-view.mdx +++ b/docs/web/sql/ddl/materialized-view.mdx @@ -36,8 +36,8 @@ SHOW MATERIALIZED VIEWS ``` -Cheaper than the SDK equivalent. `list_materialized_views` finds views by -reading every table's schema, costing one open per table; this asks the server. +This asks the server for its views, as the SDK's `list_materialized_views` does +on a `db://` connection. ## Refreshing one {#refresh}