> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_materialized_view

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_materialized_view.rs#L30-L39)
pub async fn [create\_materialized\_view](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-materialized-view.md#method.create_materialized_view)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateMaterializedViewResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Begin the creation a materialized viewInitiates the process of creating a materialized view, reserving the view’s name to prevent other views or tables from being created with that name.For materialized view details and examples, see Materialized Views.The response contains `view_id`, which is used to tag each subsequent operation (projection, union, aggregation, filter, or join) that will compose the view.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to be created that is the top-level table of the materialized view, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_materialized_view.rs#L61-L77)
pub async fn [create\_materialized\_view\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-materialized-view.md#method.create_materialized_view_with_opts)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateMaterializedViewRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateMaterializedViewResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Begin the creation a materialized viewInitiates the process of creating a materialized view, reserving the view’s name to prevent other views or tables from being created with that name.For materialized view details and examples, see Materialized Views.The response contains `view_id`, which is used to tag each subsequent operation (projection, union, aggregation, filter, or join) that will compose the view.

##### Arguments

<ul>
  <li>`table_name` - Name of the table to be created that is the top-level table of the materialized view, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_materialized_view.rs#L80-L91)
pub async fn [create\_materialized\_view\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-materialized-view.md#method.create_materialized_view_raw)( \&self, request: &[CreateMaterializedViewRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateMaterializedViewResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateMaterializedViewRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewRequest) to the `/create/materializedview` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_materialized_view.rs#L95-L107)
pub async fn [create\_materialized\_view\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-materialized-view.md#method.create_materialized_view_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateMaterializedViewRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateMaterializedViewResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateMaterializedViewRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateMaterializedViewRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.