You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql/best-practices-serverless-sql-pool.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,15 +91,18 @@ Serverless SQL pool relies on statistics to generate optimal query execution pla
91
91
92
92
### Use appropriate data types
93
93
94
-
The data types you use in your query affect performance. You can get better performance if you follow these guidelines:
94
+
The data types you use in your query affect performance and concurrency. You can get better performance if you follow these guidelines:
95
95
96
96
- Use the smallest data size that will accommodate the largest possible value.
97
97
- If the maximum character value length is 30 characters, use a character data type of length 30.
98
98
- If all character column values are of fixed size, use **char** or **nchar**. Otherwise, use **varchar** or **nvarchar**.
99
99
- If the maximum integer column value is 500, use **smallint** because it's the smallest data type that can accommodate this value. You can find integer data type ranges in [this article](/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=azure-sqldw-latest&preserve-view=true).
100
100
- If possible, use **varchar** and **char** instead of **nvarchar** and **nchar**.
101
+
- Use **varchar** type with some UTF8 collation if you are reading data from Parquet, CosmosDB, Delta Lake, or CSV with UTF-8 encoding.
102
+
- Use **varchar** type without UTF8 collation if you are reading data from CSV non-Unicode files (for example, ASCII).
103
+
- Use **nvarchar** type if you are reading data from CSV UTF-16 file.
101
104
- Use integer-based data types if possible. SORT, JOIN, and GROUP BY operations complete faster on integers than on character data.
102
-
- If you're using schema inference, [check inferred data types](#check-inferred-data-types).
105
+
- If you're using schema inference, [check inferred data types](#check-inferred-data-types) and override them explicitly with the smaller types if possible.
0 commit comments