Does SELECT DISTINCT on a Cassandra index column work
<p>Can the Cassandra <code>SELECT DISTINCT</code> operation be used to find all the unique values of a column <strong>if</strong> that column has an index on it?</p>

<p>My question is not the same as simply asking how to <a href="https://stackoverflow.com/questions/35840493/finding-distinct-values-of-non-primary-key-column-in-cql-cassandra">find distinct values of a non primary key columns</a>. I realize that Cassandra does not allow queries that would require a table-scan, because they would be inefficient; here the presence of an index eliminates the need for a table scan.</p>

<p>If I have a table thus:</p>

<pre><code>CREATE TABLE thing (
   id uuid,
   version bigint,
   name text,
   ... data columns ...
   PRIMARY KEY ((id),version)
);
CREATE INDEX ON thing(name);
</code></pre>

<p>I can  <code>SELECT DISTINCT id FROM thing;</code> to get all the thing IDs. That requires one response from each node in my cluster, with each response returning the keys for its node.</p>

<p>But can I <code>SELECT DISTINCT name FROM thing;</code> to get all the thing names? That should also require only one response from each node in my cluster, with each response constructed only by examining the portion of the index on its node. And if <code>name</code> is a good column on which to have an index, each response would be smaller that the query for the primary keys (there should be fewer names than partition keys).</p>