id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
|---|---|---|
c1c366f85f63-0
|
You tested load times, storage requirements, and query execution times before and after tuning the tables, and recorded the results\.
The following table shows the example results for the cluster that was used for this tutorial\. Your results will be different, but should show similar improvements\.
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/tutorial-tuning-tables-evaluate.html)
**Load time**
Load time increased by 17\.5%\.
Sorting, compression, and distribution increase load time\. In particular, in this case, you used automatic compression, which increases the load time for empty tables that don't already have compression encodings\. Subsequent loads to the same tables would be faster\. You also increased load time by using ALL distribution\. You could reduce load time by using EVEN or DISTKEY distribution instead for some of the tables, but that decision needs to be weighed against query performance\.
**Storage requirements**
Storage requirements were reduced by 45\.4%\.
Some of the storage improvement from using columnar compression was offset by using ALL distribution on some of the tables\. Again, you could improve storage use by using EVEN or DISTKEY distribution instead for some of the tables, but that decision needs to be weighed against query performance\.
**Distribution**
You verified that there is no distribution skew as a result of your distribution choices\.
By checking the EXPLAIN plan, you saw that data redistribution was eliminated for the test queries\.
**Query execution time**
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/tutorial-tuning-tables-evaluate.md
|
c1c366f85f63-1
|
By checking the EXPLAIN plan, you saw that data redistribution was eliminated for the test queries\.
**Query execution time**
Total query execution time was reduced by 31\.4%\.
The improvement in query performance was due to a combination of optimizing sort keys, distribution styles, and compression\. Often, query performance can be improved even further by rewriting queries and configuring workload management \(WLM\)\. For more information, see [Tuning query performance](c-optimizing-query-performance.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/tutorial-tuning-tables-evaluate.md
|
2d1698dde12f-0
|
[Step 9: Clean up your resources](tutorial-tuning-tables-clean-up.md)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/tutorial-tuning-tables-evaluate.md
|
535688e3ce9d-0
|
ST\_Azimuth returns the north\-based Cartesian azimuth of two input points\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/ST_Azimuth-function.md
|
e4d6fa95effc-0
|
```
ST_Azimuth(point1, point2)
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/ST_Azimuth-function.md
|
bcafc0a07248-0
|
*point1*
A `POINT` value of data type `GEOMETRY`\. The spatial reference system identifier \(SRID\) of *point1* must match the SRID of *point2*\.
*point2*
A `POINT` value of data type `GEOMETRY`\. The SRID of *point2* must match the SRID of *point1*\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/ST_Azimuth-function.md
|
79e7c69611af-0
|
A number that is an angle in radians of `DOUBLE PRECISION` data type\. Values range from 0 \(inclusive\) to 2 pi \(exclusive\)\.
If either *point1* or *point2* is null, then null is returned\.
If *point1* and *point2* are equal, then null is returned\.
If *point1* or *point2* is not a point, then an error is returned\.
If *point1* and *point2* don't have the same SRID value, then an error is returned\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/ST_Azimuth-function.md
|
ef9862fccc2f-0
|
The following SQL returns the azimuth of the input points\.
```
SELECT ST_Azimuth(ST_Point(1,2), ST_Point(5,6));
```
```
st_azimuth
-------------------
0.7853981633974483
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/ST_Azimuth-function.md
|
322bb94a4c93-0
|
Use the SVL\_S3LOG view to get details about Amazon Redshift Spectrum queries at the segment and node slice level\.
SVL\_S3LOG is visible to all users\. Superusers can see all rows; regular users can see only their own data\. For more information, see [Visibility of data in system tables and views](c_visibility-of-data.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_SVL_S3LOG.md
|
bc9e431b263a-0
|
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/r_SVL_S3LOG.html)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_SVL_S3LOG.md
|
32d3ffc25a7a-0
|
The following example queries SVL\_S3LOG for the last query executed\.
```
select *
from svl_s3log
where query = pg_last_query_id()
order by query,segment,slice;
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_SVL_S3LOG.md
|
e7383c1d22bb-0
|
The FROM clause in a query lists the table references \(tables, views, and subqueries\) that data is selected from\. If multiple table references are listed, the tables must be joined, using appropriate syntax in either the FROM clause or the WHERE clause\. If no join criteria are specified, the system processes the query as a cross\-join \(Cartesian product\)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
3d4c3143938b-0
|
```
FROM table_reference [, ...]
```
where *table\_reference* is one of the following:
```
with_subquery_table_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ]
table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ]
( subquery ) [ AS ] alias [ ( column_alias [, ...] ) ]
table_reference [ NATURAL ] join_type table_reference
[ ON join_condition | USING ( join_column [, ...] ) ]
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
b3a0e65859df-0
|
*with\_subquery\_table\_name*
A table defined by a subquery in the [WITH clause](r_WITH_clause.md)\.
*table\_name*
Name of a table or view\.
*alias*
Temporary alternative name for a table or view\. An alias must be supplied for a table derived from a subquery\. In other table references, aliases are optional\. The AS keyword is always optional\. Table aliases provide a convenient shortcut for identifying tables in other parts of a query, such as the WHERE clause\. For example:
```
select * from sales s, listing l
where s.listid=l.listid
```
*column\_alias*
Temporary alternative name for a column in a table or view\.
*subquery*
A query expression that evaluates to a table\. The table exists only for the duration of the query and is typically given a name or *alias*\. However, an alias isn't required\. You can also define column names for tables that derive from subqueries\. Naming column aliases is important when you want to join the results of subqueries to other tables and when you want to select or constrain those columns elsewhere in the query\.
A subquery may contain an ORDER BY clause, but this clause may have no effect if a LIMIT or OFFSET clause isn't also specified\.
NATURAL
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
b3a0e65859df-1
|
A subquery may contain an ORDER BY clause, but this clause may have no effect if a LIMIT or OFFSET clause isn't also specified\.
NATURAL
Defines a join that automatically uses all pairs of identically named columns in the two tables as the joining columns\. No explicit join condition is required\. For example, if the CATEGORY and EVENT tables both have columns named CATID, a natural join of those tables is a join over their CATID columns\.
If a NATURAL join is specified but no identically named pairs of columns exist in the tables to be joined, the query defaults to a cross\-join\.
*join\_type*
Specify one of the following types of join:
+ \[INNER\] JOIN
+ LEFT \[OUTER\] JOIN
+ RIGHT \[OUTER\] JOIN
+ FULL \[OUTER\] JOIN
+ CROSS JOIN
ON *join\_condition*
Type of join specification where the joining columns are stated as a condition that follows the ON keyword\. For example:
```
sales join listing
on sales.listid=listing.listid and sales.eventid=listing.eventid
```
USING \( *join\_column* \[, \.\.\.\] \)
Type of join specification where the joining columns are listed in parentheses\. If multiple joining columns are specified, they are delimited by commas\. The USING keyword must precede the list\. For example:
```
sales join listing
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
b3a0e65859df-2
|
```
sales join listing
using (listid,eventid)
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
8eb9b993a36d-0
|
Cross\-joins are unqualified joins; they return the Cartesian product of the two tables\.
Inner and outer joins are qualified joins\. They are qualified either implicitly \(in natural joins\); with the ON or USING syntax in the FROM clause; or with a WHERE clause condition\.
An inner join returns matching rows only, based on the join condition or list of joining columns\. An outer join returns all of the rows that the equivalent inner join would return plus non\-matching rows from the "left" table, "right" table, or both tables\. The left table is the first\-listed table, and the right table is the second\-listed table\. The non\-matching rows contain NULL values to fill the gaps in the output columns\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
2d26bcef3eae-0
|
Joining columns must have comparable data types\.
A NATURAL or USING join retains only one of each pair of joining columns in the intermediate result set\.
A join with the ON syntax retains both joining columns in its intermediate result set\.
See also [WITH clause](r_WITH_clause.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_FROM_clause30.md
|
78364649a636-0
|
Records the current state of queries being tracked by WLM\.
STV\_WLM\_QUERY\_STATE is visible to all users\. Superusers can see all rows; regular users can see only their own data\. For more information, see [Visibility of data in system tables and views](c_visibility-of-data.md)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_STV_WLM_QUERY_STATE.md
|
5a744e41d32d-0
|
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/r_STV_WLM_QUERY_STATE.html)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_STV_WLM_QUERY_STATE.md
|
9548a6351786-0
|
The following query displays all currently executing queries in service classes greater than 4\. For a list of service class IDs, see [WLM service class IDs](cm-c-wlm-system-tables-and-views.md#wlm-service-class-ids)\.
```
select xid, query, trim(state), queue_time, exec_time
from stv_wlm_query_state
where service_class > 4;
```
This query returns the following sample output:
```
xid | query | btrim | queue_time | exec_time
-------+-------+---------+------------+-----------
100813 | 25942 | Running | 0 | 1369029
100074 | 25775 | Running | 0 | 2221589242
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_STV_WLM_QUERY_STATE.md
|
e0ef583356ac-0
|
This example shows how to evaluate a query plan to find opportunities to optimize the distribution\.
Run the following query with an EXPLAIN command to produce a query plan\.
```
explain
select lastname, catname, venuename, venuecity, venuestate, eventname,
month, sum(pricepaid) as buyercost, max(totalprice) as maxtotalprice
from category join event on category.catid = event.catid
join venue on venue.venueid = event.venueid
join sales on sales.eventid = event.eventid
join listing on sales.listid = listing.listid
join date on sales.dateid = date.dateid
join users on users.userid = sales.buyerid
group by lastname, catname, venuename, venuecity, venuestate, eventname, month
having sum(pricepaid)>9999
order by catname, buyercost desc;
```
In the TICKIT database, SALES is a fact table and LISTING is its largest dimension\. In order to collocate the tables, SALES is distributed on the LISTID, which is the foreign key for LISTING, and LISTING is distributed on its primary key, LISTID\. The following example shows the CREATE TABLE commands for SALES and LISTID\.
```
create table sales(
salesid integer not null,
listid integer not null distkey,
sellerid integer not null,
buyerid integer not null,
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-1
|
listid integer not null distkey,
sellerid integer not null,
buyerid integer not null,
eventid integer not null encode mostly16,
dateid smallint not null,
qtysold smallint not null encode mostly8,
pricepaid decimal(8,2) encode delta32k,
commission decimal(8,2) encode delta32k,
saletime timestamp,
primary key(salesid),
foreign key(listid) references listing(listid),
foreign key(sellerid) references users(userid),
foreign key(buyerid) references users(userid),
foreign key(dateid) references date(dateid))
sortkey(listid,sellerid);
create table listing(
listid integer not null distkey sortkey,
sellerid integer not null,
eventid integer not null encode mostly16,
dateid smallint not null,
numtickets smallint not null encode mostly8,
priceperticket decimal(8,2) encode bytedict,
totalprice decimal(8,2) encode mostly32,
listtime timestamp,
primary key(listid),
foreign key(sellerid) references users(userid),
foreign key(eventid) references event(eventid),
foreign key(dateid) references date(dateid));
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-2
|
foreign key(eventid) references event(eventid),
foreign key(dateid) references date(dateid));
```
In the following query plan, the Merge Join step for the join on SALES and LISTING shows DS\_DIST\_NONE, which indicates that no redistribution is required for the step\. However, moving up the query plan, the other inner joins show DS\_BCAST\_INNER, which indicates that the inner table is broadcast as part of the query execution\. Because only one pair of tables can be collocated using key distribution, five tables need to be rebroadcast\.
```
QUERY PLAN
XN Merge (cost=1015345167117.54..1015345167544.46 rows=1000 width=103)
Merge Key: category.catname, sum(sales.pricepaid)
-> XN Network (cost=1015345167117.54..1015345167544.46 rows=170771 width=103)
Send to leader
-> XN Sort (cost=1015345167117.54..1015345167544.46 rows=170771 width=103)
Sort Key: category.catname, sum(sales.pricepaid)
-> XN HashAggregate (cost=15345150568.37..15345152276.08 rows=170771 width=103)
Filter: (sum(pricepaid) > 9999.00)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-3
|
Filter: (sum(pricepaid) > 9999.00)
-> XN Hash Join DS_BCAST_INNER (cost=742.08..15345146299.10 rows=170771 width=103)
Hash Cond: ("outer".catid = "inner".catid)
-> XN Hash Join DS_BCAST_INNER (cost=741.94..15342942456.61 rows=170771 width=97)
Hash Cond: ("outer".dateid = "inner".dateid)
-> XN Hash Join DS_BCAST_INNER (cost=737.38..15269938609.81 rows=170766 width=90)
Hash Cond: ("outer".buyerid = "inner".userid)
-> XN Hash Join DS_BCAST_INNER (cost=112.50..3272334142.59 rows=170771 width=84)
Hash Cond: ("outer".venueid = "inner".venueid)
-> XN Hash Join DS_BCAST_INNER (cost=109.98..3167290276.71 rows=172456 width=47)
Hash Cond: ("outer".eventid = "inner".eventid)
-> XN Merge Join DS_DIST_NONE (cost=0.00..6286.47 rows=172456 width=30)
Merge Cond: ("outer".listid = "inner".listid)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-4
|
Merge Cond: ("outer".listid = "inner".listid)
-> XN Seq Scan on listing (cost=0.00..1924.97 rows=192497 width=14)
-> XN Seq Scan on sales (cost=0.00..1724.56 rows=172456 width=24)
-> XN Hash (cost=87.98..87.98 rows=8798 width=25)
-> XN Seq Scan on event (cost=0.00..87.98 rows=8798 width=25)
-> XN Hash (cost=2.02..2.02 rows=202 width=41)
-> XN Seq Scan on venue (cost=0.00..2.02 rows=202 width=41)
-> XN Hash (cost=499.90..499.90 rows=49990 width=14)
-> XN Seq Scan on users (cost=0.00..499.90 rows=49990 width=14)
-> XN Hash (cost=3.65..3.65 rows=365 width=11)
-> XN Seq Scan on date (cost=0.00..3.65 rows=365 width=11)
-> XN Hash (cost=0.11..0.11 rows=11 width=10)
-> XN Seq Scan on category (cost=0.00..0.11 rows=11 width=10)
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-5
|
-> XN Seq Scan on category (cost=0.00..0.11 rows=11 width=10)
```
One solution is to recreate the tables with DISTSTYLE ALL\. You cannot change a table's distribution style after it is created\. To recreate tables with a different distribution style, use a deep copy\.
First, rename the tables\.
```
alter table users rename to userscopy;
alter table venue rename to venuecopy;
alter table category rename to categorycopy;
alter table date rename to datecopy;
alter table event rename to eventcopy;
```
Run the following script to recreate USERS, VENUE, CATEGORY, DATE, EVENT\. Don't make any changes to SALES and LISTING\.
```
create table users(
userid integer not null sortkey,
username char(8),
firstname varchar(30),
lastname varchar(30),
city varchar(30),
state char(2),
email varchar(100),
phone char(14),
likesports boolean,
liketheatre boolean,
likeconcerts boolean,
likejazz boolean,
likeclassical boolean,
likeopera boolean,
likerock boolean,
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-6
|
likejazz boolean,
likeclassical boolean,
likeopera boolean,
likerock boolean,
likevegas boolean,
likebroadway boolean,
likemusicals boolean,
primary key(userid)) diststyle all;
create table venue(
venueid smallint not null sortkey,
venuename varchar(100),
venuecity varchar(30),
venuestate char(2),
venueseats integer,
primary key(venueid)) diststyle all;
create table category(
catid smallint not null,
catgroup varchar(10),
catname varchar(10),
catdesc varchar(50),
primary key(catid)) diststyle all;
create table date(
dateid smallint not null sortkey,
caldate date not null,
day character(3) not null,
week smallint not null,
month character(5) not null,
qtr character(5) not null,
year smallint not null,
holiday boolean default('N'),
primary key (dateid)) diststyle all;
create table event(
eventid integer not null sortkey,
venueid smallint not null,
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-7
|
create table event(
eventid integer not null sortkey,
venueid smallint not null,
catid smallint not null,
dateid smallint not null,
eventname varchar(200),
starttime timestamp,
primary key(eventid),
foreign key(venueid) references venue(venueid),
foreign key(catid) references category(catid),
foreign key(dateid) references date(dateid)) diststyle all;
```
Insert the data back into the tables and run an ANALYZE command to update the statistics\.
```
insert into users select * from userscopy;
insert into venue select * from venuecopy;
insert into category select * from categorycopy;
insert into date select * from datecopy;
insert into event select * from eventcopy;
analyze;
```
Finally, drop the copies\.
```
drop table userscopy;
drop table venuecopy;
drop table categorycopy;
drop table datecopy;
drop table eventcopy;
```
Run the same query with EXPLAIN again, and examine the new query plan\. The joins now show DS\_DIST\_ALL\_NONE, indicating that no redistribution is required because the data was distributed to every node using DISTSTYLE ALL\.
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-8
|
```
QUERY PLAN
XN Merge (cost=1000000047117.54..1000000047544.46 rows=1000 width=103)
Merge Key: category.catname, sum(sales.pricepaid)
-> XN Network (cost=1000000047117.54..1000000047544.46 rows=170771 width=103)
Send to leader
-> XN Sort (cost=1000000047117.54..1000000047544.46 rows=170771 width=103)
Sort Key: category.catname, sum(sales.pricepaid)
-> XN HashAggregate (cost=30568.37..32276.08 rows=170771 width=103)
Filter: (sum(pricepaid) > 9999.00)
-> XN Hash Join DS_DIST_ALL_NONE (cost=742.08..26299.10 rows=170771 width=103)
Hash Cond: ("outer".buyerid = "inner".userid)
-> XN Hash Join DS_DIST_ALL_NONE (cost=117.20..21831.99 rows=170766 width=97)
Hash Cond: ("outer".dateid = "inner".dateid)
-> XN Hash Join DS_DIST_ALL_NONE (cost=112.64..17985.08 rows=170771 width=90)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-9
|
-> XN Hash Join DS_DIST_ALL_NONE (cost=112.64..17985.08 rows=170771 width=90)
Hash Cond: ("outer".catid = "inner".catid)
-> XN Hash Join DS_DIST_ALL_NONE (cost=112.50..14142.59 rows=170771 width=84)
Hash Cond: ("outer".venueid = "inner".venueid)
-> XN Hash Join DS_DIST_ALL_NONE (cost=109.98..10276.71 rows=172456 width=47)
Hash Cond: ("outer".eventid = "inner".eventid)
-> XN Merge Join DS_DIST_NONE (cost=0.00..6286.47 rows=172456 width=30)
Merge Cond: ("outer".listid = "inner".listid)
-> XN Seq Scan on listing (cost=0.00..1924.97 rows=192497 width=14)
-> XN Seq Scan on sales (cost=0.00..1724.56 rows=172456 width=24)
-> XN Hash (cost=87.98..87.98 rows=8798 width=25)
-> XN Seq Scan on event (cost=0.00..87.98 rows=8798 width=25)
-> XN Hash (cost=2.02..2.02 rows=202 width=41)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
e0ef583356ac-10
|
-> XN Hash (cost=2.02..2.02 rows=202 width=41)
-> XN Seq Scan on venue (cost=0.00..2.02 rows=202 width=41)
-> XN Hash (cost=0.11..0.11 rows=11 width=10)
-> XN Seq Scan on category (cost=0.00..0.11 rows=11 width=10)
-> XN Hash (cost=3.65..3.65 rows=365 width=11)
-> XN Seq Scan on date (cost=0.00..3.65 rows=365 width=11)
-> XN Hash (cost=499.90..499.90 rows=49990 width=14)
-> XN Seq Scan on users (cost=0.00..499.90 rows=49990 width=14)
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_explain_plan_example.md
|
d2e731f99d9c-0
|
If you load your data in sort key order using a COPY command, you might reduce or even eliminate the need to vacuum\.
COPY automatically adds new rows to the table's sorted region when all of the following are true:
+ The table uses a compound sort key with only one sort column\.
+ The sort column is NOT NULL\.
+ The table is 100 percent sorted or empty\.
+ All the new rows are higher in sort order than the existing rows, including rows marked for deletion\. In this instance, Amazon Redshift uses the first eight bytes of the sort key to determine sort order\.
For example, suppose you have a table that records customer events using a customer ID and time\. If you sort on customer ID, it’s likely that the sort key range of new rows added by incremental loads will overlap the existing range, as shown in the previous example, leading to an expensive vacuum operation\.
If you set your sort key to a timestamp column, your new rows will be appended in sort order at the end of the table, as the following diagram shows, reducing or even eliminating the need to vacuum\.
![\[Image NOT FOUND\]](http://docs.aws.amazon.com/redshift/latest/dg/images/vacuum-unsorted-region-date-sort.png)
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/vacuum-load-in-sort-key-order.md
|
112193c7dd3c-0
|
The following table describes the important changes in each release of the *Amazon Redshift Database Developer Guide* after May 2018\. For notification about updates to this documentation, you can subscribe to an RSS feed\.
**API version: 2012\-12\-01**
**Latest documentation update: July 6, 2020**
For a list of the changes to the *Amazon Redshift Cluster Management Guide*, see [Amazon Redshift Cluster Management Guide Document History](https://docs.aws.amazon.com/redshift/latest/mgmt/document-history.html)\.
For more information about new features, including a list of fixes and the associated cluster version numbers for each release, see [Cluster Version History](http://docs.aws.amazon.com/redshift/latest/mgmt/rs-mgmt-cluster-version-notes.html)\.
| Change | Description | Date |
| --- |--- |--- |
| [Support for write to external table](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html) | You can write to external tables by running CREATE EXTERNAL TABLE AS SELECT to write to a new external table or INSERT INTO to insert data into an existing external table\. | June 5, 2020 |
| [Support for federated query general availability](https://docs.aws.amazon.com/redshift/latest/dg/federated-overview.html) | Updated information about querying data with federated queries\. | April 16, 2020 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-1
|
| [Support for additional spatial functions](https://docs.aws.amazon.com/redshift/latest/dg/spatial-functions.html) | Added descriptions of additional spatial functions\. | April 2, 2020 |
| [Support for materialized views general availability](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-overview.html) | Materialized views are generally available starting with cluster version 1\.0\.13059\. | February 19, 2020 |
| [Support for column\-level privileges](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html) | Column\-level privileges are available starting with cluster version 1\.0\.13059\. | February 19, 2020 |
| [ALTER TABLE](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html) | You can use an ALTER TABLE command with the ALTER DISTSTYLE ALL clause to change the distribution style of a table\. | February 11, 2020 |
| [Support for federated query](https://docs.aws.amazon.com/redshift/latest/dg/federated-overview.html) | Updated the guide to describe federated query with an updated CREATE EXTERNAL SCHEMA\. | December 3, 2019 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-2
|
| [Support for data lake export](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | Updated the guide to describe new parameters of the UNLOAD command\. | December 3, 2019 |
| [Support for spatial data](https://docs.aws.amazon.com/redshift/latest/dg/geospatial-overview.html) | Updated the guide to describe support for spatial data\. | November 21, 2019 |
| [Support for the new console](https://docs.aws.amazon.com/redshift/latest/dg/welcome.html) | Updated the guide to describe the new Amazon Redshift console\. | November 11, 2019 |
| [Support for automatic table sort](https://docs.aws.amazon.com/redshift/latest/dg/t_Reclaiming_storage_space202.html) | Amazon Redshift can automatically sort table data\. | November 7, 2019 |
| [Support for VACUUM BOOST option](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html) | You can use the BOOST option when vacuuming tables\. | November 7, 2019 |
| [Support for default IDENTITY columns](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html) | You can create tables with default IDENTITY columns\. | September 19, 2019 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-3
|
| [Support for AZ64 compression encoding](https://docs.aws.amazon.com/redshift/latest/dg/az64-encoding.html) | You can encode some columns with AZ64 compression encoding\. | September 19, 2019 |
| [Support for query priority](https://docs.aws.amazon.com/redshift/latest/dg/query-priority.html) | You can set the query priority of an automatic WLM queue\. | August 22, 2019 |
| [Support for AWS Lake Formation](https://docs.aws.amazon.com/redshift/latest/dg/spectrum-lake-formation.html) | You can use a Lake Formation Data Catalog with Amazon Redshift Spectrum\. | August 8, 2019 |
| [COMPUPDATE PRESET](https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-load.html) | You can use a COPY command with COMPUPDATE PRESET to enable Amazon Redshift to choose the compression encoding\. | June 13, 2019 |
| [ALTER COLUMN](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html) | You can use an ALTER TABLE command with ALTER COLUMN to increase the size of a VARCHAR column\. | May 22, 2019 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-4
|
| [Support for stored procedures](https://docs.aws.amazon.com/redshift/latest/dg/stored-procedure-overview.html) | You can define PL/pgSQL stored procedures in Amazon Redshift\. | April 24, 2019 |
| [Support for an automatic workload management \(WLM\) configuration](https://docs.aws.amazon.com/redshift/latest/dg/cm-c-implementing-workload-management.html) | You can enable Amazon Redshift to run with automatic WLM\. | April 24, 2019 |
| [UNLOAD to Zstandard](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | You can use the UNLOAD command to apply Zstandard compression to text and comma\-separated value \(CSV\) files unloaded to Amazon S3\. | April 3, 2019 |
| [Concurrency scaling](https://docs.aws.amazon.com/redshift/latest/dg/concurrency-scaling.html) | When concurrency scaling is enabled, Amazon Redshift automatically adds additional cluster capacity when you need it to process an increase in concurrent read queries\. | March 21, 2019 |
| [UNLOAD to CSV](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | You can use the UNLOAD command to unload to a file formatted as CSV text\. | March 13, 2019 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-5
|
| [AUTO distribution style](https://docs.aws.amazon.com/redshift/latest/dg/c_choosing_dist_sort.html) | To enable automatic distribution, you can specify the AUTO distribution style with a [CREATE TABLE](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html) statement\. When you enable automatic distribution, Amazon Redshift assigns an optimal distribution style based on the table data\. The change in distribution occurs in the background, in a few seconds\. | January 23, 2019 |
| [COPY from Parquet supports SMALLINT](#doc-history) | COPY now supports loading from Parquet formatted files into columns that use the SMALLINT data type\. For more information, see [COPY from Columnar Data Formats](https://docs.aws.amazon.com/redshift/latest/dg/copy-usage_notes-copy-from-columnar.html) | January 2, 2019 |
| [DROP EXTERNAL DATABASE](https://docs.aws.amazon.com/redshift/latest/dg/r_DROP_SCHEMA.html) | You can drop an external database by including the DROP EXTERNAL DATABASE clause with a [DROP SCHEMA](https://docs.aws.amazon.com/redshift/latest/dg/r_DROP_SCHEMA.html) command\. | December 3, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-6
|
| [Cross\-region UNLOAD](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | You can UNLOAD to an Amazon S3 bucket in another AWS Region by specifying the REGION parameter\. | October 31, 2018 |
| [Automatic vacuum delete](https://docs.aws.amazon.com/redshift/latest/dg/t_Reclaiming_storage_space202.html) | Amazon Redshift automatically runs a [VACUUM DELETE](https://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html) operation in the background, so you rarely, if ever, need to run a DELETE ONLY vacuum\. Amazon Redshift schedules the VACUUM DELETE to run during periods of reduced load and pauses the operation during periods of high load\. | October 31, 2018 |
| [Automatic distribution](https://docs.aws.amazon.com/redshift/latest/dg/c_choosing_dist_sort.html) | When you don't specify a distribution style with a [CREATE TABLE](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html) statement, Amazon Redshift assigns an optimal distribution style based on the table data\. The change in distribution occurs in the background, in a few seconds\. | October 31, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-7
|
| [Fine grained access control for the AWS Glue Data Catalog ](https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-iam-policies.html#c-spectrum-glue-acess) | You can now specify levels of access to data stored in the AWS Glue data catalog\. | October 15, 2018 |
| [UNLOAD with data types](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | You can specify the MANIFEST VERBOSE option with an [UNLOAD](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) command to add metadata to the manifest file, including the names and data types of columns, file sizes, and row counts\. | October 10, 2018 |
| [Add multiple partitions using a single ALTER TABLE statement](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html) | For Redshift Spectrum external tables, you can combine multiple PARTITION clauses in a single [ ALTER TABLE ADD](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html) statement\. For more information, see [Alter External Table Examples](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE_external-table.html)\. | October 10, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-8
|
| [UNLOAD with header](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) | You can specify the HEADER option with an [UNLOAD](https://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) command to add a header line containing column names at the top of each output file\. | September 19, 2018 |
| [New system table and views](https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_S3RETRIES.html) | [SVL\_S3Retries](https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_S3RETRIES.html), [SVL\_USER\_INFO](https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_USER_INFO.html), and [STL\_DISK\_FULL\_DIAG](https://docs.aws.amazon.com/redshift/latest/dg/r_STL_DISK_FULL_DIAG.html) documentation added\. | August 31, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-9
|
| [Support for nested data in Amazon Redshift Spectrum](https://docs.aws.amazon.com/redshift/latest/dg/tutorial-query-nested-data.html) | You can now query nested data stored in Amazon Redshift Spectrum tables\. For more information, see [Tutorial: Querying Nested Data with Amazon Redshift Spectrum](https://docs.aws.amazon.com/redshift/latest/dg/tutorial-query-nested-data.html)\. | August 8, 2018 |
| [SQA on by default](https://docs.aws.amazon.com/redshift/latest/dg/wlm-short-query-acceleration.html) | Short query acceleration \(SQA\) is now enabled by default for all new clusters\. SQA uses machine learning to provide higher performance, faster results, and better predictability of query execution times\. For more information, see [Short Query Acceleration](https://docs.aws.amazon.com/redshift/latest/dg/wlm-short-query-acceleration.html)\. | August 8, 2018 |
| [Amazon Redshift Advisor](https://docs.aws.amazon.com/redshift/latest/dg/advisor.html) | You can now get tailored recommendations on how to improve cluster performance and reduce operating costs from the Amazon Redshift Advisor\. For more information, see [Amazon Redshift Advisor](https://docs.aws.amazon.com/redshift/latest/dg/advisor.html)\. | July 26, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-10
|
| [Immediate alias reference](https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_list.html) | You can now refer to an aliased expression immediately after you define it\. For more information, see [SELECT List](https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_list.html)\. | July 18, 2018 |
| [Specify compression type when creating an external table](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters) | You can now specify compression type when creating an external table with Amazon Redshift Spectrum\. For more information, see [Create External Tables](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters)\. | June 27, 2018 |
| [PG\_LAST\_UNLOAD\_ID](https://docs.aws.amazon.com/redshift/latest/dg/PG_LAST_UNLOAD_ID.html) | Documentation added for a new System Information function: PG\_LAST\_UNLOAD\_ID\. For more information, see [PG\_LAST\_UNLOAD\_ID](https://docs.aws.amazon.com/redshift/latest/dg/PG_LAST_UNLOAD_ID.html)\. | June 27, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
112193c7dd3c-11
|
| [ALTER TABLE RENAME COLUMN](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE_external-table.html) | ALTER TABLE now supports renaming columns for external tables\. For more information, see [Alter External Table Examples](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE_external-table.html)\. | June 7, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-0
|
The following table describes the important changes in each release of the *Amazon Redshift Database Developer Guide* before June 2018\.
****
| Change | Description | Date changed |
| --- | --- | --- |
| COPY from Parquet includes SMALLINT | COPY now supports loading from Parquet formatted files into columns that use the SMALLINT data type\. For more information, see [COPY from columnar data formats](copy-usage_notes-copy-from-columnar.md) | January 2, 2019 |
| COPY from columnar formats | COPY now supports loading from files on Amazon S3 that use Parquet and ORC columnar data formats\. For more information, see [COPY from columnar data formats](copy-usage_notes-copy-from-columnar.md) | May 17, 2018 |
| Dynamic maximum run time for SQA | By default, workload management \(WLM\) now dynamically assigns a value for the short query acceleration \(SQA\) maximum run time based on analysis of your cluster's workload\. For more information, see [Maximum runtime for short queries](wlm-short-query-acceleration.md#wlm-sqa-max-run-time)\. | May 17, 2018 |
| New column in STL\_LOAD\_COMMITS | The [STL\_LOAD\_COMMITS](r_STL_LOAD_COMMITS.md) system table has a new column, `file_format`\. | May 10, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-1
|
| New columns in STL\_HASHJOIN and other system log tables | The [STL\_HASHJOIN](r_STL_HASHJOIN.md) system table has three new columns, `hash_segment`, `hash_step`, and `checksum`\. Also, a `checksum` was added to STL\_MERGEJOIN, STL\_NESTLOOP, STL\_HASH, STL\_SCAN, STL\_SORT, STL\_LIMIT, and STL\_PROJECT\. | May 17, 2018 |
| New columns in STL\_AGGR | The [STL\_AGGR](r_STL_AGGR.md) system table has two new columns, `resizes` and `flushable`\. | April 19, 2018 |
| New options for REGEX functions | For the [REGEXP\_INSTR](REGEXP_INSTR.md) and [REGEXP\_SUBSTR](REGEXP_SUBSTR.md) functions, you can now specify which occurence of a match to use and whether to perform a case\-sensitive match\. REGEXP\_INSTR also allows you specify whether to return the position of the first character of the match or the position of the first character following the end of the match\. | March 22, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-2
|
| New columns in system tables | The tombstonedblocks, tossedblocks, and batched\_by columns were added to the [STL\_COMMIT\_STATS](r_STL_COMMIT_STATS.md) system table\. The localslice column was added to the [STV\_SLICES](r_STV_SLICES.md) system view\. | March 22, 2018 |
| Add and drop columns in external tables | [ALTER TABLE](r_ALTER_TABLE.md) now supports ADD COLUMN and DROP COLUMN for Amazon Redshift Spectrum external tables\. | March 22, 2018 |
| Amazon Redshift Spectrum new AWS Regions | Redshift Spectrum is now available in the Mumbai and São Paulo Regions\. For a list of supported Regions, see [Amazon Redshift Spectrum Regions](c-using-spectrum.md#c-spectrum-regions)\. | March 22, 2018 |
| Table limit increased to 20,000 | The maximum number of tables is now 20,000 for 8xlarge cluster node types\. The limit for large and xlarge node types is 9,900\. For more information, see [Limits and quotas](r_CREATE_TABLE_usage.md#r_CREATE_TABLE_usage-limits)\. | March 13, 2018 |
| Amazon Redshift Spectrum support for JSON and Ion | Using Redshift Spectrum, you can reference files with scalar data in JSON or Ion data formats\. For more information, see [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md)\. | February 26, 2018 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-3
|
| IAM role chaining for Amazon Redshift Spectrum | You can chain AWS Identity and Access Management \(IAM\) roles so that your cluster can assume other roles not attached to the cluster, including roles belonging to another AWS account\. For more information, see [Chaining IAM roles in Amazon Redshift Spectrum](c-spectrum-iam-policies.md#c-spectrum-chaining-roles)\. | February 1, 2018 |
| ADD PARTITION supports IF NOT EXISTS | The ADD PARTITION clause for ALTER TABLE now supports an IF NOT EXISTS option\. For more information, see [ALTER TABLE](r_ALTER_TABLE.md)\. | January 11, 2018 |
| DATE data for external tables | Amazon Redshift Spectrum external tables now support the DATE data type\. For more information, see [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md)\. | January 11, 2018 |
| Amazon Redshift Spectrum new AWS Regions | Redshift Spectrum is now available in the Singapore, Sydney, Seoul, and Frankfurt Regions\. For a list of supported AWS Regions, see [Amazon Redshift Spectrum Regions](c-using-spectrum.md#c-spectrum-regions)\. | November 16, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-4
|
| Short query acceleration in Amazon Redshift workload management \(WLM\) | Short query acceleration \(SQA\) prioritizes selected short\-running queries ahead of longer\-running queries\. SQA executes short\-running queries in a dedicated space, so that SQA queries aren't forced to wait in queues behind longer queries\. With SQA, short\-running queries begin executing more quickly and users see results sooner\. For more information, see [Working with short query acceleration](wlm-short-query-acceleration.md)\. | November 16, 2017 |
| WLM reassigns hopped queries | Instead of canceling and restarting a hopped query, Amazon Redshift workload management \(WLM\) now reassigns eligible queries to a new queue\. When WLM reassigns a query, it moves the query to the new queue and continues execution, which saves time and system resources\. Hopped queries that are not eligible to be reassigned are restarted or canceled\. For more information, see [WLM query queue hopping](wlm-queue-hopping.md)\. | November 16, 2017 |
| System log access for users | In most system log tables that are visible to users, rows generated by another user are invisible to a regular user by default\. To permit a regular user to see all rows in user\-visible tables, including rows generated by another user, run [ALTER USER](r_ALTER_USER.md) or [CREATE USER](r_CREATE_USER.md) and set the [SYSLOG ACCESS](r_ALTER_USER.md#alter-user-syslog-access) parameter to UNRESTRICTED\. | November 16, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-5
|
| Result caching | With [ Result caching ](c_challenges_achieving_high_performance_queries.md#result-caching), when you run a query Amazon Redshift caches the result\. When you run the query again, Amazon Redshift checks for a valid, cached copy of the query result\. If a match is found in the result cache, Amazon Redshift uses the cached result and doesn't execute the query\. Result caching is enabled by default\. To disable result caching, set the [enable\_result\_cache\_for\_session](r_enable_result_cache_for_session.md) configuration parameter to off\. | November 16, 2017 |
| Column metadata functions | [PG\_GET\_COLS](PG_GET_COLS.md) and [PG\_GET\_LATE\_BINDING\_VIEW\_COLS](PG_GET_LATE_BINDING_VIEW_COLS.md) return column metadata for Amazon Redshift tables, views, and late\-binding views\. | November 16, 2017 |
| WLM queue hopping for CTAS | Amazon Redshift workload management \(WLM\) now supports query queue hopping for [CREATE TABLE AS](r_CREATE_TABLE_AS.md) \(CTAS\) statements as well as read\-only queries, such as SELECT statements\. For more information, see [WLM query queue hopping](wlm-queue-hopping.md)\. | October 19, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-6
|
| Amazon Redshift Spectrum manifest files | When you create a Redshift Spectrum external table, you can specify a manifest file that lists the locations of data files on Amazon S3\. For more information, see [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md)\. | October 19, 2017 |
| Amazon Redshift Spectrum new AWS Regions | Redshift Spectrum is now available in the EU \(Ireland\) and Asia Pacific \(Tokyo\) Regions\. For a list of supported AWS Regions, see [Amazon Redshift Spectrum considerations](c-using-spectrum.md#c-spectrum-considerations)\. | October 19, 2017 |
| Amazon Redshift Spectrum added file formats | You can now create Redshift Spectrum external tables based on Regex, OpenCSV, and Avro data file formats\. For more information, see [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md)\. | October 5, 2017 |
| Pseudocolumns for Amazon Redshift Spectrum external tables | You can select the $path and $size pseudocolumns in a Redshift Spectrum external table to view the location and size of the referenced data files in Amazon S3\. For more information, see [Pseudocolumns](c-spectrum-external-tables.md#c-spectrum-external-tables-pseudocolumns)\. | October 5, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-7
|
| Functions to validate JSON | You can use the [IS\_VALID\_JSON](IS_VALID_JSON.md) and [IS\_VALID\_JSON\_ARRAY](IS_VALID_JSON_ARRAY.md) functions to check for valid JSON formatting\. The other JSON functions now have an optional null\_if\_invalid argument\. | October 5, 2017 |
| LISTAGG DISTINCT | You can use the DISTINCT clause with the [LISTAGG](r_LISTAGG.md) aggregate function and the [LISTAGG](r_WF_LISTAGG.md) window function to eliminate duplicate values from the specified expression before concatenating\. | October 5, 2017 |
| View column names in uppercase | To view column names in SELECT results in uppercase, you can set the [describe\_field\_name\_in\_uppercase](r_describe_field_name_in_uppercase.md) configuration parameter to true\. | October 5, 2017 |
| Skip header lines in external tables | You can set the skip\.header\.line\.count property in the [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md) command to skip header lines at the beginning of Redshift Spectrum data files\. | October 5, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-8
|
| Scan row count | WLM query monitor rules uses the scan\_row\_count metric to return the number of rows in a scan step\. The row count is the total number of rows emitted before filtering rows marked for deletion \(ghost rows\) and before applying user\-defined query filters\. For more information, see [Query monitoring metrics](cm-c-wlm-query-monitoring-rules.md#cm-c-wlm-query-monitoring-metrics)\. | September 21, 2017 |
| SQL user\-defined functions | A scalar SQL user\-defined function \(UDF\) incorporates a SQL SELECT clause that executes when the function is called and returns a single value\. For more information, see [Creating a scalar SQL UDF](udf-creating-a-scalar-sql-udf.md)\. | August 31, 2017 |
| Late\-binding views | A late\-binding view is not bound to the underlying database objects, such as tables and user\-defined functions\. As a result, there is no dependency between the view and the objects it references\. You can create a view even if the referenced objects don't exist\. Because there is no dependency, you can drop or alter a referenced object without affecting the view\. Amazon Redshift doesn't check for dependencies until the view is queried\. To create a late\-binding view, specify the WITH NO SCHEMA BINDING clause with your CREATE VIEW statement\. For more information, see [CREATE VIEW](r_CREATE_VIEW.md)\. | August 31, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-9
|
| OCTET\_LENGTH function | [OCTET\_LENGTH](r_OCTET_LENGTH.md) returns the length of the specified string as the number of bytes\. | August 18, 2017 |
| ORC and Grok files types supported | Amazon Redshift Spectrum now supports the ORC and Grok data formats for Redshift Spectrum data files\. For more information, see [Creating data files for queries in Amazon Redshift Spectrum](c-spectrum-data-files.md)\. | August 18, 2017 |
| RegexSerDe now supported | Amazon Redshift Spectrum now supports the RegexSerDe data format\. For more information, see [Creating data files for queries in Amazon Redshift Spectrum](c-spectrum-data-files.md)\. | July 19, 2017 |
| New columns added to SVV\_TABLES and SVV\_COLUMNS | The columns domain\_name and remarks were added to [SVV\_COLUMNS](r_SVV_COLUMNS.md)\. A remarks column was added to [SVV\_TABLES](r_SVV_TABLES.md)\. | July 19, 2017 |
| SVV\_TABLES and SVV\_COLUMNS system views | The [SVV\_TABLES](r_SVV_TABLES.md) and [SVV\_COLUMNS](r_SVV_COLUMNS.md) system views provide information about columns and other details for local and external tables and views\. | July 7, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-10
|
| VPC no longer required for Amazon Redshift Spectrum with Amazon EMR Hive metastore | Redshift Spectrum removed the requirement that the Amazon Redshift cluster and the Amazon EMR cluster must be in the same VPC and the same subnet when using an Amazon EMR Hive metastore\. For more information, see [Working with external catalogs in Amazon Redshift Spectrum](c-spectrum-external-schemas.md#c-spectrum-external-catalogs)\. | July 7, 2017 |
| UNLOAD to smaller file sizes | By default, UNLOAD creates multiple files on Amazon S3 with a maximum size of 6\.2 GB\. To create smaller files, specify the MAXFILESIZE with the UNLOAD command\. You can specify a maximum file size between 5 MB and 6\.2 GB\. For more information, see [UNLOAD](r_UNLOAD.md)\. | July 7, 2017 |
| TABLE PROPERTIES | You can now set the TABLE PROPERTIES numRows parameter for [CREATE EXTERNAL TABLE](r_CREATE_EXTERNAL_TABLE.md) or [ALTER TABLE](r_ALTER_TABLE.md) to update table statistics to reflect the number of rows in the table\. | June 6, 2017 |
| ANALYZE PREDICATE COLUMNS | To save time and cluster resources, you can choose to analyze only the columns that are likely to be used as predicates\. When you run ANALYZE with the PREDICATE COLUMNS clause, the analyze operation includes only columns that have been used in a join, filter condition, or group by clause, or are used as a sort key or distribution key\. For more information, see [Analyzing tables](t_Analyzing_tables.md)\. | May 25, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-11
|
| IAM policies for Amazon Redshift Spectrum | To grant access to an Amazon S3 bucket only using Redshift Spectrum, you can include a condition that allows access for the user agent "AWS Redshift/Spectrum"\. For more information, see [IAM policies for Amazon Redshift Spectrum](c-spectrum-iam-policies.md)\. | May 25, 2017 |
| Amazon Redshift Spectrum Recursive Scan | Redshift Spectrum now scans files in subfolders as well as the specified folder in Amazon S3\. For more information, see [Creating external tables for Amazon Redshift Spectrum](c-spectrum-external-tables.md)\. | May 25, 2017 |
| Query monitoring rules | Using WLM query monitoring rules, you can define metrics\-based performance boundaries for WLM queues and specify what action to take when a query goes beyond those boundaries—log, hop, or abort\. You define query monitoring rules as part of your workload management \(WLM\) configuration\. For more information, see [WLM query monitoring rules](cm-c-wlm-query-monitoring-rules.md)\. | April 21, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-12
|
| Amazon Redshift Spectrum | Using Redshift Spectrum, you can efficiently query and retrieve data from files in Amazon S3 without having to load the data into tables\. Redshift Spectrum queries execute very fast against large datasets because Redshift Spectrum scans the data files directly in Amazon S3\. Much of the processing occurs in the Amazon Redshift Spectrum layer, and most of the data remains in Amazon S3\. Multiple clusters can concurrently query the same dataset on Amazon S3 without the need to make copies of the data for each cluster\. For more information, see [Querying external data using Amazon Redshift Spectrum](c-using-spectrum.md) | April 19, 2017 |
| New system tables to support Redshift Spectrum | The following new system views have been added to support Redshift Spectrum: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/doc-history.html) | April 19, 2017 |
| APPROXIMATE PERCENTILE\_DISC aggregate function | The [APPROXIMATE PERCENTILE\_DISC](r_APPROXIMATE_PERCENTILE_DISC.md) aggregate function is now available\. | April 4, 2017 |
| Server\-side encryption with KMS | You can now unload data to Amazon S3 using server\-side encryption with an AWS Key Management Service key \(SSE\-KMS\)\. In addition, [COPY](r_COPY.md) now transparently loads KMS\-encrypted data files from Amazon S3\. For more information, see [UNLOAD](r_UNLOAD.md)\. | February 9, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-13
|
| New authorization syntax | You can now use the IAM\_ROLE, MASTER\_SYMMETRIC\_KEY, ACCESS\_KEY\_ID, SECRET\_ACCESS\_KEY, and SESSION\_TOKEN parameters to provide authorization and access information for COPY, UNLOAD, and CREATE LIBRARY commands\. The new authorization syntax provides a more flexible alternative to providing a single string argument to the CREDENTIALS parameter\. For more information, see [Authorization parameters](copy-parameters-authorization.md)\. | February 9, 2017 |
| Schema limit increase | You can now create up to 9,900 schemas per cluster\. For more information, see [CREATE SCHEMA](r_CREATE_SCHEMA.md)\. | February 9, 2017 |
| Default table encoding | [CREATE TABLE](r_CREATE_TABLE_NEW.md) and [ALTER TABLE](r_ALTER_TABLE.md) now assign LZO compression encoding to most new columns\. Columns defined as sort keys, columns that are defined as BOOLEAN, REAL, or DOUBLE PRECISION data types, and temporary tables are assigned RAW encoding by default\. For more information, see [ENCODE](r_CREATE_TABLE_NEW.md#create-table-encode)\. | February 6, 2017 |
| ZSTD compression encoding | Amazon Redshift now supports [ZSTD](zstd-encoding.md) column compression encoding\. | January 19, 2017 |
| PERCENTILE\_CONT and MEDIAN aggregate functions | [PERCENTILE\_CONT](r_PERCENTILE_CONT.md) and [MEDIAN](r_MEDIAN.md) are now available as aggregate functions as well as window functions\. | January 19, 2017 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-14
|
| User\-defined function \(UDF\) User Logging | You can use the Python logging module to create user\-defined error and warning messages in your UDFs\. Following query execution, you can query the [SVL\_UDF\_LOG](r_SVL_UDF_LOG.md) system view to retrieve logged messages\. For more information about user\-defined messages, see [Logging errors and warnings in UDFs](udf-logging-messages.md) | December 8, 2016 |
| ANALYZE COMPRESSION estimated reduction | The ANALYZE COMPRESSION command now reports an estimate for percentage reduction in disk space for each column\. For more information, see [ANALYZE COMPRESSION](r_ANALYZE_COMPRESSION.md)\. | November 10, 2016 |
| Connection limits | You can now set a limit on the number of database connections a user is permitted to have open concurrently\. You can also limit the number of concurrent connections for a database\. For more information, see [CREATE USER](r_CREATE_USER.md) and [CREATE DATABASE](r_CREATE_DATABASE.md)\. | November 10, 2016 |
| COPY sort order enhancement | COPY now automatically adds new rows to the table's sorted region when you load your data in sort key order\. For specific requirements to enable this enhancement, see [Loading your data in sort key order](vacuum-load-in-sort-key-order.md) | November 10, 2016 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-15
|
| CTAS with compression | CREATE TABLE AS \(CTAS\) now automatically assigns compression encodings to new tables based on the column's data type\. For more information, see [Inheritance of column and table attributes](r_CTAS_usage_notes.md#r_CTAS_usage_notes-inheritance-of-column-and-table-attributes)\. | October 28, 2016 |
| Time stamp with time zone data type | Amazon Redshift now supports a time stamp with time zone \([TIMESTAMPTZ](r_Datetime_types.md#r_Datetime_types-timestamptz)\) data type\. Also, several new functions have been added to support the new data type\. For more information, see [Date and time functions](Date_functions_header.md)\. | September 29, 2016 |
| Analyze threshold | To reduce processing time and improve overall system performance for [ANALYZE](r_ANALYZE.md) operations, Amazon Redshift skips analyzing a table if the percentage of rows that have changed since the last ANALYZE command run is lower than the analyze threshold specified by the [analyze\_threshold\_percent](r_analyze_threshold_percent.md) parameter\. By default, analyze\_threshold\_percent is 10\. | August 9, 2016 |
| New STL\_RESTARTED\_SESSIONS system table | When Amazon Redshift restarts a session, [STL\_RESTARTED\_SESSIONS](r_STL_RESTARTED_SESSIONS.md) records the new process ID \(PID\) and the old PID\. | August 9, 2016 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-16
|
| Updated the Date and Time Functions documentation | Added a summary of functions with links to the [Date and time functions](Date_functions_header.md), and updated the function references for consistency\. | June 24, 2016 |
| New columns in STL\_CONNECTION\_LOG | The [STL\_CONNECTION\_LOG](r_STL_CONNECTION_LOG.md) system table has two new columns to track SSL connections\. If you routinely load audit logs to an Amazon Redshift table, you will need to add the following new columns to the target table: sslcompression and sslexpansion\. | May 5, 2016 |
| MD5\-hash password | You can specify the password for a [CREATE USER](r_CREATE_USER.md) or [ALTER USER](r_ALTER_USER.md) command by supplying the MD5\-hash string of the password and user name\. | April 21, 2016 |
| New column in STV\_TBL\_PERM | The backup column in the [STV\_TBL\_PERM](r_STV_TBL_PERM.md) system view indicates whether the table is included in cluster snapshots\. For more information, see [BACKUP](r_CREATE_TABLE_NEW.md#create-table-backup)\. | April 21, 2016 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-17
|
| No\-backup tables | For tables, such as staging tables, that won't contain critical data, you can specify BACKUP NO in your [CREATE TABLE](r_CREATE_TABLE_NEW.md) or [CREATE TABLE AS](r_CREATE_TABLE_AS.md) statement to prevent Amazon Redshift from including the table in automated or manual snapshots\. Using no\-backup tables saves processing time when creating snapshots and restoring from snapshots and reduces storage space on Amazon S3\. | April 7, 2016 |
| VACUUM delete threshold | By default, the [VACUUM](r_VACUUM_command.md) command now reclaims space such that at least 95 percent of the remaining rows are not marked for deletion\. As a result, VACUUM usually needs much less time for the delete phase compared to reclaiming 100 percent of deleted rows\. You can change the default threshold for a single table by including the TO threshold PERCENT parameter when you run the VACUUM command\. | April 7, 2016 |
| SVV\_TRANSACTIONS system table | The [SVV\_TRANSACTIONS](r_SVV_TRANSACTIONS.md) system view records information about transactions that currently hold locks on tables in the database\. | April 7, 2016 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-18
|
| Using IAM roles to access other AWS resources | To move data between your cluster and another AWS resource, such as Amazon S3, Amazon DynamoDB, Amazon EMR, or Amazon EC2, your cluster must have permission to access the resource and perform the necessary actions\. As a more secure alternative to providing an access key pair with COPY, UNLOAD, or CREATE LIBRARY commands, you can now you specify an IAM role that your cluster uses for authentication and authorization\. For more information, see [Role\-based access control](copy-usage_notes-access-permissions.md#copy-usage_notes-access-role-based)\. | March 29, 2016 |
| VACUUM sort threshold | The VACUUM command now skips the sort phase for any table where more than 95 percent of the table's rows are already sorted\. You can change the default sort threshold for a single table by including the TO threshold PERCENT parameter when you run the [VACUUM](r_VACUUM_command.md) command\. | March 17, 2016 |
| New columns in STL\_CONNECTION\_LOG | The [STL\_CONNECTION\_LOG](r_STL_CONNECTION_LOG.md) system table has three new columns\. If you routinely load audit logs to an Amazon Redshift table, you will need to add the following new columns to the target table: sslversion, sslcipher, and mtu\. | March 17, 2016 |
| UNLOAD with bzip2 compression | You now have the option to [UNLOAD](r_UNLOAD.md) using bzip2 compression\. | February 8, 2016 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-19
|
| ALTER TABLE APPEND | [ALTER TABLE APPEND](r_ALTER_TABLE_APPEND.md) appends rows to a target table by moving data from an existing source table\. ALTER TABLE APPEND is usually much faster than a similar [CREATE TABLE AS](r_CREATE_TABLE_AS.md) or [INSERT](r_INSERT_30.md) INTO operation because data is moved, not duplicated\. | February 8, 2016 |
| WLM query queue hopping | If workload management \(WLM\) cancels a read\-only query, such as a SELECT statement, due to a WLM timeout, WLM attempts to route the query to the next matching queue\. For more information, see [WLM query queue hopping](wlm-queue-hopping.md) | January 7, 2016 |
| ALTER DEFAULT PRIVILEGES | You can use the [ALTER DEFAULT PRIVILEGES](r_ALTER_DEFAULT_PRIVILEGES.md) command to define the default set of access privileges to be applied to objects that are created in the future by the specified user\. | December 10, 2015 |
| bzip2 file compression | The [COPY](r_COPY.md) command supports loading data from files that were compressed using bzip2\. | December 10, 2015 |
| NULLS FIRST and NULLS LAST | You can specify whether an ORDER BY clause should rank NULLS first or last in the result set\. For more information, see [ORDER BY clause](r_ORDER_BY_clause.md) and [Window function syntax summary](r_Window_function_synopsis.md)\. | November 19, 2015 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-20
|
| REGION keyword for CREATE LIBRARY | If the Amazon S3 bucket that contains the UDF library files does not reside in the same AWS Region as your Amazon Redshift cluster, you can use the REGION option to specify the region in which the data is located\. For more information, see [CREATE LIBRARY](r_CREATE_LIBRARY.md)\. | November 19, 2015 |
| User\-defined scalar functions \(UDFs\) | You can now create custom user\-defined scalar functions to implement non\-SQL processing functionality provided either by Amazon Redshift\-supported modules in the Python 2\.7 Standard Library or your own custom UDFs based on the Python programming language\. For more information, see [Creating user\-defined functions](user-defined-functions.md)\. | September 11, 2015 |
| Dynamic properties in WLM configuration | The WLM configuration parameter now supports applying some properties dynamically\. Other properties remain static changes and require that associated clusters be rebooted so that the configuration changes can be applied\. For more information, see [WLM dynamic and static configuration properties](cm-c-wlm-dynamic-properties.md) and [Implementing workload management](cm-c-implementing-workload-management.md)\. | August 3, 2015 |
| LISTAGG function | The [LISTAGG function](r_LISTAGG.md) and [LISTAGG window function](r_WF_LISTAGG.md) return a string created by concatenating a set of column values\. | July 30, 2015 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-21
|
| Deprecated parameter | The *max\_cursor\_result\_set\_size* configuration parameter is deprecated\. The size of cursor result sets are constrained based on the cluster's node type\. For more information, see [Cursor constraints](declare.md#declare-constraints)\. | July 24, 2015 |
| Revised COPY command documentation | The [COPY](r_COPY.md) command reference has been extensively revised to make the material friendlier and more accessible\. | July 15, 2015 |
| COPY from Avro format | The [COPY](r_COPY.md) command supports loading data in Avro format from data files on Amazon S3, Amazon EMR, and from remote hosts using SSH\. For more information, see [AVRO](copy-parameters-data-format.md#copy-avro) and [Copy from Avro examples](r_COPY_command_examples.md#r_COPY_command_examples-copy-from-avro)\. | July 8, 2015 |
| STV\_STARTUP\_RECOVERY\_STATE | The [STV\_STARTUP\_RECOVERY\_STATE](r_STV_STARTUP_RECOVERY_STATE.md) system table records the state of tables that are temporarily locked during cluster restart operations\. Amazon Redshift places a temporary lock on tables while they are being processed to resolve stale transactions following a cluster restart\. | May 25, 2015 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-22
|
| ORDER BY optional for ranking functions | The ORDER BY clause is now optional for certain window ranking functions\. For more information, see [CUME\_DIST window function](r_WF_CUME_DIST.md), [DENSE\_RANK window function](r_WF_DENSE_RANK.md), [RANK window function](r_WF_RANK.md), [NTILE window function](r_WF_NTILE.md), [PERCENT\_RANK window function](r_WF_PERCENT_RANK.md), and [ROW\_NUMBER window function](r_WF_ROW_NUMBER.md)\. | May 25, 2015 |
| Interleaved sort keys | Interleaved sort keys give equal weight to each column in the sort key\. Using interleaved sort keys instead of the default compound keys significantly improves performance for queries that use restrictive predicates on secondary sort columns, especially for large tables\. Interleaved sorting also improves overall performance when multiple queries filter on different columns in the same table\. For more information, see [Choosing sort keys](t_Sorting_data.md) and [CREATE TABLE](r_CREATE_TABLE_NEW.md)\. | May 11, 2015 |
| Revised tuning query performance topic | [Tuning query performance](c-optimizing-query-performance.md) has been expanded to include new queries for analyzing query performance and more examples\. Also, the topic has been revised to be clearer and more complete\. [Amazon Redshift best practices for designing queries](c_designing-queries-best-practices.md) has more information about how to write queries to improve performance\. | March 23, 2015 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-23
|
| SVL\_QUERY\_QUEUE\_INFO | The [SVL\_QUERY\_QUEUE\_INFO](r_SVL_QUERY_QUEUE_INFO.md) view summarizes details for queries that spent time in a WLM query queue or commit queue\. | February 19, 2015 |
| SVV\_TABLE\_INFO | You can use the [SVV\_TABLE\_INFO](r_SVV_TABLE_INFO.md) view to diagnose and address table design issues that can influence query performance, including issues with compression encoding, distribution keys, sort style, data distribution skew, table size, and statistics\. | February 19, 2015 |
| UNLOAD uses server\-side file encryption | The [UNLOAD](r_UNLOAD.md) command now automatically uses Amazon S3 server\-side encryption \(SSE\) to encrypt all unload data files\. Server\-side encryption adds another layer of data security with little or no change in performance\. | October 31, 2014 |
| CUME\_DIST window function | The [CUME\_DIST window function](r_WF_CUME_DIST.md) calculates the cumulative distribution of a value within a window or partition\. | October 31, 2014 |
| MONTHS\_BETWEEN function | The [MONTHS\_BETWEEN function](r_MONTHS_BETWEEN_function.md) determines the number of months between two dates\. | October 31, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-24
|
| NEXT\_DAY function | The [NEXT\_DAY function](r_NEXT_DAY.md) returns the date of the first instance of a specified day that is later than the given date\. | October 31, 2014 |
| PERCENT\_RANK window function | The [PERCENT\_RANK window function](r_WF_PERCENT_RANK.md) calculates the percent rank of a given row\. | October 31, 2014 |
| RATIO\_TO\_REPORT window function | The [RATIO\_TO\_REPORT window function](r_WF_RATIO_TO_REPORT.md) calculates the ratio of a value to the sum of the values in a window or partition\. | October 31, 2014 |
| TRANSLATE function | The [TRANSLATE function](r_TRANSLATE.md) replaces all occurrences of specified characters within a given expression with specified substitutes\. | October 31, 2014 |
| NVL2 function | The [NVL2 expression](r_NVL2.md) returns one of two values based on whether a specified expression evaluates to NULL or NOT NULL\. | October 16, 2014 |
| MEDIAN window function | The [MEDIAN window function](r_WF_MEDIAN.md) calculates the median value for the range of values in a window or partition\. | October 16, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-25
|
| ON ALL TABLES IN SCHEMA schema\_name clause for GRANT and REVOKE commands | The [GRANT](r_GRANT.md) and [REVOKE](r_REVOKE.md) commands have been updated with an ON ALL TABLES IN SCHEMA schema\_name clause\. This clause allows you to use a single command to change privileges for all tables in a schema\. | October 16, 2014 |
| IF EXISTS clause for DROP SCHEMA, DROP TABLE, DROP USER, and DROP VIEW commands | The [DROP SCHEMA](r_DROP_SCHEMA.md), [DROP TABLE](r_DROP_TABLE.md), [DROP USER](r_DROP_USER.md), and [DROP VIEW](r_DROP_VIEW.md) commands have been updated with an IF EXISTS clause\. This clause causes the command to make no changes and return a message rather than terminating with an error if the specified object doesn’t exist\. | October 16, 2014 |
| IF NOT EXISTS clause for CREATE SCHEMA and CREATE TABLE commands | The [CREATE SCHEMA](r_CREATE_SCHEMA.md) and [CREATE TABLE](r_CREATE_TABLE_NEW.md) commands have been updated with an IF NOT EXISTS clause\. This clause causes the command to make no changes and return a message rather than terminating with an error if the specified object already exists\. | October 16, 2014 |
| COPY support for UTF\-16 encoding | The COPY command now supports loading from data files that use UTF\-16 encoding as well as UTF\-8 encoding\. For more information, see [ENCODING](copy-parameters-data-conversion.md#copy-encoding)\. | September 29, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-26
|
| New workload management tutorial | [Tutorial: Configuring manual workload management \(WLM\) queues](tutorial-configuring-workload-management.md) walks you through the process of configuring Workload Management \(WLM\) queues to improve query processing and resource allocation\. | September 25, 2014 |
| AES 128\-bit encryption | The COPY command now supports AES 128\-bit encryption as well as AES 256\-bit encryption when loading from data files encrypted using Amazon S3 client\-side encryption\. For more information, see [Loading encrypted data files from Amazon S3](c_loading-encrypted-files.md)\. | September 29, 2014 |
| PG\_LAST\_UNLOAD\_COUNT function | The PG\_LAST\_UNLOAD\_COUNT function returns the number of rows that were processed in the most recent UNLOAD operation\. For more information, see [PG\_LAST\_UNLOAD\_COUNT](PG_LAST_UNLOAD_COUNT.md)\. | September 15, 2014 |
| New troubleshooting queries section | [Troubleshooting queries](queries-troubleshooting.md) provides a quick reference for identifying and addressing some of the most common and most serious issues you are likely to encounter with Amazon Redshift queries\. | July 7, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-27
|
| New loading data tutorial | [Tutorial: Loading data from Amazon S3](tutorial-loading-data.md) walks you through the process of loading data into your Amazon Redshift database tables from data files in an Amazon S3 bucket, from beginning to end\. | July 1, 2014 |
| PERCENTILE\_CONT window function | [PERCENTILE\_CONT window function](r_WF_PERCENTILE_CONT.md) is an inverse distribution function that assumes a continuous distribution model\. It takes a percentile value and a sort specification, and returns an interpolated value that would fall into the given percentile value with respect to the sort specification\. | June 30, 2014 |
| PERCENTILE\_DISC window function | [PERCENTILE\_DISC window function](r_WF_PERCENTILE_DISC.md) is an inverse distribution function that assumes a discrete distribution model\. It takes a percentile value and a sort specification and returns an element from the set\. | June 30, 2014 |
| GREATEST and LEAST functions | The [GREATEST and LEAST](r_GREATEST_LEAST.md) functions return the largest or smallest value from a list of expressions\. | June 30, 2014 |
| Cross\-region COPY | The [COPY](r_COPY.md) command supports loading data from an Amazon S3 bucket or Amazon DynamoDB table that is located in a different region than the Amazon Redshift cluster\. For more information, see [REGION](copy-parameters-data-source-s3.md#copy-region) in the COPY command reference\. | June 30, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-28
|
| Best Practices expanded | [Amazon Redshift best practices](best-practices.md) has been expanded, reorganized, and moved to the top of the navigation hierarchy to make it more discoverable\. | May 28, 2014 |
| UNLOAD to a single file | The [UNLOAD](r_UNLOAD.md) command can optionally unload table data serially to a single file on Amazon S3 by adding the PARALLEL OFF option\. If the size of the data is greater than the maximum file size of 6\.2 GB, UNLOAD creates additional files\. | May 6, 2014 |
| REGEXP functions | The [REGEXP\_COUNT](REGEXP_COUNT.md), [REGEXP\_INSTR](REGEXP_INSTR.md), and [REGEXP\_REPLACE](REGEXP_REPLACE.md) functions manipulate strings based on regular expression pattern matching\. | May 6, 2014 |
| New Tutorial | The new [Tutorial: Tuning table design](tutorial-tuning-tables.md) walks you through the steps to optimize the design of your tables, including testing load and query performance before and after tuning\. | May 2, 2014 |
| COPY from Amazon EMR | The [COPY](r_COPY.md) command supports loading data directly from Amazon EMR clusters\. For more information, see [Loading data from Amazon EMR](loading-data-from-emr.md)\. | April 18, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-29
|
| WLM concurrency limit increase | You can now configure workload management \(WLM\) to run up to 50 queries concurrently in user\-defined query queues\. This increase gives users more flexibility for managing system performance by modifying WLM configurations\. For more information, see [Implementing manual WLM](cm-c-defining-query-queues.md) | April 18, 2014 |
| New configuration parameter to manage cursor size | The `max_cursor_result_set_size` configuration parameter defines the maximum size of data, in megabytes, that can be returned per cursor result set of a larger query\. This parameter value also affects the number of concurrent cursors for the cluster, enabling you to configure a value that increases or decreases the number of cursors for your cluster\. For more information, see [DECLARE](declare.md) in this guide and [Configure Maximum Size of a Cursor Result Set](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html#max-cursor-result-set-size-param) in the *Amazon Redshift Cluster Management Guide*\. | March 28, 2014 |
| COPY from JSON format | The [COPY](r_COPY.md) command supports loading data in JSON format from data files on Amazon S3 and from remote hosts using SSH\. For more information, see [COPY from JSON format](copy-usage_notes-copy-from-json.md) usage notes\. | March 25, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-30
|
| New system table STL\_PLAN\_INFO | The [STL\_PLAN\_INFO](r_STL_PLAN_INFO.md) table supplements the EXPLAIN command as another way to look at query plans\. | March 25, 2014 |
| New function REGEXP\_SUBSTR | The [REGEXP\_SUBSTR function](REGEXP_SUBSTR.md) returns the characters extracted from a string by searching for a regular expression pattern\. | March 25, 2014 |
| New columns for STL\_COMMIT\_STATS | The [STL\_COMMIT\_STATS](r_STL_COMMIT_STATS.md) table has two new columns: numxids and oldestxid\. | March 6, 2014 |
| COPY from SSH support for gzip and lzop | The [COPY](r_COPY.md) command supports gzip and lzop compression when loading data through an SSH connection\. | February 13, 2014 |
| New functions | The [ROW\_NUMBER window function](r_WF_ROW_NUMBER.md) returns the number of the current row\. The [STRTOL function](r_STRTOL.md) converts a string expression of a number of the specified base to the equivalent integer value\. [PG\_CANCEL\_BACKEND](PG_CANCEL_BACKEND.md) and [PG\_TERMINATE\_BACKEND](PG_TERMINATE_BACKEND.md) enable users to cancel queries and session connections\. The [LAST\_DAY](r_LAST_DAY.md) function has been added for Oracle compatibility\. | February 13, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-31
|
| New system table | The [STL\_COMMIT\_STATS](r_STL_COMMIT_STATS.md) system table provides metrics related to commit performance, including the timing of the various stages of commit and the number of blocks committed\. | February 13, 2014 |
| FETCH with single\-node clusters | When using a cursor on a single\-node cluster, the maximum number of rows that can be fetched using the [FETCH](fetch.md) command is 1000\. FETCH FORWARD ALL is not supported for single\-node clusters\. | February 13, 2014 |
| DS\_DIST\_ALL\_INNER redistribution strategy | DS\_DIST\_ALL\_INNER in the Explain plan output indicates that the entire inner table was redistributed to a single slice because the outer table uses DISTSTYLE ALL\. For more information, see [Join type examples](c-the-query-plan.md#join-types) and [Evaluating the query plan](c_data_redistribution.md)\. | January 13, 2014 |
| New system tables for queries | Amazon Redshift has added new system tables that customers can use to evaluate query execution for tuning and troubleshooting\. For more information, see [SVL\_COMPILE](r_SVL_COMPILE.md), [STL\_SCAN](r_STL_SCAN.md), [STL\_RETURN](r_STL_RETURN.md), [STL\_SAVE](r_STL_SAVE.md) [STL\_ALERT\_EVENT\_LOG](r_STL_ALERT_EVENT_LOG.md)\. | January 13, 2014 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-32
|
| Single\-node cursors | Cursors are now supported for single\-node clusters\. A single\-node cluster can have two cursors open at a time, with a maximum result set of 32 GB\. On a single\-node cluster, we recommend setting the ODBC Cache Size parameter to 1,000\. For more information, see [DECLARE](declare.md)\. | December 13, 2013 |
| ALL distribution style | ALL distribution can dramatically shorter execution times for certain types of queries\. When a table uses ALL distribution style, a copy of the table is distributed to every node\. Because the table is effectively collocated with every other table, no redistribution is needed during query execution\. ALL distribution is not appropriate for all tables because it increases storage requirements and load time\. For more information, see [Choosing a data distribution style](t_Distributing_data.md)\. | November 11, 2013 |
| COPY from remote hosts | In addition to loading tables from data files on Amazon S3 and from Amazon DynamoDB tables, the COPY command can load text data from Amazon EMR clusters, Amazon EC2 instances, and other remote hosts by using SSH connections\. Amazon Redshift uses multiple simultaneous SSH connections to read and load data in parallel\. For more information, see [Loading data from remote hosts](loading-data-from-remote-hosts.md)\. | November 11, 2013 |
| WLM memory percent used | You can balance workload by designating a specific percentage of memory for each queue in your workload management \(WLM\) configuration\. For more information, see [Implementing manual WLM](cm-c-defining-query-queues.md)\. | November 11, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-33
|
| APPROXIMATE COUNT\(DISTINCT\) | Queries that use APPROXIMATE COUNT\(DISTINCT\) execute much faster, with a relative error of about 2%\. The APPROXIMATE COUNT\(DISTINCT\) function uses a HyperLogLog algorithm\. For more information, see the [COUNT function](r_COUNT.md)\. | November 11, 2013 |
| New SQL functions to retrieve recent query details | Four new SQL functions retrieve details about recent queries and COPY commands\. The new functions make it easier to query the system log tables, and in many cases provide necessary details without needing to access the system tables\. For more information, see [PG\_BACKEND\_PID](PG_BACKEND_PID.md), [PG\_LAST\_COPY\_ID](PG_LAST_COPY_ID.md), [PG\_LAST\_COPY\_COUNT](PG_LAST_COPY_COUNT.md), [PG\_LAST\_QUERY\_ID](PG_LAST_QUERY_ID.md)\. | November 1, 2013 |
| MANIFEST option for UNLOAD | The MANIFEST option for the UNLOAD command complements the MANIFEST option for the COPY command\. Using the MANIFEST option with UNLOAD automatically creates a manifest file that explicitly lists the data files that were created on Amazon S3 by the unload operation\. You can then use the same manifest file with a COPY command to load the data\. For more information, see [Unloading data to Amazon S3](t_Unloading_tables.md) and [UNLOAD examples](r_UNLOAD_command_examples.md)\. | November 1, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-34
|
| MANIFEST option for COPY | You can use the MANIFEST option with the [COPY](r_COPY.md) command to explicitly list the data files that will be loaded from Amazon S3\. | October 18, 2013 |
| System tables for troubleshooting queries | Added documentation for system tables that are used to troubleshoot queries\. The [STL views for logging](c_intro_STL_tables.md) section now contains documentation for the following system tables: STL\_AGGR, STL\_BCAST, STL\_DIST, STL\_DELETE, STL\_HASH, STL\_HASHJOIN, STL\_INSERT, STL\_LIMIT, STL\_MERGE, STL\_MERGEJOIN, STL\_NESTLOOP, STL\_PARSE, STL\_PROJECT, STL\_SCAN, STL\_SORT, STL\_UNIQUE, STL\_WINDOW\. | October 3, 2013 |
| CONVERT\_TIMEZONE function | The [CONVERT\_TIMEZONE function](CONVERT_TIMEZONE.md) converts a timestamp from one time zone to another, with the option to automatically adjust for daylight savings time\. | October 3, 2013 |
| SPLIT\_PART function | The [SPLIT\_PART function](SPLIT_PART.md) splits a string on the specified delimiter and returns the part at the specified position\. | October 3, 2013 |
| STL\_USERLOG system table | [STL\_USERLOG](r_STL_USERLOG.md) records details for changes that occur when a database user is created, altered, or deleted\. | October 3, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-35
|
| LZO column encoding and LZOP file compression\. | [LZO](lzo-encoding.md) column compression encoding combines a very high compression ratio with good performance\. COPY from Amazon S3 supports loading from files compressed using [LZOP](copy-parameters-file-compression.md#copy-lzop) compression\. | September 19, 2013 |
| JSON, regular expressions, and cursors | Added support for parsing JSON strings, pattern matching using regular expressions, and using cursors to retrieve large data sets over an ODBC connection\. For more information, see [JSON functions](json-functions.md), [Pattern\-matching conditions](pattern-matching-conditions.md), and [DECLARE](declare.md)\. | September 10, 2013 |
| ACCEPTINVCHAR option for COPY | You can successfully load data that contains invalid UTF\-8 characters by specifying the ACCEPTINVCHAR option with the [COPY](r_COPY.md) command\. | August 29, 2013 |
| CSV option for COPY | The [COPY](r_COPY.md) command now supports loading from CSV formatted input files\. | August 9, 2013 |
| CRC32 | The [CRC32 function](crc32-function.md) performs cyclic redundancy checks\. | August 9, 2013 |
| WLM wildcards | Workload management \(WLM\) supports wildcards for adding user groups and query groups to queues\. For more information, see [Wildcards](cm-c-defining-query-queues.md#wlm-wildcards)\. | August 1, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-36
|
| WLM timeout | To limit the amount of time that queries in a given WLM queue are permitted to use, you can set the WLM timeout value for each queue\. For more information, see [WLM timeout](cm-c-defining-query-queues.md#wlm-timeout)\. | August 1, 2013 |
| New COPY options 'auto' and 'epochsecs' | The [COPY](r_COPY.md) command performs automatic recognition of date and time formats\. New time formats, 'epochsecs' and 'epochmillisecs' enable COPY to load data in epoch format\. | July 25, 2013 |
| CONVERT\_TIMEZONE function | The [CONVERT\_TIMEZONE function](CONVERT_TIMEZONE.md) converts a timestamp from one timezone to another\. | July 25, 2013 |
| FUNC\_SHA1 function | The [FUNC\_SHA1 function](FUNC_SHA1.md) converts a string using the SHA1 algorithm\. | July 15, 2013 |
| max\_execution\_time | To limit the amount of time queries are permitted to use, you can set the max\_execution\_time parameter as part of the WLM configuration\. For more information, see [Modifying the WLM configuration](cm-c-modifying-wlm-configuration.md)\. | July 22, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-37
|
| Four\-byte UTF\-8 characters | The VARCHAR data type now supports four\-byte UTF\-8 characters\. Five\-byte or longer UTF\-8 characters are not supported\. For more information, see [Storage and ranges](r_Character_types.md#r_Character_types-storage-and-ranges)\. | July 18, 2013 |
| SVL\_QERROR | The SVL\_QERROR system view has been deprecated\. | July 12, 2013 |
| Revised Document History | The Document History page now shows the date the documentation was updated\. | July 12, 2013 |
| STL\_UNLOAD\_LOG | [STL\_UNLOAD\_LOG](r_STL_UNLOAD_LOG.md) records the details for an unload operation\. | July 5, 2013 |
| JDBC fetch size parameter | To avoid client\-side out of memory errors when retrieving large data sets using JDBC, you can enable your client to fetch data in batches by setting the JDBC fetch size parameter\. For more information, see [Setting the JDBC fetch size parameter](queries-troubleshooting.md#set-the-JDBC-fetch-size-parameter)\. | June 27, 2013 |
| UNLOAD encrypted files | [UNLOAD](r_UNLOAD.md) now supports unloading table data to encrypted files on Amazon S3\. | May 22, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
21143831e534-38
|
| Temporary credentials | [COPY](r_COPY.md) and [UNLOAD](r_UNLOAD.md) now support the use of temporary credentials\. | April 11, 2013 |
| Added clarifications | Clarified and expanded discussions of Designing Tables and Loading Data\. | February 14, 2013 |
| Added best practices | Added [Amazon Redshift best practices for designing tables](c_designing-tables-best-practices.md) and [Amazon Redshift best practices for loading data](c_loading-data-best-practices.md)\. | February 14, 2013 |
| Clarified password constraints | Clarified password constraints for CREATE USER and ALTER USER, various minor revisions\. | February 14, 2013 |
| New guide | This is the first release of the Amazon Redshift Developer Guide\. | February 14, 2013 |
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/doc-history.md
|
5494db5910a1-0
|
This section compares the performance differences when using a single\-column sort key, a compound sort key, and an interleaved sort key for different types of queries\.
For this example, you'll create a denormalized table named CUST\_SALES, using data from the CUSTOMER and LINEORDER tables\. CUSTOMER and LINEORDER are part of the SSB dataset, which is used in the [Tutorial: Tuning table design](tutorial-tuning-tables.md)\.
The new CUST\_SALES table has 480 million rows, which is not large by Amazon Redshift standards, but it is large enough to show the performance differences\. Larger tables will tend to show greater differences, especially for interleaved sorting\.
To compare the three sort methods, perform the following steps:
1. Create the SSB dataset\.
1. Create the CUST\_SALES\_DATE table\.
1. Create three tables to compare sort styles\.
1. Execute queries and compare the results\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
d200e42b6499-0
|
If you haven't already done so, follow the steps in [Step 1: Create a test data set](tutorial-tuning-tables-create-test-data.md) in the Tuning Table Design tutorial to create the tables in the SSB dataset and load them with data\. The data load will take about 10 to 15 minutes\.
The example in the Tuning Table Design tutorial uses a four\-node cluster\. The comparisons in this example use a two\-node cluster\. Your results will vary with different cluster configurations\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
48629904469a-0
|
The CUST\_SALES\_DATE table is a denormalized table that contains data about customers and revenues\. To create the CUST\_SALES\_DATE table, execute the following statement\.
```
create table cust_sales_date as
(select c_custkey, c_nation, c_region, c_mktsegment, d_date::date, lo_revenue
from customer, lineorder, dwdate
where lo_custkey = c_custkey
and lo_orderdate = dwdate.d_datekey
and lo_revenue > 0);
```
The following query shows the row count for CUST\_SALES\.
```
select count(*) from cust_sales_date;
count
-----------
480027069
(1 row)
```
Execute the following query to view the first row of the CUST\_SALES table\.
```
select * from cust_sales_date limit 1;
c_custkey | c_nation | c_region | c_mktsegment | d_date | lo_revenue
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
48629904469a-1
|
c_custkey | c_nation | c_region | c_mktsegment | d_date | lo_revenue
----------+----------+----------+--------------+------------+-----------
1 | MOROCCO | AFRICA | BUILDING | 1994-10-28 | 1924330
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
59cfb65a40eb-0
|
To compare the sort styles, create three tables\. The first will use a single\-column sort key; the second will use a compound sort key; the third will use an interleaved sort key\. The single\-column sort will use the `c_custkey` column\. The compound sort and the interleaved sort will both use the `c_custkey`, `c_region`, `c_mktsegment`, and `d_date` columns\.
To create the tables for comparison, execute the following CREATE TABLE statements\.
```
create table cust_sales_date_single
sortkey (c_custkey)
as select * from cust_sales_date;
create table cust_sales_date_compound
compound sortkey (c_custkey, c_region, c_mktsegment, d_date)
as select * from cust_sales_date;
create table cust_sales_date_interleaved
interleaved sortkey (c_custkey, c_region, c_mktsegment, d_date)
as select * from cust_sales_date;
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
a53e55cc1c44-0
|
Execute the same queries against each of the tables to compare execution times for each table\. To eliminate differences due to compile time, run each of the queries twice, and record the second time\.
1. Test a query that restricts on the `c_custkey` column, which is the first column in the sort key for each table\. Execute the following queries\.
```
-- Query 1
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_single
where c_custkey < 100000;
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_compound
where c_custkey < 100000;
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_interleaved
where c_custkey < 100000;
```
1. Test a query that restricts on the `c_region` column, which is the second column in the sort key for the compound and interleaved keys\. Execute the following queries\.
```
-- Query 2
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_single
where c_region = 'ASIA'
and c_mktsegment = 'FURNITURE';
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_compound
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
a53e55cc1c44-1
|
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_compound
where c_region = 'ASIA'
and c_mktsegment = 'FURNITURE';
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_interleaved
where c_region = 'ASIA'
and c_mktsegment = 'FURNITURE';
```
1. Test a query that restricts on both the `c_region` column and the `c_mktsegment` column\. Execute the following queries\.
```
-- Query 3
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_single
where d_date between '01/01/1996' and '01/14/1996'
and c_mktsegment = 'FURNITURE'
and c_region = 'ASIA';
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_compound
where d_date between '01/01/1996' and '01/14/1996'
and c_mktsegment = 'FURNITURE'
and c_region = 'ASIA';
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_interleaved
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
a53e55cc1c44-2
|
select max(lo_revenue), min(lo_revenue)
from cust_sales_date_interleaved
where d_date between '01/01/1996' and '01/14/1996'
and c_mktsegment = 'FURNITURE'
and c_region = 'ASIA';
```
1. Evaluate the results\.
The following table summarizes the performance of the three sort styles\.
**Important**
These results show relative performance for the two\-node cluster that was used for these examples\. Your results will vary, depending on multiple factors, such as your node type, number of nodes, and other concurrent operations contending for resources\.
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data-compare-sort-styles.html)
In Query 1, the results for all three sort styles are very similar, because the WHERE clause restricts only on the first column\. There is a small overhead cost for accessing an interleaved table\.
In Query 2, there is no benefit to the single\-column sort key because that column is not used in the WHERE clause\. There is no performance improvement for the compound sort key, because the query was restricted using the second and third columns in the sort key\. The query against the interleaved table shows the best performance because interleaved sorting is able to efficiently filter on secondary columns in the sort key\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
a53e55cc1c44-3
|
In Query 3, the interleaved sort is much faster than the other styles because it is able to filter on the combination of the `d_date`, `c_mktsegment`, and `c_region` columns\.
This example uses a relatively small table, by Amazon Redshift standards, with 480 million rows\. With larger tables, containing billions of rows and more, interleaved sorting can improve performance by an order of magnitude or more for certain types of queries\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/t_Sorting_data-compare-sort-styles.md
|
95c0bd88ea76-0
|
Installs a Python library, which is available for users to incorporate when creating a user\-defined function \(UDF\) with the [CREATE FUNCTION](r_CREATE_FUNCTION.md) command\. The total size of user\-installed libraries can't exceed 100 MB\.
CREATE LIBRARY can't be run inside a transaction block \(BEGIN … END\)\. For more information about transactions, see [Serializable isolation](c_serial_isolation.md)\.
Amazon Redshift supports Python version 2\.7\. For more information, go to [www\.python\.org](https://www.python.org/)\.
For more information, see [Importing custom Python library modules](udf-python-language-support.md#udf-importing-custom-python-library-modules)\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
2a8ccd5012b0-0
|
```
CREATE [ OR REPLACE ] LIBRARY library_name LANGUAGE plpythonu
FROM
{ 'https://file_url'
| 's3://bucketname/file_name'
authorization
[ REGION [AS] 'aws_region']
}
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
517808363c49-0
|
OR REPLACE
Specifies that if a library with the same name as this one already exists, the existing library is replaced\. REPLACE commits immediately\. If a UDF that depends on the library is running concurrently, the UDF might fail or return unexpected results, even if the UDF is running within a transaction\. You must be the owner or a superuser to replace a library\.
*library\_name*
The name of the library to be installed\. You can't create a library that contains a module with the same name as a Python Standard Library module or an Amazon Redshift preinstalled Python module\. If an existing user\-installed library uses the same Python package as the library to be installed , you must drop the existing library before installing the new library\. For more information, see [Python language support for UDFs](udf-python-language-support.md)\.
LANGUAGE plpythonu
The language to use\. Python \(plpythonu\) is the only supported language\. Amazon Redshift supports Python version 2\.7\. For more information, go to [www\.python\.org](https://www.python.org/)\.
FROM
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
517808363c49-1
|
FROM
The location of the library file\. You can specify an Amazon S3 bucket and object name, or you can specify a URL to download the file from a public website\. The library must be packaged in the form of a `.zip` file\. For more information, go to [Building and Installing Python Modules](https://docs.python.org/2/library/distutils.html?highlight=distutils#module-distutils) in the Python documentation\.
https://*file\_url*
The URL to download the file from a public website\. The URL can contain up to three redirects\. The following is an example of a file URL\.
```
'https://www.example.com/pylib.zip'
```
s3://*bucket\_name/file\_name*
The path to a single Amazon S3 object that contains the library file\. The following is an example of an Amazon S3 object path\.
```
's3://mybucket/my-pylib.zip'
```
If you specify an Amazon S3 bucket, you must also provide credentials for an AWS user that has permission to download the file\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
517808363c49-2
|
```
If you specify an Amazon S3 bucket, you must also provide credentials for an AWS user that has permission to download the file\.
If the Amazon S3 bucket doesn't reside in the same AWS Region as your Amazon Redshift cluster, you must use the REGION option to specify the AWS Region in which the data is located\. The value for *aws\_region* must match an AWS Region listed in the table in the [REGION](copy-parameters-data-source-s3.md#copy-region) parameter description for the COPY command\.
*authorization*
A clause that indicates the method your cluster uses for authentication and authorization to access the Amazon S3 bucket that contains the library file\. Your cluster must have permission to access the Amazon S3 with the LIST and GET actions\.
The syntax for authorization is the same as for the COPY command authorization\. For more information, see [Authorization parameters](copy-parameters-authorization.md)\.
To specify an AWS Identity and Access Management \(IAM\) role, replace *<account\-id>* and *<role\-name>* with the account ID and role name in the CREDENTIALS *credentials\-args* string\. An example is shown following\.
```
'aws_iam_role=arn:aws:iam::<aws-account-id>:role/<role-name>'
```
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
517808363c49-3
|
```
Optionally, if the Amazon S3 bucket uses server\-side encryption, provide the encryption key in the credentials\-args string\. If you use temporary security credentials, provide the temporary token in the *credentials\-args* string\.
To specify key\-based access control, provide the *credentials\-args* in the following format\.
```
'aws_access_key_id=<access-key-id>;aws_secret_access_key=<secret-access-key>'
```
To use temporary token credentials, you must provide the temporary access key ID, the temporary secret access key, and the temporary token\. The *credentials\-args* string is in the following format\.
```
WITH CREDENTIALS AS
'aws_access_key_id=<temporary-access-key-id>;aws_secret_access_key=<temporary-secret-access-key>;token=<temporary-token>'
```
For more information, see [Temporary security credentials](copy-usage_notes-access-permissions.md#r_copy-temporary-security-credentials)
REGION \[AS\] *aws\_region*
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
517808363c49-4
|
REGION \[AS\] *aws\_region*
The AWS Region where the Amazon S3 bucket is located\. REGION is required when the Amazon S3 bucket isn't in the same AWS Region as the Amazon Redshift cluster\. The value for *aws\_region* must match an AWS Region listed in the table in the [REGION](copy-parameters-data-source-s3.md#copy-region) parameter description for the COPY command\.
By default, CREATE LIBRARY assumes that the Amazon S3 bucket is located in the same AWS Region as the Amazon Redshift cluster\.
|
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-redshift-developer-guide/doc_source/r_CREATE_LIBRARY.md
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.