Results 1 to 3 of 3

Thread: composite views

  1. #1
    Join Date
    Mar 2012

    Unanswered: composite views

    I have a generic question regarding composite views in DB2. I have experienced that composite views (i.e. views created by joining 2 or more base tables) give a poor performance but when the same query is run , the performance is really good. My organization has also documented as not to use composite views in fetching data from database. I was eager to know if there is any documentation provided by IBM on usage of composite views and the possible degradation in performance with their usage.

  2. #2
    Join Date
    May 2003
    In DB2 there is no difference between joining tables in a view versus joining tables in an SQL statement without using a view, all other things being equal. This assumes you are using DB2 LUW or DB2 for z/OS. Not sure about iSeries.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2007
    Jena, Germany
    Marcus is right. A view is pretty much like a macro: if a SQL statement refers to a view, the reference to the view is replaced with the view definition. After that, optimizations of the statement take place.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts