We are running range restricted query in our redshift where only the employee_id and business_date keep changing .But we keep seeing in SVL_COMPILE our hourly segment compilation is very high .Most of the queries are getting compiled which is adding additional time to the query.
This query keep getting executed with different employee_id and business_date range by our product team . tillTime is a timestamp field with constant value as 9999-01-01 01:00:00
Hourly hit : 1500 queries per hour.
Query:
Select * from acconts table where business_date between (?) and (?) and employee_id in (?) and sysdate >tillTime.
Our table configuration is:
Sortkey: (SORTKEY(business_date,employee_id ,snap_type,tillTime))
Diststyle: AUTO(EVEN)
Our cluster configuration is:
Node type: ra3.xlplue
Number of nodes: 10
We tried below:
Query:
Select * from acconts table where a emmployee_id in (?) and business_date between (?) and (?) an
tillTime='9999-01-01 01:00:00'
Still not much improvement observed and segments are still getting compiled.
Rahi c is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.