For example, what is the difference between in those 2 when querying DMV?
select * from $SYSTEM.MDSCHEMA_MEASURES
select * from $SYSTEM.TMSCHEMA_MEASURES
When those queries are going to return different results?
For example, what is the difference between in those 2 when querying DMV?
select * from $SYSTEM.MDSCHEMA_MEASURES
select * from $SYSTEM.TMSCHEMA_MEASURES
When those queries are going to return different results?
Copyright © 2021 Jogjafile Inc.
The TM tables are generally the better ones to use for Tabular models, though you can use either for Tabular. The columns and sometimes the rows are different though. For example measures, I get an extra row on the MD query for a hidden measure:
You can see the columns for each using these links.
MDSCHEMA_MEASURES
TMSCHEMA_MEASURES
I do a lot with the TM DMV tables, and I think the only MD table I ever use is
MDSchema_Dimensions
to get row counts.You can also get row counts from
DISCOVER_STORAGE_TABLES
, but because you can't write full SQL (eg.GROUP BY
) when using DMVs, you have to jump through hoops after the query to get the right answer.