DSID Function

Return the string form of the unique distributed member process identity in the GemFire XD cluster.

Description

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.

Note: Because optimizer properties are expressed as comments, they must appear at the end of a line. If you want to continue the SQL statement after including a property definition, enter a newline character (\n) before continuing the statement. This rule applies to the terminating semicolon, if the optimizer hint appears at the end of the SQL statement.

Example

-- 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();