MSCINF0001

Views selecting all columns from a single table are not required in Snowflake

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

None

Description

Views that only select all columns of a single table and do not have any filtering clauses are not required in Snowflake and may affect performance.

Code Example

Input Code:

CREATE OR REPLACE VIEW simpleView1
AS
SELECT
*
FROM
simpleTable;

CREATE OR REPLACE VIEW simpleView2
AS
SELECT
*
FROM
simpleTable GROUP BY col1;

Output Code:

CREATE OR REPLACE VIEW simpleView1
AS
--** MSC-INFORMATION - MSCINF0001 - VIEWS SELECTING ALL COLUMNS FROM A SINGLE TABLE ARE NOT REQUIRED IN SNOWFLAKE AND MAY IMPACT PERFORMANCE. **
SELECT
*
FROM
simpleTable;

CREATE OR REPLACE VIEW simpleView2
AS
--** MSC-INFORMATION - MSCINF0001 - VIEWS SELECTING ALL COLUMNS FROM A SINGLE TABLE ARE NOT REQUIRED IN SNOWFLAKE AND MAY IMPACT PERFORMANCE. **
SELECT
*
FROM
simpleTable GROUP BY col;

Recommendations

Last updated