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.
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.
Shame for me, but no It's included in "Overview" section, and I browsed "Docs" section only.
I will see if I can put a link some where in the front of the docs, Thanks