I have a hashkey conversion in synapse how to convert the same in redshift
HashKey in Synapse – CONVERT(char(64),HASHBYTES(‘SHA2_256’,UPPER(‘1’ + ‘|’ + ISNULL(CAST([SourceSystem] AS NVARCHAR(MAX)),’UNKNOWN’) + ‘|’ + ISNULL(CAST([Vendor] AS NVARCHAR(MAX)),’UNKNOWN’) )),2)
I have a hashkey conversion in synapse how to convert the same in redshift
HashKey in Synapse – CONVERT(char(64),HASHBYTES(‘SHA2_256’,UPPER(‘1’ + ‘|’ + ISNULL(CAST([SourceSystem] AS NVARCHAR(MAX)),’UNKNOWN’) + ‘|’ + ISNULL(CAST([Vendor] AS NVARCHAR(MAX)),’UNKNOWN’) )),2)
Make a string json safe in redshift
So I need to convert this:
Make a string json safe in redshift
So I need to convert this:
Redshift super type : left outer unest
I am unnesting some JSON in Redshift.
The below code works but …
… if a record does not have a ‘tags’ element then the entire row is ignored as is effectively and ‘inner’ join.
Redshift materialized view shows as stale when no base table data has changed
I have an incrementally auto refreshed materialized view in redshift, I manually refreshed it and svv_mv_info shows it as is_stale=f. A few hours later, it shows is_stale=t. I checked sys_query_history (as a sysadmin), and the only thing between the refresh and now is select statements. These are vanilla tables, nothing is adding to them automatically behind the scenes. Could some kind of auto statistic recompute or vacuum cause the mat view to trip to stale? Anyone ever experience this before?
Map query segment and locus from SVL_COMPILE to actual query text
When debugging queries in Redshift, it’s useful to look at SVL_COMPILE to see where queries are triggering a compile, which obviously gobbles up quite a lot of time if you’re doing it by accident. However, all you get in SVL_COMPILE is some idea of ‘segment’ and ‘locus’. Is there any way to map these numbers to actual parts of a query’s text? Or at least, how can one reason about what they might refer to? The segments don’t seem to match the number of nodes in an EXPLAIN of the query, for example.
How do I get the list of columns in local tables and tables that are datashares in Redshift?
Per aws documentation (https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_REDSHIFT_COLUMNS.html), SVV_REDSHIFT_COLUMNS is the table to use but it is extremely slow if I have to retrieve all columns for all tables.
Amazon Redshift takes forever to Vacuum
Recently, the vacuum; command takes forever to complete. It was working before but since 3 weeks ago, it never finishes. I increased the timeout to 8 hours but it still times out! It used to finish in less than an hour before.
Is there any way to troubleshoot this and find out what’s going on?
Thanks
How to make a view on pg_user_info to select user details in Redshift?
I need a way to copy the list of all the users and their account details from pg_user_info of Redshift database. I need different details like if the account is active or not etc.