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
CLUSTERED COLUMNSTORE INDEX --default for SQL Data Warehouse
57
+
| CLUSTERED COLUMNSTORE INDEX ORDER (column[,...n])
56
58
| HEAP --default for Parallel Data Warehouse
57
59
| CLUSTERED INDEX ( { index_column_name [ ASC | DESC ] } [ ,...n ] ) --default is ASC
58
60
}
59
-
| PARTITION ( partition_column_name RANGE [ LEFT | RIGHT ] --default is LEFT
61
+
| PARTITION ( partition_column_name RANGE [ LEFT | RIGHT ] --default is LEFT
60
62
FOR VALUES ( [ boundary_value [,...n] ] ) )
61
63
62
64
<select_statement> ::=
63
65
[ WITH <common_table_expression> [ ,...n ] ]
64
66
SELECT select_criteria
65
67
68
+
<query_hint> ::=
69
+
{
70
+
MAXDOP
71
+
}
66
72
```
67
73
68
74
<aname="arguments-bk"></a>
@@ -96,15 +102,19 @@ For details, see the [Table partition options](https://msdn.microsoft.com/librar
96
102
97
103
<aname="select-options-bk"></a>
98
104
99
-
### Select options
105
+
### Select statement
100
106
The select statement is the fundamental difference between CTAS and CREATE TABLE.
101
107
102
108
`WITH`*common_table_expression*
103
109
Specifies a temporary named result set, known as a common table expression (CTE). For more information, see [WITH common_table_expression (Transact-SQL)](../../t-sql/queries/with-common-table-expression-transact-sql.md).
104
110
105
111
`SELECT`*select_criteria*
106
112
Populates the new table with the results from a SELECT statement. *select_criteria* is the body of the SELECT statement that determines which data to copy to the new table. For information about SELECT statements, see [SELECT (Transact-SQL)](../../t-sql/queries/select-transact-sql.md).
107
-
113
+
114
+
### Query hint
115
+
Users can set MAXDOP to an integer value to control the maximum degree of parallelism. When MAXDOP is set to 1, the query is executed by a single thread.
You can see therefore that type consistency and maintaining nullability properties on a CTAS is a good engineering best practice. It helps to maintain integrity in your calculations and also ensures that partition switching is possible.
827
+
828
+
### N. Create an ordered clustered columnstore index with MAXDOP 1
829
+
```sql
830
+
CREATETABLETable1 WITH (DISTRIBUTION = HASH(c1), CLUSTERED COLUMNSTORE INDEX ORDER(c1) )
831
+
ASSELECT*FROM ExampleTable
832
+
OPTION (MAXDOP 1);
833
+
```
834
+
817
835
818
836
## See Also
819
837
[CREATE EXTERNAL DATA SOURCE (Transact-SQL)](../../t-sql/statements/create-external-data-source-transact-sql.md)
0 commit comments