Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading from SQL Database Views

Hi ,

Looks like when loading directly from the Database Views(which is created using the same query in qvs) is taking longer time compared to loading the same using a QVS which query against the DB.

Is that how it works?

4 Replies
Clever_Anjos
Employee
Employee

It would supposed to be the same time.

It depends on

  • Which RDBMS
  • Which indexes are beeing used
  • How many records are beeing retrieved
  • How often the database statistics are beein collected
  • How your view was created (Materialized views speed performance)
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You mean it takes longer to load data from a Database View than it takes to load the same data from the constituent Database Tables?

That's normal. The Database engine has to populate the View before it can start transmitting rows. This is a set-up cost (delay). It has no such problem when reading directly from tables where the optimizer can start transmitting rows almost immediately..

maxgro
MVP
MVP

A view (not materialized) is a stored queryn (where stored is the definition of the query, not the result), usually it takes the same time to run

- a query

and

- the same query stored as a view

Anonymous
Not applicable
Author

While loading from a view does take longer, the dynamic nature of a view insures that you are getting the most current version of the data.   We are migrating all of our views ( 100's ) to static tables in a data warehouse.  Our data requirements do not necessitate more than day old data, so we elected the performance improvement of pulling directly from tables.