cancel
Showing results for 
Search instead for 
Did you mean: 

How to get SDI replication Virtual tables count with out using select count(*) from "VT_TABLE_NAME"?

cloud_deep28
Explorer
0 Kudos

Dear All,

Hope everyone are doing Good & Safe!

My question here is whenever we run select count(*) from table name on huge table taking more time and using some memory when I am running the query.

I want to compare count of virtual table and physical table whether it is matching or not? and real time replication is working fine or not?

I can get physical tables count from (SELECT "TABLE_NAME","RECORD_COUNT","SCHEMA_NAME" FROM "SYS"."M_TABLES").

The problem here is with out using select count(*) from "VT_<Table_name>", How to get the count of all virtual tables from particular schema? Is there any standard table in HANA to get count of virtual tables from particular schema?

or

Suggest me any other way to get count with out using count(*) method?


Regards,

Deepthi


Accepted Solutions (0)

Answers (1)

Answers (1)

simon25
Advisor
Advisor
0 Kudos

Hi Ratnadeepthi,

Since you want to get a count of all virtual tables from a particular schema, the query you use for physical tables should surely work with the "VIRTUAL_TABLES" system view instead ?

SELECT "TABLE_NAME","RECORD_COUNT","SCHEMA_NAME" FROM "SYS"."VIRTUAL_TABLES".

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/latest/en-US/21031a8775191014bd929f35e4...

VIRTUAL_TABLES view contains this column information under "SCHEMA_NAME" & "TABLE_NAME"

FYI, you can a detailed overview of available System and monitoring views on HANA in this section of Admin guide :

SAP HANA SQL and System Views Reference > System Views Reference https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/latest/en-US/b4b0eec1968f41a099c828a4a6...

Kind Regards

Simon

simon25
Advisor
Advisor
0 Kudos

I should note that there is no "RECORD_COUNT" with VIRTUAL_TABLES, so the query would be :

SELECT "TABLE_NAME","SCHEMA_NAME" FROM "SYS"."VIRTUAL_TABLES"