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
|`serverless_acct_id`| The account ID of the serverless cluster | string | N |
34
34
|`serverless_work_group`| The name of work group for serverless end point | string | N |
35
35
|`enable_merge`| Whether the incremental_by_unique_key model kind will use the native Redshift MERGE operation or SQLMesh's logical merge. (Default: `False`) | bool | N |
36
+
37
+
## Performance Considerations
38
+
39
+
### Timestamp Macro Variables and Sort Keys
40
+
41
+
When working with Redshift tables that have a `TIMESTAMP` sort key, using the standard `@start_dt` and `@end_dt` macro variables may lead to performance issues. These macros render as `TIMESTAMP WITH TIME ZONE` values in SQL queries, which prevents Redshift from performing efficient pruning when filtering against `TIMESTAMP` (without timezone) sort keys.
42
+
43
+
This can result in full table scans instead, causing significant performance degradation.
44
+
45
+
**Solution**: Use the `_dtntz` (datetime no timezone) variants of macro variables:
46
+
47
+
-`@start_dtntz` instead of `@start_dt`
48
+
-`@end_dtntz` instead of `@end_dt`
49
+
50
+
These variants render as `TIMESTAMP WITHOUT TIME ZONE`, allowing Redshift to properly utilize sort key optimizations.
0 commit comments