Skip to content

Are there any performance differences between a redshift schema bound and late binding view?

0

The docs go over the security issues (owner has table access, consumer has view access, etc) and how schema bound views maintain a copy of the original late binding definition even if its changed. They don't mention if there's any performance implications between regular views and views with no schema binding. Other than the tiny ping of verifying permissions and also possibly rewriting the query (if it has to), in the actual execution of the query are there any performance implications between the two?

asked 2 years ago543 views

1 Answer
1

There are some performance implications to consider when comparing schema-bound views and late-binding views in Amazon Redshift, although the differences are generally minimal for most use cases.

Late-binding views don't check the underlying database objects until the view is queried. This means that you can alter or drop the underlying objects without needing to drop and recreate the view. While this provides flexibility, it can potentially impact performance in the following ways:

  1. Query compilation: Late-binding views may require slightly more time for query compilation because the system needs to verify the existence and structure of the underlying objects at query time. This overhead is usually negligible but could be noticeable for very frequent, short-running queries.

  2. Query optimization: The query optimizer might have less information available for late-binding views, potentially leading to suboptimal query plans in some cases. This is because the view definition is not bound to the schema, so the optimizer may have to make more conservative assumptions.

  3. Caching: Amazon Redshift uses a serverless compilation service to cache compiled code segments. While this applies to both types of views, late-binding views might experience slightly more cache misses due to their dynamic nature, potentially leading to more frequent recompilations.

  4. Security checks: Late-binding views may require additional permission checks at runtime, which could add a small overhead.

However, it's important to note that for most practical scenarios, the performance difference between schema-bound and late-binding views is minimal. The choice between the two often depends more on your specific use case, such as the need for flexibility in modifying underlying objects or the desire for stricter schema binding.

If you're working with large datasets or have performance-critical applications, it's recommended to carefully evaluate query performance for both types of views in your specific scenario. This evaluation will help you determine if there are any significant performance implications for your particular use case.

Sources
CREATE VIEW - Amazon Redshift
Query performance factors for Amazon Redshift - AWS Prescriptive Guidance

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.