SnowConvert AI - General Performance Review Messages¶
SSC-PRF-0001¶
This statement has usages of cursor fetch bulk operations
Description¶
This warning indicates that the statement uses cursor fetch bulk operations. These operations allow you to retrieve multiple rows of data from a cursor at once, instead of one row at a time. Using bulk operations improves performance by reducing the number of communications needed between the client and server.
This pattern can become complex if not implemented correctly. For example, retrieving too many rows in a single fetch operation can consume excessive memory. It’s crucial to maintain a balance between the number of rows fetched and the available memory resources.
Code Example¶
Oracle¶
Input¶
Output¶
Best Practices¶
For additional support, please contact us at snowconvert-support@snowflake.com
SSC-PRF-0002¶
Case insensitive columns can decrease performance of queries
Description¶
Using collation in Snowflake can impact query performance, particularly in WHERE clauses. To learn more about how collation affects performance, please refer to the Performance Implications of Using Collation.
A warning has been generated to indicate that a column was created with case-insensitive collation. Using this column in queries may cause slower performance.
Code examples¶
Output¶
Oracle¶
Input¶
Output¶
Microsoft SQL Server¶
Input¶
Output¶
Best Practices¶
If your application’s performance is significantly affected by case-insensitive collation, consider rewriting your code to avoid using it. However, if the performance impact is acceptable, you can ignore this warning.
For additional assistance, contact us at snowconvert-support@snowflake.com
SSC-PRF-0003¶
Fetch inside a loop is considered a complex pattern, this could degrade Snowflake performance
Severity¶
Low
Description¶
This warning appears when a FETCH statement is detected within a loop. The FETCH statement retrieves and processes individual rows from a result set one at a time.
Processing large datasets using cursors within loops can become complex, especially when:
Multiple table joins are involved
Complex calculations are required
Large numbers of rows need to be processed
This pattern may lead to performance issues and can be difficult to maintain as the data volume grows.
Code Example¶
Teradata¶
Input¶
Output¶
Oracle¶
Input¶
Output¶
SQL Server¶
Input¶
Output¶
Best Practices¶
To improve performance and avoid complex patterns, use set-based operations instead of loops. Replace row-by-row processing with SQL statements (SELECT, UPDATE, DELETE) that operate on multiple rows simultaneously using WHERE clauses. This approach is more efficient and easier to maintain.
Oracle¶
Snowflake¶
Set-based operations can be used to process data more efficiently.
Set-based operations can be used to process data more efficiently.
Best Practices¶
For additional support, please contact us at snowconvert-support@snowflake.com
SSC-PRF-0004¶
This statement has usages of cursor for loop
Severity¶
None
Description¶
This warning indicates that the statement contains cursor for loops. A cursor for loop is a programming structure that processes query results one row at a time, allowing you to work with individual records from a result set.
This warning helps identify potential performance issues in cursor FOR loops. Performance problems may arise when:
The SELECT statement within the cursor returns a large dataset
The loop contains complex operations
The loop contains nested loops
While SnowConvert AI can detect these patterns, you should review and optimize the code to ensure efficient execution.
Code Example¶
Teradata¶
Input¶
Output¶
Oracle¶
Input¶
Output¶
Best Practices¶
For additional support, please contact us at snowconvert-support@snowflake.com
SSC-PRF-0005¶
The statement below has usages of nested cursors
Note
For better readability, we have simplified some sections of the code in this example.
Severity¶
None
Description¶
This warning indicates that the statement contains nested cursors. A cursor is a database feature that lets you process rows from a query result one at a time. Nested cursors occur when you use one cursor inside another cursor’s loop, which can impact performance and should be used with caution.
Nested cursors can significantly slow down your code’s performance, particularly when working with large amounts of data. This is because each time a cursor operates, it needs to communicate with the database server, creating additional processing overhead and delays.
Code examples¶
SQL Server¶
Input¶
Output¶
Oracle¶
Explicit cursor¶
Input¶
Output¶
Implicit Cursor¶
Input¶
Output¶
Best Practices¶
Nested cursors should be avoided as they can negatively impact performance and make code more complex.
Instead of nested cursors, use SQL features such as:
SQL functions
Joins
Subqueries
Window functions
Common Table Expressions (CTEs)
Recursive queries These alternatives process data in bulk and are more efficient.
For additional assistance, contact us at snowconvert-support@snowflake.com
SSC-PRF-0006¶
Nested cursor inside query is not supported in Snowflake
Severity¶
None
Description¶
This message appears when a query contains a cursor definition. When a cursor expression is evaluated, it returns and automatically opens a nested cursor. For more details, see Oracle Cursor Expression.
Code examples¶
Input¶
Output¶
Best Practices¶
We recommend avoiding cursors as they can negatively affect performance and make code more complex.
Instead of using nested cursors, consider these alternatives:
SQL functions
Joins
Subqueries
Window functions
Common Table Expressions (CTEs)
Recursive queries These options are better for processing large amounts of data efficiently.
For additional assistance, contact us at snowconvert-support@snowflake.com
SSC-PRF-0007¶
PERFORMANCE REVIEW - CLUSTER BY
Description¶
Marks where the usage of CLUSTER BY may cause performance issues.
Example Code¶
Teradata:¶
Snowflake:¶
Transact:¶
Snowflake:¶
Best Practices¶
Review the code in order to identify possible performance issues. More information about this topic can be read here.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-PRF-0008¶
Description¶
This message appears when SnowConvert AI detects loop usage in procedural code. Loops such as LOOP, WHILE, and FOR can lead to row-by-row processing and may degrade performance in Snowflake, especially when the loop iterates over large datasets or contains complex logic. The message is informational and prompts a review of the pattern.
Code Example¶
PostgreSQL:¶
Snowflake:¶
Best practices¶
Prefer set-based SQL operations (SELECT, INSERT, UPDATE, DELETE) over row-by-row loops.
Avoid nested loops when possible; use joins, CTEs, or window functions instead.
If loops are required, keep iterations small and limit expensive operations inside the loop.
Consider refactoring procedural logic into single statements or bulk operations.
SSC-PRF-0009¶
CURSOR usage review
Severity¶
None
Description¶
This message appears when SnowConvert AI detects a cursor declaration in procedural code. Cursors allow row-by-row processing of query results, which can lead to performance issues in Snowflake, especially when processing large datasets.
While cursors are valid in Snowflake Scripting, they introduce overhead because:
Each row is processed individually rather than as a set
Multiple round trips to the database may be required
Memory usage can be higher compared to set-based operations
This warning is informational and prompts a review of whether the cursor usage is necessary or can be replaced with more efficient set-based operations.
Code Example¶
Oracle¶
Input¶
Output¶
Best Practices¶
Replace cursor-based row-by-row processing with set-based SQL operations (SELECT, INSERT, UPDATE, DELETE) whenever possible.
Use JOINs, subqueries, CTEs (Common Table Expressions), or window functions instead of cursors to process multiple rows efficiently.
If cursors are unavoidable, minimize the work done inside the cursor loop and avoid nested cursors.
Consider using MERGE statements for upsert operations instead of cursor-based conditional INSERT/UPDATE logic.
For additional assistance, contact us at snowconvert-support@snowflake.com
SSC-PRF-0010¶
Partition by removed, at least one of the specified expressions have no iceberg partition transform equivalent
Severity¶
None
Description¶
Snowflake supports the PARTITION BY clause in Iceberg tables, however, only Iceberg partition transforms are supported. When transforming paritioning into Iceberg tables, SnowConvert AI will generate the equivalent partition transforms for supported cases. When no partition transform equivalent can be generated for the partition expressions, the PARTITION BY will be removed from the table by commenting it out with this PRF.
This PRF is only generated when SnowConvert AI migrates tables into Iceberg tables using the Tables translation conversion setting.
Code examples¶
Input¶
Output¶
Best Practices¶
Analyze the impact of partitioning in the performance of queries over the generated Iceberg tables, if the difference is neglible then this PRF can be safely ignored.
For additional assistance, contact us at snowconvert-support@snowflake.com