Efficient token scan using the scyllaDB fork of gocql

Installation details
#ScyllaDB version: 6.2.1
#Cluster size: 3 nodes
os (RHEL/CentOS/Ubuntu/AWS AMI): Ubuntu

I have configured hosts with port 19042 to use the shard aware functionality. Most of my queries use the TokenAwareHostSelection policy. However, there are cases where I need to do a full table scan using tokens in a certain tool. I do create a connection with just RoundRobinHostSelection policy in this case. Question is should I also configure the host in this case with a port of 9042 instead of 19042? Or does the driver automatically route the query to port 9042 even if my original connection is to port 19042 in such cases?

Hosts that you feed to the NewCluster(hosts…), only matter for the first control connection, when driver has it connected, it reads cluster information from the cluster and uses shard-awareness port if it is available for all other connections, including control connection.

Worth to say that using full scans is a bad idea, probably you need to remodel your data, we have a good course “Data Modeling and Application Development” in Scylla University, please take your time to read it.

1 Like