<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – CREATE PROJECTION</title>
    <link>/en/sql-reference/statements/create-statements/create-projection/</link>
    <description>Recent content in CREATE PROJECTION on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/statements/create-statements/create-projection/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: Encoding types</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/encoding-types/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/encoding-types/</guid>
      <description>
        
        
        &lt;p&gt;OpenText™ Analytics Database supports various encoding and compression types, specified by the following &lt;code&gt;ENCODING&lt;/code&gt; parameter arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#ENCODING&#34;&gt;AUTO (default)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#ENCODING2&#34;&gt;BLOCK_DICT&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#ENCODING3&#34;&gt;BLOCKDICT_COMP&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#BZIP_COM&#34;&gt;BZIP_COMP&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#COMMONDE&#34;&gt;COMMONDELTA_COMP&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#DELTARAN&#34;&gt;DELTARANGE_COMP&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#DELTAVAL&#34;&gt;DELTAVAL&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#GCDDELTA&#34;&gt;GCDDELTA&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#GZIP_COM&#34;&gt;GZIP_COMP&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#RLE&#34;&gt;RLE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#Zstandar&#34;&gt;Zstandard Compression&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;OpenText™ Analytics Database supports the following encoding for &lt;a href=&#34;../../../../../en/sql-reference/data-types/numeric-data-types/&#34;&gt;numeric data types&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Precision ≤ 18: &lt;code&gt;AUTO&lt;/code&gt;, &lt;code&gt;BLOCK_DICT&lt;/code&gt;, &lt;code&gt;BLOCKDICT_COMP&lt;/code&gt;, &lt;code&gt;COMMONDELTA_COMP&lt;/code&gt;, &lt;code&gt;DELTAVAL&lt;/code&gt;, &lt;code&gt;GCDDELTA&lt;/code&gt;, and &lt;code&gt;RLE&lt;/code&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Precision &amp;gt; 18: &lt;code&gt;AUTO&lt;/code&gt;, &lt;code&gt;BLOCK_DICT&lt;/code&gt;, &lt;code&gt;BLOCKDICT_COMP&lt;/code&gt;, &lt;code&gt;RLE&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;
&lt;p&gt;You can set encoding types on a projection column when you &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/&#34;&gt;create the projection&lt;/a&gt;. You can also change the encoding of one or more projection columns for a given table with &lt;a href=&#34;../../../../../en/sql-reference/statements/alter-statements/alter-table/&#34;&gt;ALTER TABLE...ALTER COLUMN&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;ENCODING&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;auto-default&#34;&gt;AUTO (default)&lt;/h2&gt;
&lt;p&gt;AUTO encoding is ideal for sorted, many-valued columns such as primary keys. It is also suitable for general purpose applications for which no other encoding or compression scheme is applicable. Therefore, it serves as the default if no encoding/compression is specified.

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;th &gt;
Column data type&lt;/th&gt; 

&lt;th &gt;
Default encoding type&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
BINARY/VARBINARY&lt;br /&gt;BOOLEAN&lt;br /&gt;CHAR/VARCHAR&lt;br /&gt;FLOAT&lt;/td&gt; 

&lt;td &gt;
Lempel-Ziv-Oberhumer-based (LZO) compression&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
DATE/TIME/TIMESTAMP&lt;br /&gt;INTEGER&lt;br /&gt;INTERVAL&lt;/td&gt; 

&lt;td &gt;
Compression scheme based on the delta between consecutive column values.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;The CPU requirements for this type are relatively small. In the worst case, data might expand by eight percent (8%) for LZO and twenty percent (20%) for integer data.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;ENCODING2&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;block_dict&#34;&gt;BLOCK_DICT&lt;/h2&gt;
&lt;p&gt;For each block of storage, the database compiles distinct column values into a dictionary and then stores the dictionary and a list of indexes to represent the data block.&lt;/p&gt;
&lt;p&gt;BLOCK_DICT is ideal for few-valued, unsorted columns where saving space is more important than encoding speed. Certain kinds of data, such as stock prices, are typically few-valued within a localized area after the data is sorted, such as by stock symbol and timestamp, and are good candidates for BLOCK_DICT. By contrast, long CHAR/VARCHAR columns are not good candidates for BLOCK_DICT encoding.&lt;/p&gt;
&lt;p&gt;CHAR and VARCHAR columns that contain 0x00 or 0xFF characters should not be encoded with BLOCK_DICT. Also, BINARY/VARBINARY columns do not support BLOCK_DICT encoding.&lt;/p&gt;
&lt;p&gt;BLOCK_DICT encoding requires significantly higher CPU usage than default encoding schemes. The maximum data expansion is eight percent (8%).&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;ENCODING3&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;blockdict_comp&#34;&gt;BLOCKDICT_COMP&lt;/h2&gt;
&lt;p&gt;This encoding type is similar to BLOCK_DICT except dictionary indexes are entropy coded. This encoding type requires significantly more CPU time to encode and decode and has a poorer worst-case performance. However, if the distribution of values is extremely skewed, using &lt;code&gt;BLOCK_DICT_COMP&lt;/code&gt; encoding can lead to space savings.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;BZIP_COM&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;bzip_comp&#34;&gt;BZIP_COMP&lt;/h2&gt;
&lt;p&gt;BZIP_COMP encoding uses the bzip2 compression algorithm on the block contents. See &lt;a href=&#34;http://www.bzip.org/&#34;&gt;bzip&lt;/a&gt; web site for more information. This algorithm results in higher compression than the automatic LZO and gzip encoding; however, it requires more CPU time to compress. This algorithm is best used on large string columns such as VARCHAR, VARBINARY, CHAR, and BINARY. Choose this encoding type when you are willing to trade slower load speeds for higher data compression.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;COMMONDE&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;commondelta_comp&#34;&gt;COMMONDELTA_COMP&lt;/h2&gt;
&lt;p&gt;This compression scheme builds a dictionary of all deltas in the block and then stores indexes into the delta dictionary using entropy coding.&lt;/p&gt;
&lt;p&gt;This scheme is ideal for sorted FLOAT and INTEGER-based (DATE/TIME/TIMESTAMP/INTERVAL) data columns with predictable sequences and only occasional sequence breaks, such as timestamps recorded at periodic intervals or primary keys. For example, the following sequence compresses well: 300, 600, 900, 1200, 1500, 600, 1200, 1800, 2400. The following sequence does not compress well: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55.&lt;/p&gt;
&lt;p&gt;If delta distribution is excellent, columns can be stored in less than one bit per row. However, this scheme is very CPU intensive. If you use this scheme on data with arbitrary deltas, it can cause significant data expansion.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;DELTARAN&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;deltarange_comp&#34;&gt;DELTARANGE_COMP&lt;/h2&gt;
&lt;p&gt;This compression scheme is primarily used for floating-point data; it stores each value as a delta from the previous one.&lt;/p&gt;
&lt;p&gt;This scheme is ideal for many-valued FLOAT columns that are sorted or confined to a range. Do not use this scheme for unsorted columns that contain NULL values, as the storage cost for representing a NULL value is high. This scheme has a high cost for both compression and decompression.&lt;/p&gt;
&lt;p&gt;To determine if DELTARANGE_COMP is suitable for a particular set of data, compare it to other schemes. Be sure to use the same sort order as the projection, and select sample data that will be stored consecutively in the database.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;DELTAVAL&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;deltaval&#34;&gt;DELTAVAL&lt;/h2&gt;
&lt;p&gt;For INTEGER and DATE/TIME/TIMESTAMP/INTERVAL columns, data is recorded as a difference from the smallest value in the data block. This encoding has no effect on other data types.&lt;/p&gt;
&lt;p&gt;DELTAVAL is best used for many-valued, unsorted integer or integer-based columns. CPU requirements for this encoding type are minimal, and data never expands.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;GCDDELTA&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;gcddelta&#34;&gt;GCDDELTA&lt;/h2&gt;
&lt;p&gt;For INTEGER and DATE/TIME/TIMESTAMP/INTERVAL columns, and NUMERIC columns with 18 or fewer digits, data is recorded as the difference from the smallest value in the data block divided by the greatest common divisor (GCD) of all entries in the block. This encoding has no effect on other data types.&lt;/p&gt;
&lt;p&gt;ENCODING GCDDELTA is best used for many-valued, unsorted, integer columns or integer-based columns, when the values are a multiple of a common factor. For example, timestamps are stored internally in microseconds, so data that is only precise to the millisecond are all multiples of 1000. The CPU requirements for decoding GCDDELTA encoding are minimal, and the data never expands, but GCDDELTA may take more encoding time than DELTAVAL.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;GZIP_COM&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;gzip_comp&#34;&gt;GZIP_COMP&lt;/h2&gt;
&lt;p&gt;This encoding type uses the gzip compression algorithm. See &lt;a href=&#34;http://www.gzip.org/&#34;&gt;gzip&lt;/a&gt; web site for more information. This algorithm results in better compression than the automatic LZO compression, but lower compression than BZIP_COMP. It requires more CPU time to compress than LZO but less CPU time than BZIP_COMP. This algorithm is best used on large string columns such as VARCHAR, VARBINARY, CHAR, and BINARY. Use this encoding when you want a better compression than LZO, but at less CPU time than bzip2.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;RLE&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;rle&#34;&gt;RLE&lt;/h2&gt;
&lt;p&gt;RLE (run length encoding) replaces sequences (runs) of identical values with a single pair that contains the value and number of occurrences. Therefore, it is best used for low cardinality columns that are present in the ORDER BY clause of a projection.&lt;/p&gt;
&lt;p&gt;The database execution engine processes RLE encoding run-by-run and the database optimizer gives it preference. Use it only when the run length is large, such as when low-cardinality columns are sorted.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;Zstandar&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;zstandard-compression&#34;&gt;Zstandard compression&lt;/h2&gt;
&lt;p&gt;The database supports three &lt;a href=&#34;https://facebook.github.io/zstd/&#34;&gt;ZSTD&lt;/a&gt; compression types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ZSTD_COMP&lt;/code&gt; provides high compression ratios. This encoding type has a higher compression than gzip. Use this when you want a better compression than gzip. For general use cases, use this or the &lt;code&gt;ZSTD_FAST_COMP&lt;/code&gt; encoding type.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ZSTD_FAST_COMP&lt;/code&gt; uses the fastest compression level that the zstd library provides. It is the fastest encoding type of the zstd library, but takes up more space than the other two encoding types. For general use cases, use this or the &lt;code&gt;ZSTD_COMP&lt;/code&gt; encoding type.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ZSTD_HIGH_COMP&lt;/code&gt; offers the best compression in the zstd library. It is slower than the other two encoding types. Use this type when you need the best compression, with slower CPU time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GROUPED clause</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/grouped-clause/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/grouped-clause/</guid>
      <description>
        
        
        &lt;p&gt;Enterprise Mode only&lt;/p&gt;

&lt;p&gt;Groups two or more columns into a single disk file. Doing so minimizes file I/O for the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Read a large percentage of the columns in a table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Perform single row look-ups.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Query against many small columns.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Frequently update data in these columns.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can improve query performance by grouping columns that are always accessed together and are not used in predicates. Once columns are grouped, queries can no longer retrieve from disk records for one column independently of the others.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

RLE encoding is reduced when an RLE column is grouped with one or more non-RLE columns.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You can group columns in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Group some of the columns:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(a, GROUPED(b, c), d)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Group all of the columns:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(GROUPED(a, b, c, d))
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create multiple groupings in the same projection:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(GROUPED(a, b), GROUPED(c, d))
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

OpenText™ Analytics Database performs dynamic column grouping. For example, to provide better read and write efficiency for small loads, the database ignores any projection-defined column grouping (or lack thereof) and groups all columns together by default.

&lt;/div&gt;
&lt;h2 id=&#34;grouping-columns&#34;&gt;Grouping columns&lt;/h2&gt;
&lt;p&gt;The following example shows how to group columns &lt;code&gt;bid&lt;/code&gt; and &lt;code&gt;ask&lt;/code&gt;. The &lt;code&gt;stock&lt;/code&gt; column is stored separately.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE trades (stock CHAR(5), bid INT, ask INT);
=&amp;gt; CREATE PROJECTION tradeproj (stock ENCODING RLE,
   GROUPED(bid ENCODING DELTAVAL, ask))
   AS (SELECT * FROM trades) KSAFE 1;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example show how to create a projection that uses expressions in the column definition. The projection contains two integer columns &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;, and a third column &lt;code&gt;product_value&lt;/code&gt; that stores the product of &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE values (a INT, b INT);
=&amp;gt; CREATE PROJECTION product (a, b, product_value) AS
   SELECT a, b, a*b FROM values ORDER BY a KSAFE;
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Hash segmentation clause</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/hash-segmentation-clause/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/hash-segmentation-clause/</guid>
      <description>
        
        
        &lt;p&gt;Specifies how to segment projection data for distribution across all cluster nodes. You can specify segmentation for a table and a projection. If a table definition specifies segmentation, OpenText™ Analytics Database uses it for that table&#39;s &lt;a href=&#34;../../../../../en/admin/projections/auto-projections/&#34;&gt;auto-projections&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is recommended that you use the database&#39;s built-in 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/mathematical-functions/hash/#&#34;&gt;HASH&lt;/a&gt;&lt;/code&gt; function, which distributes data evenly across the cluster and facilitates optimal query execution.&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SEGMENTED BY &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; ALL NODES [ OFFSET &lt;span class=&#34;code-variable&#34;&gt;offset&lt;/span&gt; ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;SEGMENTED BY &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A general SQL expression. Hash segmentation is the preferred method of segmentation. OpenText recommends using its built-in 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/mathematical-functions/hash/#&#34;&gt;HASH&lt;/a&gt;&lt;/code&gt; function, whose arguments resolve to table columns. If you use an expression other than &lt;code&gt;HASH&lt;/code&gt;, OpenText™ Analytics Database issues a warning.
&lt;p&gt;The segmentation expression should specify columns with a large number of unique data values and acceptable skew in their data distribution. In general, primary key columns that meet these criteria are good candidates for hash segmentation.&lt;/p&gt;
&lt;p&gt;For details, see &lt;a href=&#34;#Expressi&#34;&gt;Expression Requirements&lt;/a&gt; below.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ALL NODES&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Automatically distributes data evenly across all nodes when the projection is created. Node ordering is fixed.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;OFFSET &lt;/code&gt;&lt;em&gt;&lt;code&gt;offset&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A zero-based offset that indicates on which node to start segmentation distribution.
&lt;p&gt;This option is not valid for 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/#&#34;&gt;CREATE TABLE&lt;/a&gt;&lt;/code&gt; and 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-temporary-table/#&#34;&gt;CREATE TEMPORARY TABLE&lt;/a&gt;&lt;/code&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;If you create a projection for a table with the &lt;code&gt;OFFSET&lt;/code&gt; option, be sure to create enough copies of each projection segment to satisfy system K-safety; otherwise, the database regards the projection as unsafe and cannot use it to query the table.&lt;/p&gt;
&lt;p&gt;You can ensure K-safety compliance when you create projections by combining &lt;code&gt;OFFSET&lt;/code&gt; and
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/#CreateProjKsafe&#34;&gt;KSAFE&lt;/a&gt;&lt;/code&gt; options in the &lt;code&gt;CREATE PROJECTION&lt;/code&gt; statement. On executing this statement, the database automatically creates the necessary number of projection copies.&lt;/p&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;&lt;a name=&#34;Expressi&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;expression-requirements&#34;&gt;Expression requirements&lt;/h2&gt;
&lt;p&gt;A segmentation expression must specify table columns as they are defined in the source table. Projection column names are not supported.&lt;/p&gt;
&lt;p&gt;The following restrictions apply to segmentation expressions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;All leaf expressions must be constants or &lt;a href=&#34;../../../../../en/sql-reference/language-elements/expressions/column-references/&#34;&gt;column references&lt;/a&gt; to a column in the &lt;code&gt;CREATE PROJECTION&lt;/code&gt; &#39;s &lt;code&gt;SELECT&lt;/code&gt; list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The expression must return the same value over the life of the database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Aggregate functions are not allowed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The expression must return non-negative &lt;code&gt;INTEGER&lt;/code&gt; values in the range 
&lt;code&gt;0 &lt;= x &lt; 2&lt;sup&gt;63&lt;/sup&gt;&lt;/code&gt;, and values are generally distributed uniformly over that range.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the expression produces a value outside the expected range—for example, a negative value—no error occurs, and the row is added to the projection&#39;s first segment.

&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following &lt;code&gt;CREATE PROJECTION&lt;/code&gt; statement creates projection &lt;code&gt;public.employee_dimension_super&lt;/code&gt;. It specifies to include all columns in table &lt;code&gt;public.employee_dimension&lt;/code&gt;. The hash segmentation clause invokes the Vertica &lt;code&gt;HASH&lt;/code&gt; function to segment projection data on the column &lt;code&gt;employee_key&lt;/code&gt;; it also includes the &lt;code&gt;ALL NODES&lt;/code&gt; clause, which specifies to distribute projection data evenly across all nodes in the cluster:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE PROJECTION public.employee_dimension_super
    AS SELECT * FROM public.employee_dimension
    ORDER BY employee_key
    SEGMENTED BY hash(employee_key) ALL NODES;
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Live aggregate projection</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/live-aggregate-projection/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/live-aggregate-projection/</guid>
      <description>
        
        
        &lt;p&gt;Stores the grouped results of queries that invoke aggregate functions (such as SUM) on table columns. For details, see &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/live-aggregate-projections/#&#34;&gt;Live aggregate projections&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database does not regard live aggregate projections as &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/superprojection/&#34; title=&#34;A projection that includes all columns in an anchor table.&#34;&gt;superprojections&lt;/a&gt;, even those that include all table columns. For other requirements and restrictions, see &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/live-aggregate-projections/creating-live-aggregate-projections/#&#34;&gt;Creating live aggregate projections&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE PROJECTION [ IF NOT EXISTS ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;projection&lt;/span&gt;
[ (
   { &lt;span class=&#34;code-variable&#34;&gt;projection-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;grouped-clause&lt;/a&gt;&lt;/span&gt;
   [ ENCODING &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/#&#34;&gt;encoding-type&lt;/a&gt;&lt;/span&gt; ]
   [ ACCESSRANK &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ] }[,...]
) ]
AS SELECT { &lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; }[,...] FROM [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;]
   GROUP BY &lt;span class=&#34;code-variable&#34;&gt;column-expr&lt;/span&gt;[,...]
   [ KSAFE [ &lt;span class=&#34;code-variable&#34;&gt;k-num&lt;/span&gt; ] ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;IF NOT EXISTS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If an object with the same name exists, return without creating the object. If you do not use this directive and the object already exists, the database returns with an error message.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;IF NOT EXISTS&lt;/code&gt; clause is useful for SQL scripts where you might not know if the object already exists. The &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/variables/on-error-stop/&#34;&gt;ON ERROR STOP&lt;/a&gt; directive can be helpful in scripts.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;&lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;Schema&lt;/a&gt; for this projection and its anchor table. The value must be the same for both. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Name of the projection to create, which must conform to &lt;a href=&#34;../../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection-column&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The name of a projection column. The list of projection columns must match the SELECT list columns and expressions in number, type, and sequence.&lt;/p&gt;
&lt;p&gt;If projection column names are omitted, Vertica uses the anchor table column names specified in the SELECT list.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;grouped-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;See &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;GROUPED clause&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ENCODING &lt;/code&gt;&lt;em&gt;&lt;code&gt;encoding-type&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The column &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/&#34;&gt;encoding type&lt;/a&gt;, by default set to AUTO.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ACCESSRANK &lt;/code&gt;&lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Overrides the default access rank for a column. Use this parameter to increase or decrease the speed at which the database accesses a column. For more information, see &lt;a href=&#34;../../../../../en/admin/configuring-db/creating-db-design/creating-custom-designs/design-fundamentals/prioritizing-column-access-speed/#ColumnAcessRank&#34;&gt;Overriding Default Column Ranking&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;AS SELECT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Specifies the table data to query:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; } [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;] }[,...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can optionally assign an alias to each column expression and reference that alias elsewhere in the SELECT statement.&lt;/p&gt;
&lt;p&gt;If you specify projection column names, the two lists of projection columns and table columns/expressions must exactly match in number and order.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;GROUP BY &lt;/code&gt;&lt;em&gt;&lt;code&gt;column-expr&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;One or more column expressions from the SELECT list. The first expression must be the first column expression in the SELECT list, the second expression must be the second column expression in the SELECT list, and so on.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Anchor table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CREATE privilege on the schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/live-aggregate-projections/live-aggregate-projection-example/#&#34;&gt;Live aggregate projection example&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Standard projection</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/standard-projection/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/standard-projection/</guid>
      <description>
        
        
        &lt;p&gt;Stores a collection of table data in a format that optimizes execution of certain queries on that table. For details, see &lt;a href=&#34;../../../../../en/admin/projections/#&#34;&gt;Projections&lt;/a&gt; .&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE PROJECTION [ IF NOT EXISTS ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;projection&lt;/span&gt;
[ (
   { &lt;span class=&#34;code-variable&#34;&gt;projection-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;grouped-clause&lt;/a&gt;&lt;/span&gt;
   [ ENCODING &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/#&#34;&gt;encoding-type&lt;/a&gt;&lt;/span&gt; ]
   [ ACCESSRANK &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ] }[,...]
) ]
AS SELECT { * | { &lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/#&#34;&gt;MATCH_COLUMNS&lt;/a&gt;(&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt;&amp;#39;) | &lt;span class=&#34;code-variable&#34;&gt;expression &lt;/span&gt;[ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias &lt;/span&gt;] }[,...] }
   FROM [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;]
   [ ORDER BY &lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;[,...] ]
   [ SEGMENTED BY &lt;span class=&#34;code-variable&#34;&gt;expression&lt;/span&gt; ALL NODES [ OFFSET &lt;span class=&#34;code-variable&#34;&gt;offset&lt;/span&gt; ] | UNSEGMENTED ALL NODES ]
   [ KSAFE [ &lt;span class=&#34;code-variable&#34;&gt;k-num&lt;/span&gt; ]
   [ ON PARTITION RANGE BETWEEN &lt;span class=&#34;code-variable&#34;&gt;min-val&lt;/span&gt; AND &lt;span class=&#34;code-variable&#34;&gt;max-val&lt;/span&gt; ] ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;IF NOT EXISTS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If an object with the same name exists, return without creating the object. If you do not use this directive and the object already exists, the database returns with an error message.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;IF NOT EXISTS&lt;/code&gt; clause is useful for SQL scripts where you might not know if the object already exists. The &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/variables/on-error-stop/&#34;&gt;ON ERROR STOP&lt;/a&gt; directive can be helpful in scripts.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;&lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;Schema&lt;/a&gt; for this projection and its anchor table. The value must be the same for both. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Name of the projection to create, which must conform to &lt;a href=&#34;../../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection-column&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The name of a projection column. The list of projection columns must match the SELECT list columns and expressions in number, type, and sequence.&lt;/p&gt;
&lt;p&gt;If projection column names are omitted, Vertica uses the anchor table column names specified in the SELECT list.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;grouped-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;See &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;GROUPED clause&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ENCODING &lt;/code&gt;&lt;em&gt;&lt;code&gt;encoding-type&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The column &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/&#34;&gt;encoding type&lt;/a&gt;, by default set to AUTO.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ACCESSRANK &lt;/code&gt;&lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Overrides the default access rank for a column. Use this parameter to increase or decrease the speed at which the database accesses a column. For more information, see &lt;a href=&#34;../../../../../en/admin/configuring-db/creating-db-design/creating-custom-designs/design-fundamentals/prioritizing-column-access-speed/#ColumnAcessRank&#34;&gt;Overriding Default Column Ranking&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;AS SELECT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Columns or column expressions to select from the specified table:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; (asterisk): Returns all columns in the queried tables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/#&#34;&gt;MATCH_COLUMNS&lt;/a&gt;(&#39;&lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt;&#39;): Returns the names of all columns in the queried anchor table that match &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[[AS]&lt;/code&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;: Resolves to column data from the queried anchor table. You can optionally assign an alias to each column expression and reference that alias elsewhere in the SELECT statement—for example, in the ORDER BY or segmentation clause.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you specify projection column names, the two lists of projection columns and table columns/expressions must exactly match in number and order.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ORDER BY&lt;/code&gt; &lt;em&gt;&lt;code&gt;column&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Columns from the SELECT list on which to sort the projection. The &lt;a href=&#34;../../../../../en/sql-reference/statements/select/order-by-clause/&#34;&gt;ORDER BY clause&lt;/a&gt; can only be set to ASC (the default). OpenText™ Analytics Database always stores projection data in ascending sort order.
&lt;p&gt;If you order by a column with a collection data type (ARRAY or SET), queries that use that column in an ORDER BY clause perform the sort again. This is because projections and queries perform the ordering differently.&lt;/p&gt;
&lt;p&gt;If you omit the ORDER BY clause, the database uses the SELECT list to sort the projection.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;SEGMENTED BY &lt;/code&gt;&lt;em&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/em&gt; &lt;code&gt;ALL NODES [ OFFSET &lt;/code&gt;&lt;em&gt;&lt;code&gt;offset&lt;/code&gt;&lt;/em&gt; &lt;code&gt;] | UNSEGMENTED ALL NODES&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;
&lt;p&gt;How to distribute projection data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/hash-segmentation-clause/&#34;&gt;Hash-segmentation using an expression&lt;/a&gt;: segment projection data evenly and distribute across cluster nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/unsegmented-clause/&#34;&gt;Unsegmented&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If neither the anchor table nor the projection specifies segmentation, the database uses hash segmentation using all columns:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SEGMENTED BY HASH(&lt;span class=&#34;code-variable&#34;&gt;column&lt;/span&gt;[,...]) ALL NODES OFFSET 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

OpenText recommends segmenting large tables.

&lt;/div&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;a name=&#34;CreateProjKsafe&#34;&gt;&lt;/a&gt;&lt;code&gt;KSAFE &lt;/code&gt;&lt;em&gt;&lt;code&gt;k-num&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Specifies K-safety for the projection. The value must be equal to or greater than database K-safety. The database ignores this option if set for unsegmented projections.&lt;/p&gt;
&lt;p&gt;If you omit this clause, database K-safety is used.&lt;/p&gt;
&lt;p&gt;For general information, see &lt;a href=&#34;../../../../../en/architecture/enterprise-concepts/k-safety-an-enterprise-db/#&#34;&gt;K-safety in an Enterprise Mode database&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ON PARTITION RANGE BETWEEN &lt;/code&gt; &lt;em&gt;&lt;code&gt;min-val&lt;/code&gt;&lt;/em&gt; &lt;code&gt;AND &lt;/code&gt;&lt;em&gt;&lt;code&gt;max-val&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Limits projection data to a range of partition keys.  The minimum value must be less than or equal to the maximum value.&lt;/p&gt;
&lt;p&gt;Values can be NULL.  A null minimum value indicates no lower bound and a null maximum value indicates no upper bound. If both are NULL, this statement drops the projection endpoints, producing a regular projection instead of a range projection.&lt;/p&gt;

&lt;p&gt;For other requirements and usage details, see &lt;a href=&#34;../../../../../en/admin/projections/partition-range-projections/#&#34;&gt;Partition range projections&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Anchor table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CREATE privilege on the schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/projections/segmented-projections/#&#34;&gt;Segmented projections&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/projections/unsegmented-projections/#&#34;&gt;Unsegmented projections&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/projections/partition-range-projections/#&#34;&gt;Partition range projections&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Top-k projection</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/top-k-projection/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/top-k-projection/</guid>
      <description>
        
        
        &lt;p&gt;Stores the top &lt;em&gt;k&lt;/em&gt; rows from partitions of selected rows. For details, see &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/top-k-projections/#&#34;&gt;Top-k projections&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database does not regard Top-K projections as &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/superprojection/&#34; title=&#34;A projection that includes all columns in an anchor table.&#34;&gt;superprojections&lt;/a&gt;, even those that include all table columns. For other requirements and restrictions, see &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/top-k-projections/creating-top-k-projections/#&#34;&gt;Creating top-k projections&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE PROJECTION [ IF NOT EXISTS ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;projection&lt;/span&gt;
[ (
   { &lt;span class=&#34;code-variable&#34;&gt;projection-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;grouped-clause&lt;/a&gt;&lt;/span&gt;
   [ ENCODING &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/#&#34;&gt;encoding-type&lt;/a&gt;&lt;/span&gt; ]
   [ ACCESSRANK &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ] }[,...]
) ]
AS SELECT { &lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; }[,...] FROM [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;]
   LIMIT &lt;span class=&#34;code-variable&#34;&gt;num-rows&lt;/span&gt; OVER ( &lt;span class=&#34;code-variable&#34;&gt;window-partition-clause&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;window-order-clause&lt;/span&gt; )
   [ KSAFE [ &lt;span class=&#34;code-variable&#34;&gt;k-num&lt;/span&gt; ] ]
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;IF NOT EXISTS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If an object with the same name exists, return without creating the object. If you do not use this directive and the object already exists, the database returns with an error message.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;IF NOT EXISTS&lt;/code&gt; clause is useful for SQL scripts where you might not know if the object already exists. The &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/variables/on-error-stop/&#34;&gt;ON ERROR STOP&lt;/a&gt; directive can be helpful in scripts.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;&lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;Schema&lt;/a&gt; for this projection and its anchor table. The value must be the same for both. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Name of the projection to create, which must conform to &lt;a href=&#34;../../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection-column&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The name of a projection column. The list of projection columns must match the SELECT list columns and expressions in number, type, and sequence.&lt;/p&gt;
&lt;p&gt;If projection column names are omitted, Vertica uses the anchor table column names specified in the SELECT list.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;grouped-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;See &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;GROUPED clause&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ENCODING &lt;/code&gt;&lt;em&gt;&lt;code&gt;encoding-type&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The column &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/&#34;&gt;encoding type&lt;/a&gt;, by default set to AUTO.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ACCESSRANK &lt;/code&gt;&lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Overrides the default access rank for a column. Use this parameter to increase or decrease the speed at which the database accesses a column. For more information, see &lt;a href=&#34;../../../../../en/admin/configuring-db/creating-db-design/creating-custom-designs/design-fundamentals/prioritizing-column-access-speed/#ColumnAcessRank&#34;&gt;Overriding Default Column Ranking&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;AS SELECT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Specifies the table data to query:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; } [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;] }[,...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can optionally assign an alias to each column expression and reference that alias elsewhere in the SELECT statement.&lt;/p&gt;
&lt;p&gt;If you specify projection column names, the two lists of projection columns and table columns/expressions must exactly match in number and order.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;LIMIT &lt;/code&gt;&lt;em&gt;&lt;code&gt;num-rows&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The number of rows to return from the specified partition.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;OVER (&lt;/code&gt;&lt;em&gt;&lt;code&gt;window-partition-clause&lt;/code&gt;&lt;/em&gt; &lt;em&gt;&lt;code&gt;window-order-clause&lt;/code&gt;&lt;/em&gt;&lt;code&gt;)&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies window partitioning by one or more comma-delimited column expressions from the SELECT list.  The first partition expression must be the first SELECT list item, the second partition expression the second SELECT list item, and so on.
&lt;p&gt;The order clause is required, and specifies the order in which the top &lt;em&gt;&lt;code&gt;k&lt;/code&gt;&lt;/em&gt; rows are returned. The default is ascending (ASC) order. All column expressions must be from the SELECT list, where the first window order expression must be the first SELECT list item not specified in the window partition clause.&lt;/p&gt;
&lt;p&gt;Top-K projections support &lt;a href=&#34;../../../../../en/data-analysis/query-optimization/analytic-functions/null-sort-order/&#34;&gt;ORDER BY NULLS FIRST/LAST&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Anchor table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CREATE privilege on the schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/top-k-projections/top-k-projection-examples/#&#34;&gt;Top-k projection examples&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: UDTF projection</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/udtf-projection/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/udtf-projection/</guid>
      <description>
        
        
        &lt;p&gt;Stores newly-loaded data after it is transformed and/or aggregated by user-defined transformation functions (UDTFs). For details and examples, see &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#&#34;&gt;Pre-aggregating UDTF results&lt;/a&gt;.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
Currently, projections can only reference &lt;a href=&#34;../../../../../en/extending/developing-udxs/transform-functions-udtfs/&#34;&gt;UDTFs developed in C++&lt;/a&gt;.
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;CreateUDTFProjection&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE PROJECTION [ IF NOT EXISTS ] [[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;projection&lt;/span&gt;
[ (
   { &lt;span class=&#34;code-variable&#34;&gt;projection-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;grouped-clause&lt;/a&gt;&lt;/span&gt;
   [ ENCODING &lt;span class=&#34;code-variable&#34;&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/#&#34;&gt;encoding-type&lt;/a&gt;&lt;/span&gt; ]
   [ ACCESSRANK &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ]  }[,...]
) ]
AS { &lt;span class=&#34;code-variable&#34;&gt;batch-query&lt;/span&gt; FROM { &lt;span class=&#34;code-variable&#34;&gt;prepass-query&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;sq-ref&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt; [[AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;] }
     | &lt;span class=&#34;code-variable&#34;&gt;prepass-query&lt;/span&gt; }

&lt;span class=&#34;code-variable&#34;&gt;batch-query&lt;/span&gt;:

SELECT { &lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; }[,...], &lt;span class=&#34;code-variable&#34;&gt;batch-udtf&lt;/span&gt;(&lt;span class=&#34;code-variable&#34;&gt;batch-args&lt;/span&gt;)
   OVER (PARTITION BATCH BY &lt;span class=&#34;code-variable&#34;&gt;partition-column-expr&lt;/span&gt;[,...])
   [ AS (&lt;span class=&#34;code-variable&#34;&gt;output-columns&lt;/span&gt;) ]

&lt;span class=&#34;code-variable&#34;&gt;prepass-query&lt;/span&gt;:

SELECT { &lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; }[,...], &lt;span class=&#34;code-variable&#34;&gt;prepass-udtf&lt;/span&gt;(&lt;span class=&#34;code-variable&#34;&gt;prepass-args&lt;/span&gt;)
   OVER (PARTITION PREPASS BY &lt;span class=&#34;code-variable&#34;&gt;partition-column-expr&lt;/span&gt;[,...])
   [ AS (&lt;span class=&#34;code-variable&#34;&gt;output-columns&lt;/span&gt;) ] FROM &lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;IF NOT EXISTS&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;If an object with the same name exists, return without creating the object. If you do not use this directive and the object already exists, the database returns with an error message.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;IF NOT EXISTS&lt;/code&gt; clause is useful for SQL scripts where you might not know if the object already exists. The &lt;a href=&#34;../../../../../en/connecting-to/using-vsql/variables/on-error-stop/&#34;&gt;ON ERROR STOP&lt;/a&gt; directive can be helpful in scripts.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;&lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;Schema&lt;/a&gt; for this projection and its anchor table. The value must be the same for both. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Name of the projection to create, which must conform to &lt;a href=&#34;../../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection-column&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The name of a projection column. The list of projection columns must match the SELECT list columns and expressions in number, type, and sequence.&lt;/p&gt;
&lt;p&gt;If projection column names are omitted, Vertica uses the anchor table column names specified in the SELECT list.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;grouped-clause&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;See &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/grouped-clause/#&#34;&gt;GROUPED clause&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ENCODING &lt;/code&gt;&lt;em&gt;&lt;code&gt;encoding-type&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The column &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/encoding-types/&#34;&gt;encoding type&lt;/a&gt;, by default set to AUTO.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ACCESSRANK &lt;/code&gt;&lt;em&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Overrides the default access rank for a column. Use this parameter to increase or decrease the speed at which the database accesses a column. For more information, see &lt;a href=&#34;../../../../../en/admin/configuring-db/creating-db-design/creating-custom-designs/design-fundamentals/prioritizing-column-access-speed/#ColumnAcessRank&#34;&gt;Overriding Default Column Ranking&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;SELECT&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Specifies the table data to query:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&lt;span class=&#34;code-variable&#34;&gt;table-column&lt;/span&gt; | &lt;span class=&#34;code-variable&#34;&gt;expr-with-table-columns&lt;/span&gt; } [ [AS] &lt;span class=&#34;code-variable&#34;&gt;alias&lt;/span&gt;] }[,...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can optionally assign an alias to each column expression and reference that alias elsewhere in the SELECT statement.&lt;/p&gt;
&lt;p&gt;If you specify projection column names, the two lists of projection columns and table columns/expressions must exactly match in number and order.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;batch-udtf&lt;/code&gt;&lt;/em&gt;&lt;code&gt;(&lt;/code&gt;&lt;em&gt;&lt;code&gt;batch-args&lt;/code&gt;&lt;/em&gt;&lt;code&gt;)&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#SingleBatchUDTF&#34;&gt;batch UDTF&lt;/a&gt; to invoke each time the following events occur:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Tuple mover mergeout&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Queries on the projection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If invoked singly, on data load operations&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If the projection definition includes a pre-pass subquery, &lt;em&gt;&lt;code&gt;batch-args&lt;/code&gt;&lt;/em&gt; must exactly match the pre-pass UDTF output columns, in name and order.
&lt;/div&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;prepass-udtf&lt;/code&gt;&lt;/em&gt;&lt;code&gt;(&lt;/code&gt;&lt;em&gt;&lt;code&gt;prepass-args&lt;/code&gt;&lt;/em&gt;&lt;code&gt;)&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#SinglePrePassUDTF&#34;&gt;pre-pass UDTF&lt;/a&gt; to invoke on each load operation such as COPY or INSERT.
&lt;p&gt;If specified in a subquery, the pre-pass UDTF returns transformed data to the batch query for further processing. Otherwise, the pre-pass query results are added to projection data storage.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;OVER (PARTITION { BATCH | PREPASS } BY &lt;/code&gt;&lt;em&gt;&lt;code&gt;partition-column-expr&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[,...])&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the UDTF type and how to partition the data it returns:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BATCH&lt;/code&gt; identifies the UDTF as a &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#SingleBatchUDTF&#34;&gt;batch UDTF&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;PREPASS&lt;/code&gt; identifies the UDTF as a &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#SinglePrePassUDTF&#34;&gt;pre-pass UDTF&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In both cases, the OVER clause specifies partitioning with one or more column expressions from the SELECT list. The first expression is the first column expression in the SELECT list, the second expression is the second column expression in the SELECT list, and so on.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The projection is implicitly segmented and ordered on PARTITION BY columns.

&lt;/div&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;AS &lt;/code&gt;&lt;em&gt;&lt;code&gt;output-columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Optionally names columns that are returned by the UDTF.
&lt;p&gt;If a pre-pass subquery omits this clause, the outer batch query UDTF arguments (&lt;em&gt;&lt;code&gt;batch-args&lt;/code&gt;&lt;/em&gt;) must reference the column names as they are defined in the pre-pass UDTF.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;code&gt;[[AS]&lt;/code&gt;&lt;em&gt;&lt;code&gt;alias&lt;/code&gt;&lt;/em&gt;&lt;code&gt;]&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The projection&#39;s anchor table, optionally qualified by an alias.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;sq-results&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Subquery result set that is returned to the outer batch UDTF.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Anchor table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CREATE privilege on the schema&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;EXECUTE privileges on all UDTFs that are referenced by the projection&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/data-analysis/data-aggregation/pre-aggregating-data-projections/pre-aggregating-udtf-results/#&#34;&gt;Pre-aggregating UDTF results&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: Unsegmented clause</title>
      <link>/en/sql-reference/statements/create-statements/create-projection/unsegmented-clause/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/statements/create-statements/create-projection/unsegmented-clause/</guid>
      <description>
        
        
        &lt;p&gt;Specifies to distribute identical copies of table or projection data on all nodes across the cluster. Use this clause to facilitate distributed query execution on tables and projections that are too small to benefit from segmentation.&lt;/p&gt;
&lt;p&gt;OpenText™ Analytics Database uses the same name to identify all instances of an unsegmented projection. For more information about projection name conventions, see &lt;a href=&#34;../../../../../en/admin/projections/projection-naming/#&#34;&gt;Projection naming&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;UNSEGMENTED ALL NODES
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example creates an unsegmented projection for table &lt;code&gt;store.store_dimension&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; CREATE PROJECTION store.store_dimension_proj (storekey, name, city, state)
             AS SELECT store_key, store_name, store_city, store_state
             FROM store.store_dimension
             UNSEGMENTED ALL NODES;
CREATE PROJECTION

=&amp;gt;  SELECT anchor_table_name anchor_table, projection_name, node_name
      FROM PROJECTIONS WHERE projection_basename=&amp;#39;store_dimension_proj&amp;#39;;
  anchor_table   |   projection_name    |    node_name
-----------------+----------------------+------------------
 store_dimension | store_dimension_proj | v_vmart_node0001
 store_dimension | store_dimension_proj | v_vmart_node0002
 store_dimension | store_dimension_proj | v_vmart_node0003
(3 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
