5 Replies Latest reply on Oct 29, 2012 12:13 PM by Steven Hawkins

    How can I verify the index for an internalized materialized view?

    mikebailey Newbie

      I am creating a materialized view and then adding an index for the primary keys. I cannot see any reference to the index.  How can i verify that the index part is working? The view works perfectly.

       

      Sample code:

       

       

       

       

      final Table demoLparDataCached = metadataFactory

          .addTable("demoLparDataCached");

       

        demoLparDataCached.setMaterialized(true);

        demoLparDataCached.setVirtual(true);

        demoLparDataCached.setTableType(org.teiid.metadata.Table.Type.View);

        demoLparDataCached.setSelectTransformation("/* cache(ttl:30000) */ SELECT * FROM demo.demo_lpar_health_state");

       

      metadataFactory.addColumn("TIMEEVENT",
          TypeFacility.getDataTypeNameFromSQLType(Types.TIMESTAMP),
          demoLparDataCached);

      .... more columns

      List<String> indx = new ArrayList<String>();
        indx.add("SYSID");
        indx.add("SYSPLEX");
       
        metadataFactory.addIndex("demoLparDataCached_INDEX", false, indx ,  demoLparDataCached);