<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Connection load balancing</title>
    <link>/en/admin/managing-client-connections/connection-load-balancing/</link>
    <description>Recent content in Connection load balancing on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/managing-client-connections/connection-load-balancing/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: About native connection load balancing</title>
      <link>/en/admin/managing-client-connections/connection-load-balancing/about-native-connection-load-balancing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-client-connections/connection-load-balancing/about-native-connection-load-balancing/</guid>
      <description>
        
        
        &lt;p&gt;Native connection load balancing is a feature built into the OpenText™ Analytics Database server and client libraries that helps spread the CPU and memory overhead caused by client connections across the hosts in the database. It can prevent unequal distribution of client connections among hosts in the cluster.&lt;/p&gt;
&lt;p&gt;There are two types of native connection load balancing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Cluster-wide balancing—This method the legacy method of connection load balancing. It was the only type of load balancing prior to Vertica version 9.2. Using this method, you apply a single load balancing policy across the entire cluster. All connection to the cluster are handled the same way.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Load balancing policies—This method lets you set different load balancing policies depending on the source of client connection. For example, you can have a policy that redirects connections from outside of your local network to one set of nodes in your cluster, and connections from within your local network to another set of nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Classic connection load balancing</title>
      <link>/en/admin/managing-client-connections/connection-load-balancing/classic-connection-load-balancing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-client-connections/connection-load-balancing/classic-connection-load-balancing/</guid>
      <description>
        
        
        &lt;p&gt;The classic connection load balancing feature applies a single policy for all client connections to your database. Both your database and the client must enable the load balancing option in order for connections to be load balanced. When both client and server enable load balancing, the following process takes place when the client attempts to open a connection to OpenText™ Analytics Database:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The client connects to a host in the database cluster, with a connection parameter indicating that it is requesting a load-balanced connection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The host chooses a host from the list of currently up hosts in the cluster, according to the &lt;a href=&#34;#Load&#34;&gt;current load balancing scheme&lt;/a&gt;. Under all schemes, it is possible for a host to select itself.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The host tells the client which host it selected to handle the client&#39;s connection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the host chose another host in the database to handle the client connection, the client disconnects from the initial host. Otherwise, the client jumps to step 6.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The client establishes a connection to the host that will handle its connection. The client sets this second connection request so that the second host does not interpret the connection as a request for load balancing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The client connection proceeds as usual, (negotiating encryption if the connection has SSL enabled, and proceeding to authenticating the user ).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This process is transparent to the client application. The client driver automatically disconnects from the initial host and reconnects to the host selected for load balancing.&lt;/p&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In mixed IPv4 and IPv6 environments, balancing only works for the address family for which you have configured native load balancing. For example, if you have configured load balancing using an IPv4 address, then IPv6 clients cannot use load balancing, however the IPv6 clients can still connect, but load balancing does not occur.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The native load balancer returns an IP address for the client to use. This address must be one that the client can reach. If your nodes are on a private network, native load-balancing requires you to publish a public address in one of two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Set the public address on each node. The database saves that address in the &lt;code&gt;export_address&lt;/code&gt; field in the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/nodes/#&#34;&gt;NODES&lt;/a&gt; system table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the subnet on the database. The database saves that address in the &lt;code&gt;export_subnet&lt;/code&gt; field in the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/dbs/#&#34;&gt;DATABASES&lt;/a&gt; system table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&#34;Load&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;load-balancing-schemes&#34;&gt;Load balancing schemes&lt;/h2&gt;
&lt;p&gt;The load balancing scheme controls how a host selects which host to handle a client connection. There are three available schemes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;NONE&lt;/code&gt; (default): Disables native connection load balancing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ROUNDROBIN&lt;/code&gt;: Chooses the next host from a circular list of hosts in the cluster that are up—for example, in a three-node cluster, iterates over node1, node2, and node3, then wraps back to node1. Each host in the cluster maintains its own pointer to the next host in the circular list, rather than there being a single cluster-wide state.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;RANDOM&lt;/code&gt;: Randomly chooses a host from among all hosts in the cluster that are up.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You set the native connection load balancing scheme using the &lt;a href=&#34;../../../../en/sql-reference/functions/client-connection-functions/set-load-balance-policy/&#34;&gt;SET_LOAD_BALANCE_POLICY&lt;/a&gt; function. See &lt;a href=&#34;../../../../en/admin/managing-client-connections/connection-load-balancing/classic-connection-load-balancing/enabling-and-disabling-classic-connection-load-balancing/&#34;&gt;Enabling and Disabling Native Connection Load Balancing&lt;/a&gt; for instructions.&lt;/p&gt;
&lt;h2 id=&#34;driver-notes&#34;&gt;Driver notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Native connection load balancing works with the ADO.NET driver&#39;s connection pooling. The connection the client makes to the initial host, and the final connection to the load-balanced host, use pooled connections if they are available.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If a client application uses the JDBC and ODBC driver with third-party connection pooling solutions, the initial connection is not pooled because it is not a full client connection. The final connection is pooled because it is a standard client connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;connection-failover&#34;&gt;Connection failover&lt;/h2&gt;
&lt;p&gt;The client libraries include a failover feature that allow them to connect to backup hosts if the host specified in the connection properties is unreachable. When using native connection load balancing, this failover feature is only used for the initial connection to the database. If the host to which the client was redirected does not respond to the client&#39;s connection request, the client does not attempt to connect to a backup host and instead returns a connection error to the user.&lt;/p&gt;
&lt;p&gt;Clients are redirected only to hosts that are known to be up. Thus, this sort of connection failure should only occur if the targeted host goes down at the same moment the client is redirected to it. For more information, see &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/ado-net-connection-failover/#&#34;&gt;ADO.NET connection failover&lt;/a&gt;, &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-failover/#&#34;&gt;JDBC connection failover&lt;/a&gt;, and &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/ccpp/connection-failover/#&#34;&gt;Connection failover&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Admin: Connection load balancing policies</title>
      <link>/en/admin/managing-client-connections/connection-load-balancing/connection-load-balancing-policies/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-client-connections/connection-load-balancing/connection-load-balancing-policies/</guid>
      <description>
        
        
        &lt;p&gt;Connection load balancing policies help spread the load of servicing client connections by redirecting connections based on the connection&#39;s origin. These policies can also help prevent nodes reaching their client connection limits and rejecting new connections by spreading connections among nodes. See &lt;a href=&#34;../../../../en/admin/managing-client-connections/limiting-number-and-length-of-client-connections/#&#34;&gt;Limiting the number and length of client connections&lt;/a&gt; for more information about client connection limits.&lt;/p&gt;
&lt;p&gt;A load balancing policy consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Network addresses&lt;/strong&gt; that identify particular IP address and port number combinations on a node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One or more &lt;strong&gt;connection load balancing groups&lt;/strong&gt; that consists of network addresses that you want to handle client connections. You define load balancing groups using &lt;a href=&#34;../../../../en/admin/managing-db/managing-nodes/fault-groups/&#34;&gt;fault groups&lt;/a&gt;, &lt;a href=&#34;../../../../en/architecture/eon-concepts/subclusters/&#34;&gt;subclusters&lt;/a&gt;, or a list of network addresses.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One or more &lt;strong&gt;routing rules&lt;/strong&gt; that map a range of client IP addresses to a connection load balancing group.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a client connects to a node in the database with load balancing enabled, the node evaluates all of the routing rules based on the client&#39;s IP address to determine if any match. If more than one rule matches the IP address, the node applies the most specific rule (the one that affects the fewest IP addresses).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/load-balance-intro-pt1.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;If the node finds a matching rule, it uses the rule to determine the pool of potential nodes to handle the client connection. When evaluating potential target nodes, it always ensures that the nodes are currently up. The initially-contacted node then chooses one of the nodes in the group based on the group&#39;s distribution scheme. This scheme can be either choosing a node at random, or choosing a node in a rotating &amp;quot;round-robin&amp;quot; order. For example, in a three-node cluster, the round robin order would be node 1, then node 2, then node 3, and then back to node 1 again.&lt;/p&gt;
&lt;p&gt;After it processes the rules, if the node determines that another node should handle the client&#39;s connection, it tells the client which node it has chosen. The client disconnects from the initial node and connects to the chosen node to continue with the connection process (either negotiating encryption if the connection has TLS/SSL enabled, or authentication).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/load-balance-intro-pt2.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;If the initial node chooses itself based on the routing rules, it tells the client to proceed to the next step of the connection process.&lt;/p&gt;
&lt;p&gt;If no routing rule matches the incoming IP address, the node checks to see if classic connection load balancing is enabled by both OpenText™ Analytics Database and the client. If so, it handles the connection according to the classic load balancing policy. See &lt;a href=&#34;../../../../en/admin/managing-client-connections/connection-load-balancing/classic-connection-load-balancing/#&#34;&gt;Classic connection load balancing&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;Finally, if the database is running in Eon Mode, the node tries to apply a default interior load balancing rule. See &lt;a href=&#34;#Default&#34;&gt;Default Subcluster Interior Load Balancing Policy&lt;/a&gt; below.&lt;/p&gt;
&lt;p&gt;If no routing rule matches the incoming IP address and classic load balancing and the default subcluster interior load balancing rule did not apply, the node handles the connection itself. It also handles the connection itself if it cannot follow the load balancing rule. For example, if all nodes in the load balancing group targeted by the rule are down, then the initially-contacted node handles the client connection itself. In this case, the node does not attempt to apply any other less-restrictive load balancing rules that would apply to the incoming connection. It only attempts to apply a single load balancing rule.&lt;/p&gt;
&lt;h2 id=&#34;use-cases&#34;&gt;Use cases&lt;/h2&gt;
&lt;p&gt;Using load balancing policies you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ensure connections originating from inside or outside of your internal network are directed to a valid IP address for the client. For example, suppose your database nodes have two IP addresses: one for the external network and another for the internal network. These networks are mutually exclusive. You cannot reach the private network from the public, and you cannot reach the public network from the private. Your load balancing rules need to provide the client with an IP address they can actually reach.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/load-balancing-inertan-external-network-diag1.svg&#34; alt=&#34;&#34;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enable access to multiple nodes of a database cluster that are behind a NAT router. A NAT router is accessible from the outside network via a single IP address. Systems within the NAT router&#39;s private network can be accessed on this single IP address using different port numbers. You can create a load balancing policy that redirects a client connection to the NAT&#39;s IP address but with a different port number.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/nat-routing-diag1.svg&#34; alt=&#34;&#34;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Designate sets of nodes to service client connections from an IP address range. For example, if your ETL systems have a set range of IP addresses, you could limit their client connections to an arbitrary set of database nodes, a subcluster, or a fault group. This technique lets you isolate the overhead of servicing client connections to a few nodes. It is useful when you are using subclusters in an Eon Mode database to isolate workloads (see &lt;a href=&#34;../../../../en/architecture/eon-concepts/subclusters/#&#34;&gt;Subclusters&lt;/a&gt; for more information).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/eon-workload-balancing-diag1.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;using-connection-load-balancing-policies-with-ipv4-and-ipv6&#34;&gt;Using connection load balancing policies with IPv4 and IPv6&lt;/h2&gt;
&lt;p&gt;Connection load balancing policies work with both IPv4 and IPv6. As far as the load balancing policies are concerned, the two address families represent separate networks. If you want your load balancing policy to handle both IPv4 and IPv6 addresses, you must create separate sets of network addresses, load balancing groups, and rules for each protocol. When a client opens a connection to a node in the cluster, the addressing protocol it uses determines which set of rules the database consults when deciding whether and how to balance the connection.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../../images/connection-load-balancing/load-balancing-ipv6-vs-ipv4.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;Default&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;default-subcluster-interior-load-balancing-policy&#34;&gt;Default subcluster interior load balancing policy&lt;/h2&gt;
&lt;p&gt;Databases running in Eon Mode have a default connection load balancing policy that helps spread the load of handling client connections among the nodes in a subcluster. When a client connects to a node while opting into connection load balancing, the node checks for load balancing policies that apply to the client&#39;s IP address. If it does not find any applicable load balancing rule, and classic load balancing is not enabled, the node falls back to the default interior load balancing rule. This rule distributes connections among the nodes in the same subcluster as the initially-contacted node.&lt;/p&gt;
&lt;p&gt;As with other connection load balancing policies, the nodes in the subcluster must have a network address defined for them to be eligible to handle the client connection. If no nodes in the subcluster have a network address, the node does not apply the default subcluster interior load balancing rule, and the connection is not load balanced.&lt;/p&gt;
&lt;p&gt;This default rule is convenient when you are primarily interested in load balancing connections within each subcluster. You just create network addresses for the nodes in your subcluster. You do not need to create load balancing groups or rules. Clients that opt-in to load balancing are then automatically balanced among the nodes in the subcluster.&lt;/p&gt;
&lt;h3 id=&#34;interior-load-balancing-policy-with-multiple-network-addresses&#34;&gt;Interior load balancing policy with multiple network addresses&lt;/h3&gt;
&lt;p&gt;If your nodes have multiple network addresses, the default subcluster interior load balancing rule chooses the address that was created first as the target of load balancing rule. For example, suppose you create a network address on a node for the private IP address 192.168.1.10. Then you create another network address for the node for the public IP address 233.252.0.1. The default subcluster interior connection load balancing rule always selects 192.168.1.10 as the target of the rule.&lt;/p&gt;
&lt;p&gt;If you want the default interior load balancing rule to choose a different network address as its target, drop the other network addresses on the node and then recreate them. Deleting and recreating other addresses makes the address you want the rule to select the oldest address. For example, suppose you want the rule to use a public address (233.252.0.1) that was created after a private address (192.168.1.10). In this case, you can drop the address for 192.168.1.10 and then recreate it. The rule then defaults to the older public 233.252.0.1 address.&lt;/p&gt;
&lt;p&gt;If you intend to create multiple network addresses for the nodes in your subcluster, create the network addresses you want to use with the default subcluster interior load balancing first. For example, suppose you want to use the default interior load balancing subcluster rule to load balance most client connections. However, you also want to create a connection load balancing policy to manage connections coming in from a group of ETL systems. In this case, create the network addresses you want to use for the default interior load balancing rule first, then create the network addresses for the ETL systems.&lt;/p&gt;
&lt;h2 id=&#34;load-balancing-policies-vs-classic-load-balancing&#34;&gt;Load balancing policies vs. classic load balancing&lt;/h2&gt;
&lt;p&gt;There are several differences between the classic load balancing feature and the load balancing policy feature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In classic connection load balancing, you just enable the load balancing option on both client and server, and load balancing is enabled. There are more steps to implement load balancing policies: you have to create addresses, groups, and rules and then enable load balancing on the client.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Classic connection load balancing only supports a single, cluster-wide policy for redirecting connections. With connection load balancing policies, you get to choose which nodes handle client connections based on the connection&#39;s origin. This gives you more flexibility to handle complex situations. Examples include routing connections through a NAT-based router or having nodes that are accessible via multiple IP addresses on different networks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In classic connection load balancing, each node in the cluster can only be reached via a single IP address. This address is set in the EXPORT_ADDRESS column of the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/nodes/#&#34;&gt;NODES&lt;/a&gt; system table. With connection load balancing policies, you can create a network address for each IP address associated with a node. Then you create rules that redirect to those addresses.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;steps-to-create-a-load-balancing-policy&#34;&gt;Steps to create a load balancing policy&lt;/h2&gt;
&lt;p&gt;There are three steps you must follow to create a load balancing policy:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create one or more network addresses for each node that you want to participate in the connection load balancing policies.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create one or more load balancing groups to be the target of the routing rules. Load balancing groups can target a collection of specific network addresses. Alternatively, you can create a group from a fault group or subcluster. You can limit the members of the load balance group to a subset of the fault group or subcluster using an IP address filter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create one or more routing rules.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;While not absolutely necessary, it is always a good idea to idea to test your load balancing policy to ensure it works the way you expect it to.&lt;/p&gt;
&lt;p&gt;After following these steps, the database will apply the load balancing policies to client connections that opt into connection load balancing. See &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/load-balancing-ado-net/#&#34;&gt;Load balancing in ADO.NET&lt;/a&gt;, &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/load-balancing-jdbc/#&#34;&gt;Load balancing in JDBC&lt;/a&gt;, and &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/ccpp/load-balancing/#&#34;&gt;Load balancing&lt;/a&gt;, for information on enabling load balancing on the client. For vsql, use the &lt;code&gt;-C&lt;/code&gt; command-line option to enable load balancing.&lt;/p&gt;
&lt;p&gt;These steps are explained in the other topics in this section.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;





      </description>
    </item>
    
    <item>
      <title>Admin: Workload routing</title>
      <link>/en/admin/managing-client-connections/connection-load-balancing/workload-routing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-client-connections/connection-load-balancing/workload-routing/</guid>
      <description>
        
        
        &lt;p&gt;Workload routing routes client connections to &lt;a href=&#34;../../../../en/eon/managing-subclusters/&#34;&gt;subclusters&lt;/a&gt;. This lets you reserve subclusters for certain types of tasks.&lt;/p&gt;
&lt;p&gt;When a client connects to OpenText™ Analytics Database, they connect to a &lt;a class=&#34;glosslink&#34; href=&#34;../../../../en/glossary/connection-node/&#34; title=&#34;In the context of workload routing, the connection node is a node in the default subcluster that the client first connects to before being routed to an execution node in some subcluster as specified by the routing rule associated with the client&amp;#39;s workload.&#34;&gt;Connection node&lt;/a&gt;, which then routes the client to the correct subcluster based on the client&#39;s specified workload, &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-users/&#34;&gt;user&lt;/a&gt;, or &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/&#34;&gt;role&lt;/a&gt; and the database&#39;s &lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-routing-rule/&#34;&gt;routing rules&lt;/a&gt;. If multiple subclusters are associated with the same workload, the client is randomly routed to one of those subclusters.&lt;/p&gt;
&lt;p&gt;In this context, &amp;quot;routing&amp;quot; refers to the connection node acting as a proxy for the client and the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../en/glossary/execution-node/&#34; title=&#34;In the context of workload routing, the execution node handles the execution of client queries.&#34;&gt;Execution node&lt;/a&gt; in the target subcluster. All queries and query results are first sent to the connection node and then passed on to the execution node and client, respectively.&lt;/p&gt;
&lt;p&gt;The primary advantages of this type of load balancing are as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Database administrators can associate certain subclusters with certain workloads and roles (as opposed to client IP addresses).&lt;/li&gt;
&lt;li&gt;Clients do not need to know anything about the subcluster they will be routed to, only the type of workload they have or the role they should use.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Workload routing depends on actions from both the database administrator and the client:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The database administrator must create rules for handling various workloads.&lt;/li&gt;
&lt;li&gt;The client must either specify the type of workload they have or have an enabled role (either from a manual &lt;a href=&#34;../../../../en/sql-reference/statements/set-statements/set-role/#&#34;&gt;SET ROLE&lt;/a&gt; or &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles-automatically/&#34;&gt;default role&lt;/a&gt;) associated with a routing rule.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;view-the-current-workload&#34;&gt;View the current workload&lt;/h2&gt;
&lt;p&gt;To view the workload associated with the current session, use &lt;a href=&#34;../../../../en/sql-reference/statements/show/&#34;&gt;SHOW WORKLOAD&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SHOW&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;setting&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;----------+------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;workload&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;my_workload&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;create-workload-routing-rules&#34;&gt;Create workload routing rules&lt;/h2&gt;
&lt;p&gt;Routing rules apply to a client&#39;s specified workload and either user or role. If you specify more than one subcluster in a routing rule, the client is randomly routed to one of those subclusters.&lt;/p&gt;
&lt;p&gt;If multiple routing rules could apply to a client&#39;s session, the rule with the highest priority is used. For details, see &lt;a href=&#34;../../../../en/admin/managing-client-connections/connection-load-balancing/workload-routing/#priorities&#34;&gt;Priorities&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To view existing routing rules, see &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/workload-routing-rules/#&#34;&gt;WORKLOAD_ROUTING_RULES&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To view workloads available to you and your &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles/&#34;&gt;enabled roles&lt;/a&gt;, use &lt;a href=&#34;../../../../en/sql-reference/statements/show/&#34;&gt;SHOW AVAILABLE WORKLOADS&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SHOW&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AVAILABLE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOADS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;                &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;setting&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;---------------------+------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;available&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;workloads&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reporting&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;workload-based-routing&#34;&gt;Workload-based routing&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-routing-rule/&#34;&gt;Workload-based routing rules&lt;/a&gt; apply to clients that specify a particular workload, routing them to one of the subclusters listed in the rule. In this example, when a client connects to the database and specifies the &lt;code&gt;analytics&lt;/code&gt; workload, their connection is randomly routed to either &lt;code&gt;sc_analytics&lt;/code&gt; or &lt;code&gt;sc_analytics_2&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics_2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To alter a routing rule, use &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-routing-rule/#&#34;&gt;ALTER ROUTING RULE&lt;/a&gt;. For example, to route &lt;code&gt;analytics&lt;/code&gt; workloads to &lt;code&gt;sc_analytics&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To add or remove a subcluster, use &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-routing-rule/#&#34;&gt;ALTER ROUTING RULE&lt;/a&gt;. For example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;To add a subcluster &lt;code&gt;sc_01&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ADD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_01&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;To remove a subcluster &lt;code&gt;sc_01&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;REMOVE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_01&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To drop a routing rule, use &lt;a href=&#34;../../../../en/sql-reference/statements/drop-statements/drop-routing-rule/#&#34;&gt;DROP ROUTING RULE&lt;/a&gt; and specify the workload. For example, to drop the routing rule for the &lt;code&gt;analytics&lt;/code&gt; workload:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DROP&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;user--and-role-based-routing&#34;&gt;User- and role-based routing&lt;/h3&gt;
&lt;p&gt;You can &lt;a href=&#34;../../../../en/sql-reference/statements/grant-statements/grant-workload/&#34;&gt;grant&lt;/a&gt; USAGE privileges to a &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-users/&#34;&gt;user&lt;/a&gt; or &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/&#34;&gt;role&lt;/a&gt; to let them route their queries to one of the subclusters listed in the routing rule. In this example, when a client connects to the database and enables the &lt;code&gt;analytics_role&lt;/code&gt; role, their connection is randomly routed to either &lt;code&gt;sc_analytics&lt;/code&gt; or &lt;code&gt;sc_analtyics_2&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics_2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GRANT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;USAGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ON&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics_role&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Users can then &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles/&#34;&gt;enable&lt;/a&gt; the role and set their workload to &lt;code&gt;analytics&lt;/code&gt; for the session:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ROLE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics_role&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SESSION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Users can also enable the role automatically by setting it as a default role and then specify the workload when they connect. For details on default roles, see &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles-automatically/#&#34;&gt;Enabling roles automatically&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Similarly, in this example, when a client connects to the database as user &lt;code&gt;analytics_user&lt;/code&gt;, they are randomly routed to either &lt;code&gt;sc_analytics&lt;/code&gt; or &lt;code&gt;sc_analtyics_2&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SUBCLUSTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sc_analytics_2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GRANT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;USAGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ON&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics_user&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;priorities&#34;&gt;Priorities&lt;/h4&gt;
&lt;p&gt;Only one workload routing rule can apply to a session at any given time. If multiple routing rules are &lt;a href=&#34;../../../../en/sql-reference/statements/grant-statements/grant-workload/&#34;&gt;granted&lt;/a&gt; to a user or role, the priority associated with the rule determines which one applies. If multiple rules have the highest priority, the database chooses one of those rules randomly.&lt;/p&gt;
&lt;p&gt;You can force a routing rule to apply to your session, ignoring priority, by using &lt;a href=&#34;../../../../en/sql-reference/statements/set-statements/set-session-workload/#&#34;&gt;SET SESSION WORKLOAD&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this example, the user Gunther is granted usage on the routing rule for workload &lt;code&gt;reporting&lt;/code&gt;. The following statement does not specify a priority, so the priority defaults to 0:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GRANT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;USAGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ON&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reporting&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Gunther&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Gunther also has the roles &lt;code&gt;analytics_role&lt;/code&gt; and &lt;code&gt;qa_role&lt;/code&gt;, each of which are granted their own routing rules:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GRANT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;USAGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ON&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics_role&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GRANT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;USAGE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ON&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;qa&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;qa_role&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When Gunther first connects to the database, the routing rule for &lt;code&gt;reporting&lt;/code&gt; applies. If Gunther then &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles/&#34;&gt;enables&lt;/a&gt; the &lt;code&gt;analytics_role&lt;/code&gt; and &lt;code&gt;qa_role&lt;/code&gt;, the routing rule for &lt;code&gt;qa_role&lt;/code&gt; applies instead because it has the greatest priority value.&lt;/p&gt;
&lt;p&gt;Similarly, if the priority of the routing rule for &lt;code&gt;reporting&lt;/code&gt; is changed to 3 with &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-routing-rule/#&#34;&gt;ALTER ROUTING RULE&lt;/a&gt;, that rule applies instead:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROUTING&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RULE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reporting&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PRIORITY&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To ignore priorities and force the session to use the &lt;code&gt;analytics&lt;/code&gt; rule, Gunther can use &lt;a href=&#34;../../../../en/sql-reference/statements/set-statements/set-session-workload/#&#34;&gt;SET SESSION WORKLOAD&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SESSION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;analytics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;specify-a-workload&#34;&gt;Specify a workload&lt;/h3&gt;
&lt;p&gt;The workload for a given connection can be reported by the client when they connect. The method for specifying a workload depends on the client.&lt;/p&gt;
&lt;p&gt;The following examples set the workload to &lt;code&gt;analytics&lt;/code&gt; for several clients. After you connect, you can verify that the workload was set with &lt;a href=&#34;../../../../en/sql-reference/statements/show/&#34;&gt;SHOW WORKLOAD&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/connecting-to/using-vsql/connecting-from-command-line/command-line-options/r-workload/&#34;&gt;vsql&lt;/a&gt; uses &lt;code&gt;--workload&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ vsql --dbname databaseName --host node01.example.com --username Bob --password my_pwd --workload analytics
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-properties/&#34;&gt;JDBC&lt;/a&gt; uses &lt;code&gt;workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;jdbc:vertica://node01.example.com:5443/databaseName?user=analytics_user&amp;amp;password=***&amp;amp;workload=analytics
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href=&#34;../../../../en/connecting-to/client-libraries/client-drivers/install-config/odbc/creating-an-odbc-data-source-name-dsn/odbc-dsn-connection-properties/&#34;&gt;ODBC&lt;/a&gt; uses &lt;code&gt;Workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Database=databaseName;Servername=node01.mydomain.com;Port=5433;UID=analytics_user;PWD=***;Workload=analytics
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/c/connecting-to-db/ado-net-connection-properties/&#34;&gt;ADO.NET&lt;/a&gt; uses &lt;code&gt;Workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Database=databaseName;Host=node01.mydomain.com;Port=5433;User=analytics_user;Password=***;Workload=analytics
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/vertica-sql-go#creating-a-connection&#34;&gt;vertica-sql-go&lt;/a&gt; uses &lt;code&gt;Workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var query = url.URL{
    Scheme:   &amp;#34;vertica&amp;#34;,
    User:     url.UserPassword(user, password),
    Host:     fmt.Sprintf(&amp;#34;%s:%d&amp;#34;, host, port),
    Path:     databaseName,
    Workload: &amp;#34;analytics&amp;#34;,
    RawQuery: rawQuery.Encode(),
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/vertica-sql-go#creating-a-connection&#34;&gt;vertica-python&lt;/a&gt; uses &lt;code&gt;workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;conn_info = {&amp;#39;host&amp;#39;: &amp;#39;127.0.0.1&amp;#39;,
            &amp;#39;port&amp;#39;: 5433,
            &amp;#39;user&amp;#39;: &amp;#39;some_user&amp;#39;,
            &amp;#39;password&amp;#39;: &amp;#39;my_pwd&amp;#39;,
            &amp;#39;database&amp;#39;: &amp;#39;databaseName&amp;#39;,
            &amp;#39;workload&amp;#39;: &amp;#39;analytics&amp;#39;,
            # autogenerated session label by default,
            &amp;#39;session_label&amp;#39;: &amp;#39;some_label&amp;#39;,
            # default throw error on invalid UTF-8 results
            &amp;#39;unicode_error&amp;#39;: &amp;#39;strict&amp;#39;,
            # SSL is disabled by default
            &amp;#39;ssl&amp;#39;: False,
            # autocommit is off by default
            &amp;#39;autocommit&amp;#39;: True,
            # using server-side prepared statements is disabled by default
            &amp;#39;use_prepared_statements&amp;#39;: False,
            # connection timeout is not enabled by default
            # 5 seconds timeout for a socket operation (Establishing a TCP connection or read/write operation)
            &amp;#39;connection_timeout&amp;#39;: 5}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/vertica-nodejs&#34;&gt;vertica-nodejs&lt;/a&gt; uses &lt;code&gt;workload&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const client = new Client({
    user:     &amp;#34;vertica_user&amp;#34;,
    host:     &amp;#34;node01.example.com&amp;#34;,
    database: &amp;#34;verticadb&amp;#34;,
    password: &amp;#34;&amp;#34;,
    port:     &amp;#34;5433&amp;#34;,
    workload: &amp;#34;analytics&amp;#34;,
})
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Clients can also change their workload type after they connect with &lt;a href=&#34;../../../../en/sql-reference/statements/set-statements/set-session-workload/#&#34;&gt;SET SESSION WORKLOAD&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SESSION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WORKLOAD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;my_workload&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
  </channel>
</rss>
