Amazon Redshift has made it easier to analyse and filter data with Interleaved Sort Keys.
The addition of the sort keys means that fast filter queries can be achieved without the need for indices or projections.
Interleaved sorts are an effective way of searching through selective queries which will filter on multiple columns.
Jeff Barr, Chief Evangelist, AWS, wrote on the company blog explaining what this is: "Let’s say you have a table with 100,000 1 MB blocks per column, and you often filter on one or more of four columns (date, customer, product, geography)."
"You can create a compound sort key, sorting first by date, then customer, product, and finally geography. This will work well if your query filters on date, but can require a table scan of all 100,000 blocks if you only filter by geographic region."
This can be particularly useful for single-column keys as it can compress the key column and allow, for example, URL’s to fit into the zone map.
However, if the columns query that are used are always the same then compound sort keys may remain the better option.
The interleaved feature will be deployed in every region over the next seven days.