|SQL Language Reference / Functions|
Return the string form of the unique distributed member process identity in the GemFire XD cluster.
The DSID function returns the string form of the distributed member process identity uniquely represented in the distributed system. By default, a SELECT query with the DSID function in the SelectExpression filters out secondary buckets of a partitioned table if the table was created with REDUNDANCY. To include the redundant buckets in a query, add the query hint --gemfirexd-properties withSecondaries = true as shown in the example.
For replicated tables, DSID returns information for only a single member by design. Only the GemFire XD member that receives the query executes the DSID function.
-- find out current process distributed member id VALUES dsid(); -- List members that store partitioned table data. SELECT DISTINCT dsid() FROM emp.employee; -- Display the number of rows present on each member that hosts a partitioned table. SELECT count(emp_id), dsid() FROM course, sys.members GROUP BY dsid(); -- Display the number of rows including secondary copies that are present on each member that hosts data for a partitioned table. SELECT count(emp_id), dsid() FROM course, sys.members m --gemfirexd-properties withSecondaries = true \n GROUP BY dsid();