7 Replies Latest reply on Sep 23, 2014 10:47 PM by cristiano.nicolai

    Materialized view refresh using DDL

    cristiano.nicolai

      Hi guys,

       

      I'm trying to automatically refresh an internal materialized view using ttl cache hint.

      This view is defined using a DDL file similar to this:

       

      <model name="Model" type="VIRTUAL">
        <metadata type="DDL-FILE">/ddl/Model.ddl</metadata>
      </model>
      

       

      CREATE VIEW viewname OPTIONS (MATERIALIZED 'TRUE') AS (
          /*+ cache(ttl:300000) */
          SELECT
              *
          FROM
              Source.table
      )
      

       

      View is materialized fine when the first query hits it, but it never refreshes the data.

      From the logs I can see the following messages only when view is loaded by the first query:

       

      TEIID30013 Loading materialized view table #MAT_MODEL.VIEWNAME

      TEIID30014 Loaded materialized view table #MAT_MODEL.VIEWNAME with row count x.

      TEIID31153 Did not complete the load of #MAT_MODEL.VIEWNAME as the initiating query is already finished.

       

      Teiid version is 8.8.1.

       

      Any ideas about what could be causing the view to not reload when ttl expires?