The ask is to find out the best way to pre-filter out inactive records in a view file. Right now we are using a derived table but my team would like to change this for performance considerations.
Here is what the current LookML looks like:
view: viewname {
derived_table: {
sql: SELECT * FROM db_table WHERE "IS_ACTIVE" = TRUE ;;
}
What are exactly the performance consideration that need to be addressed?
Filtering in the derived table allows you to filter out BEFORE applying any other joins/filters/calculations. So it may actually give a pretty good performance.
You can persist that derived table so it will be queried straight away as a table on the database - the persistence rules would need to be set up depending on how often your inactive records change