-
1. Re: Teiid: cannot create materialized view for table
rareddy Jan 19, 2015 12:01 PM (in response to tomcat77)Hi,
1. Create new table t_currency_mat with materialzed=true, materializedTable=<null> and relational:NativeQuery=SELECT * FROM t_currency
Did you do this in the Designer? why are you setting the NativeQuery? A materialization table (_mat) table is just another "source" table you can map to, that Teiid at runtime can read from instead of producing result from transformation provided. If this is your backing materialized table, did you also define the view table that this table represents?
2. Set materialized=true for original t_currency table (cannot set it in Teiid Designer GUI, but manually editing appropriate .xmi file does the trick )
This is right approach, however for this view you need to provide the transformation SQL, as to how view contents can be formed if the materialized table is not populated or not exists. Editing XMI files directly never is good idea, nor never need to. That smells like a (bug) regression. Which version of Designer? can you provide details of your environment and re-produce steps?
Here is what I suggest..
1) You have a table called "t_currency" in "postgres" source model.
2) On a view model, create a view called "currecyview" with transformation "select * from postgres.t_currency". Set materialized = true on this view.
3) Create VDB and deploy and execute queries. That will utilize internal memory based caching for materialization.
If you really want to expose the "currencyview" to external table, then you need to define "materializedTable" value in Designer, which needs to point to a source table like your "t_currency" but schema must match "currencyview" schema. Here is old article but still relevant A "How To" Guide For Materialization (caching) Views In Teiid
Also, if you really want little deeper view into external materialization management, then see External Materialization - Teiid 8.10 (draft) - Project Documentation Editor
Let us know if that helped or if any other questions you may have on the subject.
Thanks
Ramesh..
-
2. Re: Teiid: cannot create materialized view for table
tomcat77 Jan 20, 2015 2:01 AM (in response to rareddy)Hi, Ramesh!
It looks like I shoot my own leg All these things I did in Teiid Desiner in SOURCE model, because I was not aware of difference between Source model and View model. I read carefully Teiid manual (Home - Teiid 8.10 (draft) - Project Documentation Editor) and didn't found there any description of VDB's metadata. I've googled and discovered metadata description in Teiid Designer User Guide
and then performed steps like you suggest. Everything worked, cache is enabled.
Maybe, it's worth to include chapter about metadata concepts in Teiid documentation? I was suprised to find such important (I'd say, conceptual) information in GUI tool manual, which is IMHO is not necessary to use.
Anyway, thanks a lot for your answer.
-
3. Re: Teiid: cannot create materialized view for table
rareddy Jan 21, 2015 5:05 PM (in response to tomcat77)1 of 1 people found this helpfulHave you seen this The Basics · Teiid ? may be we should include this link somewhere in front of the documentation.
-
4. Re: Teiid: cannot create materialized view for table
tomcat77 Jan 22, 2015 1:19 AM (in response to rareddy)Shame for me, but no It's included in "Overview" section, and I browsed "Docs" section only.
-
5. Re: Teiid: cannot create materialized view for table
rareddy Jan 22, 2015 7:53 AM (in response to tomcat77)I will see if I can put a link some where in the front of the docs, Thanks