getTSDBDataStat

Syntax

getTSDBDataStat([dbName="*"],[tableName="*"])

Arguments

dbName (optional) is a string indicating the database name. It can contain wildcards ("*", "%", and "?"). The default value is "*".

tableName (optional) is a string indicating the table name. It can contain wildcards ("*", "%", and "?"). The default value is "*".

"*" matches all; "?" matches a single character; "%" matches 0, 1 or more characters.

Details

Get the number of level files and sort key entries of TSDB tables on the current node for each chunk.

You can also use function pnodeRun to check the number of level files and sort key entries of tables in a cluster.

It returns a table containing the following columns:

  • levelFileCount: the number of level files of tables for each chunk.

  • sortKeyEntryCount: the number of sort key entries that has not been deduplicated in all level files for each chunk.

Examples

t = table(1 2 1 1 2 2 3 as month, `Rome`Paris`London`Paris`Rome`London`Rome as city, 200 500 100 300 300 400 400 as sold)
db_name = "dfs://window_function"
if (existsDatabase(db_name)) {
    dropDatabase(db_name)
}
db = database(db_name, HASH, [INT, 4], , 'TSDB')

pt = db.createPartitionedTable(t, "pt", "month", ,"sold")
pt.append!(t)

pt1 = db.createPartitionedTable(t, "pt1", "month", ,"sold")
pt1.append!(t)

flushTSDBCache()

Get the number of level files and sort key entries for all tables in the databases starting with dfs://window.

getTSDBDataStat("dfs://window%")  
// output
dbName	chunkId	tableName	levelFileCount	sortKeyEntryCount
dfs://window_function	d334ffab-741a-dcbd-174e-42b412058877	pt1	1	1
dfs://window_function	c3de728c-4efb-7e8e-024c-cfafd46c506c	pt1	1	3
dfs://window_function	572b1660-790e-e3a0-3944-9b81e50f4eb4	pt1	1	3
dfs://window_function	e9ea31f6-4e12-2881-b04a-c540dc3947c8	pt	1	1
dfs://window_function	673a7c12-c0d4-72bf-6a42-9c374589e2d6	pt	1	3
dfs://window_function	57ceedc9-4aaf-2aad-aa43-37924da3d32e	pt	1	3

Get the number of level files and sort key entries for table "pt" in the databases starting with dfs://window.

getTSDBDataStat("dfs://window%","pt") 
// output
dbName	chunkId	tableName	levelFileCount	sortKeyEntryCount
dfs://window_function	e9ea31f6-4e12-2881-b04a-c540dc3947c8	pt	1	1
dfs://window_function	673a7c12-c0d4-72bf-6a42-9c374589e2d6	pt	1	3
dfs://window_function	57ceedc9-4aaf-2aad-aa43-37924da3d32e	pt	1	3